ComfyUI Node

Z-Image Options

The LLM tuning box for Z-Image's prompt enhancer — only the knobs you need

By Koko-boya·Created 9 months ago·Updated 6 months ago· 127
Z-Image Options
    • options
    enable_temperaturetrue
    temperature0.70
    enable_top_pfalse
    top_p0.90
    enable_top_kfalse
    top_k40
    enable_seedfalse
    seed1331209069
    enable_repeat_penaltyfalse
    repeat_penalty1.10
    enable_max_tokenstrue
    max_tokens2048
    debug_modefalse

    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 and z_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.

    CategoryZ-Image

    Inputs (13)

    NameTypeDefaultDescription
    enable_temperatureBOOLEANtrue
    temperatureFLOAT0.700–2Sampling randomness. Lower (0.1-0.4) = focused, Higher (0.7+) = creative
    enable_top_pBOOLEANfalse
    top_pFLOAT0.900–1Nucleus sampling cutoff. Lower = more focused.
    enable_top_kBOOLEANfalse
    top_kINT400–100Top-K sampling. Higher = more diverse.
    enable_seedBOOLEANfalse
    seedINT13312090690–2147483648Random seed for reproducible results
    enable_repeat_penaltyBOOLEANfalse
    repeat_penaltyFLOAT1.100.5–2Penalty for repeated tokens. >1 reduces repetition.
    enable_max_tokensBOOLEANtrue
    max_tokensINT2048256–8192Maximum tokens to generate. Higher = longer responses but more time/memory
    debug_modeBOOLEANfalseEnable detailed debug logging to file and console

    Outputs (1)

    NameTypeDescription
    optionsZIMAGE_OPTIONS