Z-Image Options
The LLM tuning box for Z-Image's prompt enhancer — only the knobs you need
- options
Z-Image's prompt enhancer is an LLM, and like every LLM it has knobs: temperature, sampling cutoffs, token limits, a repeat penalty. This node is where you keep those knobs, and it exists because the pack doesn't want you to touch them at all unless you mean it. Every option in it ships with an enable_ toggle, and the whole design philosophy is in that toggle: unless it's switched on, the value is never even sent to the model.
That's a genuinely useful pattern. Leave everything at defaults and you get the provider's own sane settings. Start seeing repetitive, looping output and you flip on enable_repeat_penalty with a value around 1.1 without rebuilding your graph.
What it actually controls
Each pair is a toggle plus the value it unlocks:
enable_temperature/temperature- sampling randomness. The tooltip says it straight: lower (0.1–0.4) is focused, higher (0.7+) is creative. On by default at 0.7.enable_max_tokens/max_tokens- cap on generated tokens, 256–8192, default 2048. On by default; with it off you get the provider's default limit.enable_top_p/top_p- nucleus sampling cutoff, lower is more focused. Off by default.enable_top_k/top_k- top-K sampling, higher is more diverse. Off by default.enable_seed/seed- seed for reproducible LLM outputs. Off by default, and the README warns that whether the backend honors it varies.enable_repeat_penalty/repeat_penalty- penalty for repeated tokens, >1 reduces repetition. Off by default.debug_mode- always available, no toggle. Flips the whole pack into writing detailed reports to the console andz_image_debug.log.
One honest caveat from the README: seed, top_k, and friends only work if your backend model/provider supports them. The local and OpenRouter APIs vary, so a seed that reproduces on one model may do nothing on another.
How it works
The node is thin on purpose. It builds a small options dict and passes it out of the single options output (type ZIMAGE_OPTIONS). The consumer - Z-Image Prompt Enhancer or Z-Image Integrated KSampler - filters it down to the enabled entries before making the API call. So nothing here fires an API request itself; it's purely a settings carrier. It just has to sit upstream of the enhancer, wired into its options input.
Installing
It's part of the Comfyui-Z-Image-Utilities pack, so install the pack once and all six nodes appear. ComfyUI Manager (search "Comfyui-Z-Image-Utilities") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Koko-boya/ComfyUI-Z-Image-Utilities.git
Restart ComfyUI after cloning. No extra dependencies are needed unless you're also using the Direct provider, which wants pip install bitsandbytes huggingface-hub.
When to reach for it
Honestly? Often never. The enhancer's defaults are fine for most people, and Z-Image's own quality problems are mostly solved at the sampler level, not the LLM level. But if your enhanced prompts come out repetitive or rambling, repeat_penalty and a slightly lower temperature are the first two things to try. That's the one scenario where this little node earns its place in your graph.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| enable_temperature | BOOLEAN | true | — |
| temperature | FLOAT | 0.700–2 | Sampling randomness. Lower (0.1-0.4) = focused, Higher (0.7+) = creative |
| enable_top_p | BOOLEAN | false | — |
| top_p | FLOAT | 0.900–1 | Nucleus sampling cutoff. Lower = more focused. |
| enable_top_k | BOOLEAN | false | — |
| top_k | INT | 400–100 | Top-K sampling. Higher = more diverse. |
| enable_seed | BOOLEAN | false | — |
| seed | INT | 13312090690–2147483648 | Random seed for reproducible results |
| enable_repeat_penalty | BOOLEAN | false | — |
| repeat_penalty | FLOAT | 1.100.5–2 | Penalty for repeated tokens. >1 reduces repetition. |
| enable_max_tokens | BOOLEAN | true | — |
| max_tokens | INT | 2048256–8192 | Maximum tokens to generate. Higher = longer responses but more time/memory |
| debug_mode | BOOLEAN | false | Enable detailed debug logging to file and console |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| options | ZIMAGE_OPTIONS | — |