A terminal UI for local AI image generation with Stable Diffusion and FLUX.
Built with the Charm Ruby ecosystem (bubbletea, lipgloss, bubbles) and stable-diffusion.cpp.
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| Key | Action |
|---|---|
tab |
Cycle focus between prompt, negative prompt, and params |
enter |
Generate image (when in prompt/negative) |
^n |
Open model picker |
^d |
Download models from HuggingFace |
^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 |
^t |
Theme picker |
^e |
Open last image in viewer |
^f |
Fullscreen image preview |
^x |
Cancel generation |
^r |
Randomize seed |
^q |
Quit |
Place .gguf, .safetensors, or .ckpt model files in ~/models (or set CHEWY_MODELS_DIR).
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 and download models directly from HuggingFace.
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.
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/sdtui/config.yml. You can also set:
| Env var | Description |
|---|---|
SD_BIN |
Path to the sd binary |
CHEWY_MODELS_DIR |
Model directory (default: ~/models) |
CHEWY_OUTPUT_DIR |
Output directory (default: ./outputs) |
CHEWY_LORA_DIR |
LoRA directory (default: ~/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/sdThis is a single-file app:
chewy.rb— the entire TUI applicationGemfile/Gemfile.lock— Ruby dependenciesVERSION— semver, read at runtime and used by CI for releasesFormula/— Homebrew formulas (sd-cpp and chewy)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
