Skip to content

Terminal UI beta

mold includes an interactive terminal UI for browsing models, tuning parameters, generating images with live progress, and previewing results — all without leaving the terminal.

Built on ratatui with Kitty graphics protocol support for pixel-perfect image preview in terminals like Ghostty, kitty, and WezTerm. Falls back to halfblock rendering in other terminals.

Beta

The TUI is under active development. Core generation, model management, gallery, and image preview work well. Some features (prompt expansion, theme customization) are planned but not yet implemented.

mold TUI — Generate view with image preview

Quick Start

bash
mold tui

The TUI launches in the Generate view with your cursor in the prompt field. Type a prompt, press Enter, and watch the progress panel as your image generates. The result appears in the Preview panel and is saved to ~/.mold/output/.

TIP

The tui feature must be compiled in. Pre-built releases and the Nix package include it by default. If building from source, add --features tui to your build command.

Auto-Start Server

By default, mold tui automatically starts a background mold serve process if no server is already running. This keeps models hot between generations for faster subsequent runs. The server is killed when you quit the TUI.

  • mold tui — auto-starts server on localhost:7680
  • mold tui --local — skip server, use local GPU only
  • mold tui --host http://gpu:7680 — connect to an existing remote server

Server Logs

When the TUI auto-starts a background server, logs are written to ~/.mold/logs/ with daily rotation. This is useful for debugging generation failures since the server's stderr is suppressed while the TUI controls the terminal.

Log files follow the naming pattern mold-server.YYYY-MM-DD.log and are automatically cleaned up after 7 days (configurable via logging.max_days in ~/.mold/config.toml).

To view live logs while the TUI is running, open a second terminal:

bash
tail -f ~/.mold/logs/mold-server.$(date +%Y-%m-%d).log

You can also enable file logging for manual mold serve with --log-file, or permanently via the config file:

toml
[logging]
level = "info"
file = true
# dir = "~/.mold/logs"
# max_days = 7

Views

The TUI has three main views, shown as tabs at the top of the screen:

ViewPurpose
GenerateWrite prompts, tune parameters, generate images
GalleryBrowse generated images with preview
ModelsView installed and available models

Switch views with Esc then 1/2/3, arrow keys, or click the tabs. Alt+1/Alt+2/Alt+3 works from anywhere.

Generate View

The main workspace with five panels:

  • Prompt — Multi-line text area (Shift+Enter for newlines, emacs keybindings)
  • Negative — (CFG models only) Describes what to avoid
  • Parameters — Model, dimensions, steps, guidance, seed, and more
  • Info — Model description, system memory, process memory usage
  • Preview — Generated image with Kitty/sixel/halfblock rendering

Editing Parameters

Navigate to Parameters with Tab or click, then:

  • j/k or arrow keys to move between fields
  • +/- or left/right to adjust numeric values
  • Enter or click to activate a field:
    • Model — opens the fuzzy model selector
    • Seed (mode row) — cycles random / fixed / increment
    • Seed (value row) — opens seed value input popup
    • Format / Mode / Expand / Offload — toggles the value
    • Scheduler — cycles through Ddim, Euler Ancestral, UniPC
    • Reset — restores all parameters to model defaults (keeps prompt)
    • Unload — unloads the model from GPU to free memory

Seed Modes

Cycle with Ctrl+R or +/- on the Seed field:

ModeBehavior
randomNew random seed each generation
fixedSame seed every time (reproducibility)
incrementSeed +1 after each generation

Press Enter on the Seed value row to type an exact value.

Model Selector

Press Enter on the Model field or Ctrl+M from anywhere:

  • Type to fuzzy-filter the model list
  • j/k, arrow keys, or scroll wheel to navigate
  • Enter to select — parameters update to model defaults
  • Esc to cancel

Prompt History

Previous prompts persist across sessions in ~/.mold/prompt-history.jsonl:

  • Up/Down arrows at top/bottom of prompt recall history
  • Ctrl+P/Ctrl+N also navigate history
  • / in navigation mode opens fuzzy search over all prompts

Shell Keybindings

The prompt editor supports standard emacs/shell keybindings:

KeyAction
Ctrl+ABeginning of line
Ctrl+EEnd of line
Ctrl+KKill to end of line
Ctrl+UKill to start
Ctrl+WDelete word back
Ctrl+DDelete forward
Ctrl+FForward char
Ctrl+BBackward char

Browse generated images stored in ~/.mold/output/ (or MOLD_OUTPUT_DIR). Images are displayed as a thumbnail grid with cached 256x256 thumbnails for fast loading. Only images with embedded mold:parameters metadata are shown (PNG and JPEG).

Grid Mode

KeyAction
h/j/k/lNavigate the grid
Arrow keysNavigate the grid
EnterOpen detail view
eLoad into Generate (edit)
dDelete image (with confirmation)
oOpen in system viewer
EscBack to Generate

Detail Mode

Press Enter on a grid thumbnail to see the full image with all metadata.

KeyAction
eLoad into Generate (edit)
rRegenerate immediately
dDelete image
oOpen in system viewer
j/kPrevious / next image
EscBack to grid

Thumbnails

Thumbnails are cached at ~/.mold/cache/thumbnails/ and generated automatically on first scan and after each generation. Delete the cache directory to force regeneration.

Models View

See all installed and available models with family, size, defaults, and status.

KeyAction
j/kNavigate the model list
EnterSet as default model
pPull (download) a model
uUnload the active model (GPU)
EscBack to Generate

Press Esc to enter navigation mode, where number keys and arrows switch views.

Global Shortcuts

KeyAction
EscUnfocus / navigation mode
1 / 2 / 3Switch views (in navigation mode)
Left / RightCycle views (in navigation mode)
Alt+1 / 2 / 3Switch views (from anywhere)
TabCycle focus to next panel
Shift+TabCycle focus to previous panel
Ctrl+CQuit
qQuit (when not in a text field)
?Show help overlay

Generate Shortcuts

KeyContextAction
EnterPromptStart generation
EnterParametersActivate field (selector/toggle)
Ctrl+GAnyStart generation
Ctrl+MAnyOpen model selector
Ctrl+RAnyCycle seed mode
+/-ParametersAdjust numeric value
j/kParametersNavigate fields

Mouse Support

  • Click tabs to switch views
  • Click panels to focus them
  • Click parameter rows to select and activate
  • Click gallery thumbnails to select, double-click for detail view
  • Click model rows to select
  • Scroll wheel navigates lists and popups

Session Persistence

All settings are saved to ~/.mold/tui-session.json after each generation and restored on next launch:

  • Prompt and negative prompt text
  • Model selection
  • All generation parameters (dimensions, steps, guidance, seed mode, batch, format, scheduler, lora, expand, offload, strength)

Use Reset in the Actions section of Parameters to restore model defaults without losing your prompt. Unload frees GPU memory by unloading the active model.

Generated images are saved to ~/.mold/output/ by default (override with MOLD_OUTPUT_DIR env var or output_dir in config). All images include embedded PNG metadata that preserves the full generation parameters, making them portable across machines.

Info Panel

The Info panel below Parameters shows:

  • Model description from the manifest
  • System memory — free and available (macOS unified memory / NVIDIA VRAM)
  • Mold memory — total physical footprint of all mold processes (includes mmap'd model weights)

Server Fallback

The TUI uses a three-mode inference system:

ModeBehavior
autoTry server first, fall back to local GPU (default)
localForce local GPU only
remoteForce remote server only (error if unreachable)

Cycle with +/- on the Mode field. The Host field (visible in auto/remote mode) can be edited with Enter to point at a custom server. Host input is normalized automatically: hal9000 becomes http://hal9000:7680, hal9000:8080 becomes http://hal9000:8080, and full URLs like https://gpu.example.com are used as-is. The TUI verifies connectivity before switching.

Image Preview

The TUI auto-detects your terminal's graphics protocol at startup:

ProtocolTerminalsQuality
KittyGhostty, kitty, WezTermPixel-perfect
Sixelfoot, xterm, mltermFull color
iTerm2iTerm2, HyperFull color
HalfblocksEverything elseUnicode blocks

Building with TUI Support

The TUI is behind the tui feature flag on mold-ai:

bash
cargo build --release -p mold-ai --features metal,tui
bash
cargo build --release -p mold-ai --features cuda,tui
bash
cargo build --release -p mold-ai --features metal,preview,discord,expand,tui

The Nix flake, pre-built releases, and Docker images include the TUI by default.

Theme

The TUI uses a Catppuccin Mocha color palette. Theme customization via config.toml is planned for a future release.