Generate images from text prompts directly in your terminal. Uses the Z-Image-Turbo model with a terminal-native workflow: generate, view inline, vary, save. Works in Ghostty and other terminals supporting the Kitty graphics protocol.
Role
Developer
Skills
Generate images from text prompts directly in your terminal. Uses the Z-Image-Turbo model with a terminal-native workflow: generate → view inline → vary → save. Works in Ghostty and other terminals supporting the Kitty graphics protocol.
# 1. Install dependencies
uv sync
# 2. Download the model from Hugging Face (~32GB)
HF_XET_HIGH_PERFORMANCE=1 hf download Tongyi-MAI/Z-Image-Turbo
# 3. Start generating
uv run python src/cli.pyuv run python src/cli.py # 640x480 (fast)
uv run python src/cli.py -W 1024 -H 1024 # 1024x1024 (high quality)
uv run python src/cli.py -s 6 # Fewer steps (faster)Interactive hotkeys:
The UI shows generation time, RAM usage, and GPU memory with a visual bar. Images auto-save to ~/Pictures/Autogen/ with prompt-based filenames.
uv run python src/ui.py # Standard UI
uv run python src/ui_optimized.py # With optimization optionsBased on benchmarking with 1024x1024 images, 9 steps:
Key Findings: torch.compile is NOT optimized for MPS yet (adds overhead). Model is already well-optimized for Apple Silicon. For faster generation: reduce resolution or decrease steps.
turbo-term/
├── src/
│ ├── cli.py # Terminal viewer with Kitty graphics
│ ├── generate.py # Simple generation script
│ ├── ui.py # Gradio web UI
│ └── ui_optimized.py # Web UI with optimization options
├── scripts/
│ ├── debug_model.py # Device/dtype testing
│ └── optimize_benchmark.py # Performance benchmarking
├── pyproject.toml
└── README.mdZ-Image-Turbo by Tongyi-MAI:
MIT License. The Z-Image-Turbo model has its own license - see the model card for details.