A terminal UI for AI image and video generation with Stable Diffusion, FLUX, Wan, DALL-E, Imagen, and more.
Built with the Charm Ruby ecosystem (bubbletea, lipgloss, bubbles). Supports local generation via stable-diffusion.cpp and 5 cloud providers.
Website • Documentation • Issues
brew install Holy-Coders/chewy/chewyThis installs both chewy and sd (the stable-diffusion.cpp inference engine with Metal GPU acceleration).
Requirements: Ruby 4.0+, stable-diffusion.cpp
git clone https://github.com/Holy-Coders/chewy.git
cd chewy
bundle install
ruby chewy.rbSet SD_BIN to point to your sd binary if it's not on your PATH.
chewy # Launch the TUI
chewy list # List all generated images
chewy delete FILE # Delete a generated image
chewy help # Show helpChewy supports 6 image generation backends. Press ^y to switch providers.
| Provider | Models | Type |
|---|---|---|
| Local (sd.cpp) | SD 1.x/2.x/3.5, SDXL, FLUX, Wan Video (.gguf/.safetensors/.ckpt) | Local |
| OpenAI | GPT Image 1, DALL-E 3, DALL-E 2 | API |
| Gemini | Imagen 3, Imagen 3 Fast, Gemini 2.0 Flash | API |
| HuggingFace | FLUX.1 Schnell/Dev, SDXL, SD 3.5 Large, HiDream | API |
| OpenAI-Compatible | Any model via custom endpoint | API |
API keys are entered in-app (stored securely with chmod 600) or via environment variables (OPENAI_API_KEY, GEMINI_API_KEY, HUGGINGFACE_API_KEY).
| Key | Action |
|---|---|
tab |
Cycle focus between prompt, negative prompt, and params |
enter |
Generate image (when in prompt/negative) |
up/down |
Cycle through prompt history (in prompt field) |
^y |
Switch provider |
^n |
Open model picker |
^d |
Download models (HuggingFace / CivitAI) |
^t |
Theme picker (10 built-in + custom themes) |
^a |
Gallery |
^g |
Generation history |
^b |
Browse for init image (img2img) |
^v |
Paste image from clipboard (img2img) |
^u |
Clear init image |
^l |
LoRA selection |
^p |
Presets |
^e |
Open last image in viewer |
^f |
Fullscreen image preview |
^x |
Cancel generation |
^w |
Clear prompt and image (start fresh) |
^r |
Randomize seed |
alt+h |
Search prompt history |
alt+q |
Queue current generation |
alt+s |
Seed sweep (4 random seeds) |
alt+e |
AI enhance prompt |
alt+n |
AI generate negative prompt |
alt+r |
AI random creative prompt |
F1 |
Help overlay (all shortcuts) |
^q |
Quit |
In the gallery: c copies the selected image to your clipboard, u upscales it (Real-ESRGAN 4x), p loads its prompt and settings.
Place .gguf, .safetensors, or .ckpt model files in ~/.config/chewy/models (or set CHEWY_MODELS_DIR). Full filenames are shown in the model picker.
Chewy also scans for models from:
- DiffusionBee (
~/.diffusionbee) - Draw Things (
~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models)
Press ^d inside chewy to browse recommended starter models or search HuggingFace and CivitAI. Curated picks include SD 1.5, SD 3.5 Medium, SDXL Turbo, DreamShaper, and FLUX.1 Schnell.
FLUX models require companion files (clip_l, t5xxl, vae). Chewy will automatically download these when you first try to generate with a FLUX model. You'll need a HuggingFace token with read access.
Chewy also detects and runs Chroma (uncensored Apache-2.0 FLUX derivative), FLUX.1 Kontext (reference-image edits), FLUX.2 Klein/Dev, Z-Image, and Qwen-Image — companion files are downloaded automatically per model family.
In the gallery, press u on any image to upscale it 4x with Real-ESRGAN. The upscaler model is downloaded automatically on first use. Output is saved alongside the original.
alt+q— queue the current prompt for generation. When the current one finishes, the next is launched automatically. Keep stacking prompts while one is running.alt+s— seed sweep: generate 4 variants of the current prompt with random seeds, queued back-to-back.
Press alt+h in the prompt field to open a fuzzy-searchable view of your prompt history. Type to filter, up/down to select, enter to load.
Chewy supports video generation via Wan 2.1 models using sd.cpp's -M vid_gen mode. Select a Wan model and Chewy will show a VIDEO badge, add Frames/FPS parameters, and output frame sequences with an in-terminal video player.
Note: Video generation is experimental and works best with dedicated GPU hardware. The Wan 1.3B model requires ~12GB RAM just for weights, plus additional memory for video frame generation. CPU-only generation is very slow (minutes per frame). Companion files (t5xxl, clip_vision, vae) are auto-downloaded on first use.
Video presets are available under ^p: Quick Preview, Standard, High Quality, and Img2Vid.
Place LoRA .safetensors files in ~/.config/chewy/loras (or set CHEWY_LORA_DIR). Press ^l to open the LoRA selector where you can toggle LoRAs on/off, adjust weights (0.0-2.0), and download new ones.
Press d in the LoRA panel to browse recommended LoRAs or search HuggingFace and CivitAI. Recommended picks include Detail Tweaker, LCM LoRA (for fast generation), Pixel Art, and Papercut styles. Chewy warns if a LoRA doesn't match your model's architecture (e.g. SDXL LoRA on SD 1.5 model).
Inpainting lets you selectively regenerate parts of an image while preserving others (e.g. change the background but keep the face). Set an init image (^b), then in the params panel navigate to Mask and:
- Press
gto auto-generate a center-preserve mask (keeps the face, regenerates the rest) - Press
pto open the mask painter — click to paint which areas to regenerate - Press
enterto browse for a custom mask image
White pixels in the mask = regenerate, black = keep. The "Inpaint - Face Preserve" preset configures everything automatically.
10 built-in color themes: Midnight (default), Dracula, Catppuccin, Tokyo Night, Gruvbox, Nord, Rose Pine, Solarized, Horizon, and Light. Press ^t to switch.
Custom themes: Drop a YAML file in ~/.config/chewy/themes/ with 13 color keys and it appears in the theme picker. Example ~/.config/chewy/themes/cyberpunk.yml:
primary: "#00FF41"
secondary: "#008F11"
accent: "#FF0090"
success: "#00FF41"
warning: "#FFD300"
error: "#FF0000"
text: "#E0E0E0"
text_dim: "#808080"
text_muted: "#505050"
surface: "#0D0D0D"
border_dim: "#333333"
border_focus: "#00FF41"
bar_text: "#000000"CLI commands (help, list, etc.) also use your selected theme colors. An animated pixel-art splash screen greets you on startup.
Press ^p to open the preset picker. Built-in presets include fast, quality, portrait, flux-fast, and flux-quality configurations. Save your own custom presets with your preferred settings.
Chewy can enhance your prompts, generate negative prompts, and create random creative prompts using a local or cloud LLM.
alt+e— Enhance your prompt (adds detail, lighting, composition, quality tags)alt+n— Auto-generate a negative prompt from your positive promptalt+r— Generate a random creative prompt from scratch- Click the ✨ Enhance / ✨ Generate button in the prompt box
LLM priority: Local (ollama/LM Studio) → OpenAI → Gemini → rule-based fallback. For the best local experience: brew install ollama && ollama pull llama3.2:3b.
Chewy remembers your prompt history across sessions. Press up/down in the prompt field to cycle through previous prompts. History is loaded from your generation metadata on disk, so past prompts are available even in a fresh session.
14 samplers (euler, euler_a, heun, dpm2, dpm++2s_a, dpm++2m, dpm++2mv2, ipndm, ipndm_v, lcm, ddim_trailing, tcd, res_multistep, res_2s) and 9 schedulers (discrete, karras, exponential, ays, gits, sgm_uniform, simple, smoothstep, kl_optimal). Configurable thread count for local generation.
Press ^b to browse for an input image, or ^v to paste from clipboard. Adjust the strength parameter (0.0-1.0) to control how much the output differs from the input. Use ^u to clear and go back to txt2img.
Config is stored at ~/.config/chewy/config.yml. Presets are stored at ~/.config/chewy/presets.yml.
| Env var | Description |
|---|---|
SD_BIN |
Path to the sd binary |
CHEWY_MODELS_DIR |
Model directory (default: ~/.config/chewy/models) |
CHEWY_OUTPUT_DIR |
Output directory (default: ./outputs) |
CHEWY_LORA_DIR |
LoRA directory (default: ~/.config/chewy/loras) |
git clone https://github.com/Holy-Coders/chewy.git
cd chewy
bundle installYou'll need stable-diffusion.cpp built and on your PATH (or set SD_BIN):
git clone --recursive https://github.com/leejet/stable-diffusion.cpp
cd stable-diffusion.cpp
mkdir build && cd build
cmake .. -DSD_METAL=ON # macOS with Metal GPU
cmake --build . --config Release
cp bin/sd-cli /usr/local/bin/sdchewy.rb— entrypoint (CLI routing + app launch)lib/chewy.rb— main Chewy class (init, update, view)lib/chewy/*.rb— 16 modules mixed into the Chewy classGemfile/Gemfile.lock— Ruby dependenciesVERSION— semver, read at runtime and used by CI for releasesFormula/— Homebrew formulas (sd-cpp and chewy)docs/— Landing page and documentation (GitHub Pages)logo.jpeg— the logo
| Gem | Purpose |
|---|---|
| bubbletea | Elm Architecture TUI framework |
| lipgloss | Terminal styling and layout |
| bubbles | TUI components (list, text input, spinner, progress) |
| chunky_png | PNG reading for terminal image rendering |
- Fork the repo
- Create a branch (
git checkout -b my-feature) - Make your changes to
chewy.rb - Test locally with
ruby chewy.rb - Open a PR
Bump the version in VERSION and push to main. CI will automatically:
- Create a GitHub release
- Update the Homebrew formula with the new sha256
MIT - Copyright (c) 2026 Holy Coders
