Z-Image Generate (SDNQ)
The other half — actually making pixels
- pipeline
- input_image
- IMAGE
Load Z-Image Turbo (SDNQ) gets the model into memory; Z-Image Generate (SDNQ) does the actual work. It takes the ZIMAGE_SDNQ_PIPELINE from the loader, runs the diffusers Z-Image pipeline with your prompt and settings, and hands back a plain IMAGE you can preview or save. Pure text-to-image when you feed it just a prompt, img2img when you also connect an input_image. It's the entire generation step of this pack wrapped in one node.
Know what you're buying here, because it changes how you set things. Z-Image Turbo is guidance-distilled flow-matching: the model was trained to walk a near-straight path from noise to image, which is why it works in 8-9 steps instead of 30. So most of the defaults are "leave me alone": 9 steps, guidance_scale 0 (the value it was trained at - negative prompts do nothing at CFG 0), and a shift of 3 on the FlowMatch scheduler. If you're carrying SDXL muscle memory about Karras schedulers and CFG 7, drop it here; it just doesn't apply.
The inputs that actually matter:
prompt- Z-Image likes long, descriptive natural language (Flux-style prose, not Danbooru tags), and the Qwen3-4B encoder is bilingual: Chinese prompts give a measurable adherence boost.max_sequence_length1024 is the right companion for detailed prompts; drop to 512 if you want speed.resolution_preset- 24 presets from the 1024 bucket up to the 1280 bucket, pluscustomanduse image size. Keep it under ~2MP; past that native ceiling, quality degrades. Generate small, upscale.num_inference_steps- stick to 5-9. Turbo is optimized for that range; more steps mostly costs time.shift- the same dial as the community's ModelSamplingAuraFlow tweak, exposed directly. Default 3 is balanced; plenty of Turbo users report 7 looks better.seed- defaults to 42 for reproducibility. Set it to something fixed while you dial in settings, then vary it once you like the composition.
The optional inputs are mostly the memory game: input_image enables img2img (with strength deciding how much of the source survives and noise_scale for variation), custom_width/custom_height serve the custom preset, and unload_after_generation plus gc_cuda claw VRAM back when you're done.
How it works. The node sets the scheduler's shift, VAE-encodes your input_image if one's attached (blending it with noise according to strength), then calls the pipeline with your seed and settings - sampling internally via flow-matching Euler. It deliberately doesn't reimplement Z-Image in ComfyUI-land; it hands the whole call to diffusers. That's why this pack bypasses ComfyUI's memory management and why you should treat the ~7GB footprint as your real budget.
Getting it running. Install the pack once (same Manager search or git clone https://github.com/erosDiffusion/ComfyUI-ZImageDit, then restart), wire the loader's pipeline output into this node's pipeline input, add a SaveImage node, and go. First run pulls the weights into your HuggingFace cache.
Where people get burned. Don't be surprised when different seeds give near-identical images - that's a documented Turbo trait, not your settings. Complex multi-element prompts are Z-Image's known weak spot, so describe one strong subject. And remember the whole point of this node: 4-bit SDNQ is a quality-for-VRAM trade. If you have room for the full checkpoint, the full checkpoint wins; this exists to make Turbo usable where it otherwise wouldn't fit.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| pipeline | ZIMAGE_SDNQ_PIPELINE | — | |
| prompt | STRING | a beautiful landscape | Text description of the image to generate. Be descriptive for best results |
| resolution_preset | COMBO | 1024x1024 ( 1:1 ) | Select a resolution preset, 'use image size' to match input image dimensions, or 'custom' to set manual width/height |
| num_inference_steps | INT | 91–100 | Number of denoising steps. Z-Image Turbo is optimized for 5-9 steps. More steps = slower but potentially higher quality |
| guidance_scale | FLOAT | 0.00–20 | Classifier-free guidance scale. Z-Image Turbo is trained for guidance_scale=0.0 (recommended). Higher values increase prompt adherence but may reduce quality |
| seed | INT | 420–18446744073709550000 | Random seed for reproducible generation. Same seed + settings = same image |
| shift | FLOAT | 3.01–10 | Time shift for FlowMatch scheduler. Controls sampling distribution: lower (1-2) = more noise-end sampling, higher (4-10) = more clean-end sampling. Default 3.0 is balanced |
| max_sequence_length | INT | 1024128–2048 | Maximum prompt token length. 1024 recommended for detailed prompts (Z-Image works best with long descriptions). 512 for faster speed |
| noise_scale | FLOAT | 1.000–2 | Scale for initial noise. 1.0 = normal random noise, lower = less variation, higher = more variation. Only affects pure noise (not image latents) |
| strength | FLOAT | 0.750–1 | Denoising strength for img2img. 0.0 = no change (pure image), 1.0 = full regeneration (ignore image). Only applies when input_image is provided. Controls how many timesteps to denoise |
| input_imageopt | IMAGE | Optional input image to encode to latents. Will be blended with noise based on noise_scale. Use 'use image size' preset to match image dimensions | |
| custom_widthopt | INT | 1024256–2048 | Custom output width (only used when resolution_preset is 'custom'). Must be divisible by 64 |
| custom_heightopt | INT | 1024256–2048 | Custom output height (only used when resolution_preset is 'custom'). Must be divisible by 64 |
| enhance_promptopt | BOOLEAN | false | Use Z-Image's built-in prompt enhancer for improved semantic understanding and detail. May not be available in all models |
| unload_after_generationopt | BOOLEAN | false | Move models to CPU after generation to free VRAM. Useful for memory-constrained setups |
| gc_cudaopt | BOOLEAN | false | Run Python garbage collection and clear CUDA cache after generation. Helps reclaim memory |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |