Nodes/ComfyUI-Zlycoris/Z-Image Conditioning Contrast
ComfyUI Node

Z-Image Conditioning Contrast

The conditioning trick that actually moves Z-Image prompts

By TripleHeadedMonkey·Created 7 months ago·Updated 7 months ago· 4
Z-Image Conditioning Contrast
  • conditioning
  • conditioning
contrast1.00

Here's the problem this node solves, and it's a good one: you want to sharpen or soften how strongly Z-Image follows your prompt, so you reach for the old Cond node trick of multiplying the conditioning by 1.2 - and nothing happens. Z-Image's Qwen encoder applies layer normalization, which mathematically cancels out any linear scaling. 1.2 × x normalized is just x again. ZImageConditioningContrast is the workaround: instead of multiplying, it applies a power function, sign(x) · |x|^contrast, which changes the shape of the embedding distribution. Normalization can't undo that, so the change survives all the way to the sampler.

What the contrast slider does

  • contrast = 1.0 - identity, no change.
  • contrast > 1 - pushes values toward ±1, "sharpening" the prompt signal (think cranking emphasis on every token).
  • contrast < 1 - flattens toward zero, softening.

Range is 0 to 10, step 0.05. The default 1.0 means the node is a no-op until you touch it, so it's safe to drop into a workflow as a control knob without fear.

What it touches

It operates on the conditioning's main tensor and the metadata dictionary that carries Qwen/Llama embeddings - the node targets conditioning_llama3, llama_embeds, and pooled_output keys, plus any high-dimension tensor that looks like an embedding. It's careful to skip masks, ids, and size tensors (those would crash or corrupt), and it forces .contiguous() on the result because Z-Image's flash attention in the Turbo models requires it. If that last bit sounds like hard-won knowledge, it is - the code comments read like a list of bugs someone actually hit.

Install

ComfyUI Manager (search ComfyUI-Zlycoris) or:

cd ComfyUI/custom_nodes
git clone https://github.com/TripleHeadedMonkey/ComfyUI-Zlycoris.git

Restart ComfyUI. It lives in the pack's conditioning section alongside ZImageAdvancedConditioning, and no model downloads are involved.

Where people get burned

  • The range goes to 10 for a reason, but that doesn't mean you should live there. At extreme contrast the embeddings distort and outputs get weird. Small steps - 0.85 to 1.15 - are the useful band for most prompts. It's emphasis, not a volume knob.
  • It only works on Z-Image/Qwen-style conditioning. The special-key handling is tuned for LLM encoders. On a vanilla CLIP workflow it degrades gracefully (the main tensor still gets processed) but you're getting half the feature.
  • This won't do anything for Turbo's CFG-1 behavior. The Turbo model is guidance-distilled and runs at CFG 1, where conditioning contrast is genuinely limited in effect. On Base at CFG 3-5 - where negative prompts work and conditioning actually matters - this is where it shines.
  • Wire it between your CLIP text encode and the KSampler's positive input. It's a one-in-one-out conditioning node; nothing exotic about placement.
CategoryRES4LYF/conditioning

Inputs (2)

NameTypeDefaultDescription
conditioningCONDITIONING
contrastFLOAT1.000–10

Outputs (1)

NameTypeDescription
conditioningCONDITIONING