Nodes/ComfyUI-Zlycoris/Z-Image Advanced Mixing
ComfyUI Node

Z-Image Advanced Mixing

Vector math on your conditioning, not just a strength slider

By TripleHeadedMonkey·Created 7 months ago·Updated 7 months ago· 4
Z-Image Advanced Mixing
  • conditioning_to
  • conditioning_from
  • conditioning
operation
strength0.50

Most conditioning nodes multiply or add. ZImageAdvancedConditioning - "Z-Image Advanced Mixing" - treats your conditioning as a vector in space and lets you combine two of them with real vector operations: spherical interpolation, orthogonal projection, and perpendicular addition. If you've ever wanted to say "take this prompt's direction, but remove everything it has in common with that other prompt," this is the node that speaks that language. The naming comes from the pack's ZCondAdv module, and it was clearly written by someone who got burned by in-place tensor mutation bugs in earlier conditioning nodes - the current version clones everything before touching it.

The three operations

You feed in conditioning_to and conditioning_from and pick an operation:

  • mix_slerp - spherical linear interpolation between the two conditioning vectors at strength. Unlike a plain lerp, slerp travels along the sphere between them, which keeps magnitude (and thus overall prompt energy) more stable. Default strength 0.5 is a true 50/50.
  • purge_ortho - projects to onto from, then subtracts that projection at strength. Result: to with the from-ness scrubbed out. This is your "everything about X except the parts that look like Y" tool.
  • add_perpendicular - computes the part of from that's orthogonal to to (the direction from moves in that to can't already reach) and adds it in at strength. The "give me Y's distinctive flavor without disturbing X" tool.

strength runs 0 to 1. This matters for Z-Image specifically because the conditioning carries a metadata dict with conditioning_llama3, llama_embeds, and pooled_output - the node applies the same vector math to those keys, which is where the Qwen encoder's actual meaning lives. Standard CLIP conditioning nodes never touch those, so this is one of the few ways to operate on the full Qwen embedding signal.

Install

ComfyUI Manager (search ComfyUI-Zlycoris) or:

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

Restart ComfyUI. No model downloads.

Where people get burned

  • It clips to the shorter conditioning length. The node slices both inputs to the common sequence length before math. If your two conditionings come from prompts of very different lengths, the extra tokens of the longer one are silently dropped - keep the two prompts comparable in length for predictable results.
  • strength is capped at 1.0 here. Unlike the merge nodes' wild ranges, this one is strictly a mixing knob. 1.0 is the max, and for purge_ortho that's "fully remove," which can gut the prompt entirely. Start around 0.3–0.5.
  • Empty or mismatched metadata keys are just skipped. If conditioning_from doesn't carry llama_embeds, that key stays from to untouched. The node is defensive to a fault - half-applied mixing reads as "nothing happened," so check which keys both conditionings actually carry.
  • It sits between your text encoder and the KSampler on the positive path. One input is your main prompt's conditioning, the other is whatever you're blending against - typically a second prompt's conditioning from a parallel CLIP encode.
CategoryRES4LYF/conditioning

Inputs (4)

NameTypeDefaultDescription
conditioning_toCONDITIONING
conditioning_fromCONDITIONING
operationCOMBO3 options: mix_slerp, purge_ortho, add_perpendicular
strengthFLOAT0.500–1

Outputs (1)

NameTypeDescription
conditioningCONDITIONING