A minimal and clean Streamlit web interface for generating images using the Z-Image Turbo model through ComfyUI.
This application provides an intuitive UI to interact with a running ComfyUI server, allowing you to generate high-quality images using the Z-Image Turbo model with customizable parameters.
The Z-Image Turbo model excels at generating clean and accurate text within images, making it particularly well-suited for:
- Advertisement Creation: Generate professional ads with readable text overlays
- Marketing Content: Create social media posts, banners, and promotional materials
- Product Mockups: Design product packaging and labels with clear typography
- Infographics: Produce visual content with integrated text elements
Unlike many image generation models that struggle with text rendering, Z-Image can produce legible, well-formatted text as part of the generated image, making it an ideal choice for commercial and marketing applications.
Here are some example images generated using this interface:
![]() |
![]() |
![]() |
![]() |
- Two-Column Layout: Clean separation between controls and output
- Prompt Controls: Text areas for positive and negative prompts
- K-Sampler Settings: Adjustable parameters including:
- Steps (1-50)
- CFG Scale (1-15)
- Seed control with randomization option
- Sampler algorithm selection (euler, euler_a, dpmpp_2m)
- Scheduler selection (simple, karras)
- Image Size Control: Customizable width and height (512-4096px)
- Real-time Preview: Generated images displayed immediately
- Download Capability: Save generated images locally
- Connection Testing: Verify ComfyUI server connectivity
pip install streamlit requests-
ComfyUI Server: Running instance of ComfyUI (default:
http://127.0.0.1:8188) -
Required Models:
- UNET:
z_image_turbo-Q3_K_M.gguf(inmodels/diffusion_models/) - CLIP:
Qwen3-4B-Q3_K_M.gguf(inmodels/text_encoders/) - VAE:
ae.safetensors(inmodels/vae/)
- UNET:
-
Custom Nodes:
📂 ComfyUI/
├── 📂 models/
│ ├── 📂 text_encoders/
│ │ └── Qwen3-4B-Q3_K_M.gguf
│ ├── 📂 diffusion_models/
│ │ └── z_image_turbo-Q3_K_M.gguf
│ └── 📂 vae/
│ └── ae.safetensors
- Clone or download this repository
- Install Python dependencies:
python -m pip install streamlit requests
- Ensure ComfyUI is running with the required models and custom nodes
-
Start ComfyUI Server:
# Navigate to your ComfyUI directory and start the server python main.py -
Launch the Streamlit App:
python -m streamlit run comfyui_streamlit_app.py
-
Access the Interface:
- Open your browser to
http://localhost:8501 - The app will automatically open in your default browser
- Open your browser to
-
Generate Images:
- Enter your prompt in the text area
- Adjust K-Sampler settings as needed
- Set image dimensions
- Click "Generate"
- Wait for the image to appear (typically 2-5 minutes)
Configure the ComfyUI server address in the sidebar:
- Default:
http://127.0.0.1:8188 - Change if your ComfyUI runs on a different host/port
The app waits up to 5 minutes (300 seconds) for image generation. This can be adjusted in the code if needed:
def poll_for_image(host, prompt_id, max_wait=300, poll_interval=2):If you see "Connection failed. Is ComfyUI running?":
- Verify ComfyUI is running
- Check the host address in the sidebar
- Click "Test Connection" to verify
If you get validation errors:
- Ensure all required models are downloaded
- Verify models are in the correct directories
- Check that ComfyUI-GGUF custom node is installed
If generation times out:
- Increase
max_waitparameter inpoll_for_image() - Check ComfyUI console for errors
- Try reducing image dimensions
z-image/
├── comfyui_streamlit_app.py # Main Streamlit application
├── example_workflow_z_image_compressed.json # Reference workflow
├── Results/ # Example generated images
└── README.md # This file
The app constructs a ComfyUI workflow JSON with the following nodes:
- UnetLoaderGGUF: Loads the diffusion model
- CLIPLoaderGGUF: Loads the text encoder
- ModelSamplingAuraFlow: Configures model sampling
- CLIPTextEncode: Encodes positive and negative prompts
- EmptySD3LatentImage: Creates latent image canvas
- KSampler: Performs the sampling/generation
- VAELoader: Loads the VAE decoder
- VAEDecode: Decodes latent to image
- SaveImage: Saves the output
GET /system_stats: Connection testingPOST /prompt: Submit generation workflowGET /history/{prompt_id}: Check generation statusGET /view: Download generated image
For issues related to:
- This UI: Check the troubleshooting section above
- ComfyUI: Visit the ComfyUI repository
- Z-Image Model: Visit the model page



