Nodes/ComfyUI-ZImageDit/Z-Image Generate (SDNQ)
ComfyUI Node

Z-Image Generate (SDNQ)

The other half — actually making pixels

By erosDiffusion·Created 9 months ago·Updated 9 months ago· 5
Z-Image Generate (SDNQ)
  • pipeline
  • input_image
  • IMAGE
prompta beautiful landscape
resolution_preset1024x1024 ( 1:1 )
num_inference_steps9
guidance_scale0.0
seed42
shift3.0
max_sequence_length1024
noise_scale1.00
strength0.75
custom_width1024
custom_height1024
enhance_promptfalse
unload_after_generationfalse
gc_cudafalse

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_length 1024 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, plus custom and use 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.

CategoryZ-Image (SDNQ)

Inputs (16)

NameTypeDefaultDescription
pipelineZIMAGE_SDNQ_PIPELINE
promptSTRINGa beautiful landscapeText description of the image to generate. Be descriptive for best results
resolution_presetCOMBO1024x1024 ( 1:1 )Select a resolution preset, 'use image size' to match input image dimensions, or 'custom' to set manual width/height
num_inference_stepsINT91–100Number of denoising steps. Z-Image Turbo is optimized for 5-9 steps. More steps = slower but potentially higher quality
guidance_scaleFLOAT0.00–20Classifier-free guidance scale. Z-Image Turbo is trained for guidance_scale=0.0 (recommended). Higher values increase prompt adherence but may reduce quality
seedINT420–18446744073709550000Random seed for reproducible generation. Same seed + settings = same image
shiftFLOAT3.01–10Time 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_lengthINT1024128–2048Maximum prompt token length. 1024 recommended for detailed prompts (Z-Image works best with long descriptions). 512 for faster speed
noise_scaleFLOAT1.000–2Scale for initial noise. 1.0 = normal random noise, lower = less variation, higher = more variation. Only affects pure noise (not image latents)
strengthFLOAT0.750–1Denoising 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_imageoptIMAGEOptional 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_widthoptINT1024256–2048Custom output width (only used when resolution_preset is 'custom'). Must be divisible by 64
custom_heightoptINT1024256–2048Custom output height (only used when resolution_preset is 'custom'). Must be divisible by 64
enhance_promptoptBOOLEANfalseUse Z-Image's built-in prompt enhancer for improved semantic understanding and detail. May not be available in all models
unload_after_generationoptBOOLEANfalseMove models to CPU after generation to free VRAM. Useful for memory-constrained setups
gc_cudaoptBOOLEANfalseRun Python garbage collection and clear CUDA cache after generation. Helps reclaim memory

Outputs (1)

NameTypeDescription
IMAGEIMAGE