Nodes/comfyui-spawner-nodes/Conditioning 拼接融合
ComfyUI Node

Conditioning 拼接融合

Stitch two prompt conditionings together along the sequence axis

By spawner1145·Created about a year ago·Updated 11 months ago· 2
Conditioning 拼接融合
  • conditioning1
  • conditioning2
  • concatenated_conditioning

ComfyUI core already ships a way to combine conditionings - ConditioningCombine - and it does something specific: it adds the two token tensors, keeping the length of the longer one. That works fine when both prompts are the same length and you just want them averaged. ConditioningConcatenation (this pack calls it "拼接融合", concatenation-fusion) does something different and sometimes more useful: it concats along the sequence dimension, so prompt A's tokens and prompt B's tokens sit back to back in one longer embedding.

Why does that matter? Because the result is a conditioning with more tokens to attend over - like pasting two prompts into one CLIP call. It's a way to bolt a style fragment onto a subject prompt, or glue a caption prompt to an instruction prompt, without the length-limiting behavior of additive combine. Different arithmetic, different feel on the output.

Inputs and output, the short version:

  • conditioning1, conditioning2 - two CONDITIONING wires. Order matters: output is [cond1 tokens, cond2 tokens] in sequence.
  • concatenated_conditioning (out) - a CONDITIONING that carries the joined embedding.

Mechanically it's honest about what it's doing. If the two embeddings have different feature dims (which only happens if they came from different encoders), it quietly runs the second through this pack's TensorShapeAdapter to force the widths to match - and remember, that adapter is a random linear projection, not anything learned. Both pooled vectors, when present, get averaged into one. Both attention masks, when present, get concatenated - which is the right behavior for a longer sequence, and worth noticing because it means the masks stay aligned with the tokens.

Now the caveats, because this is where people get surprised. It only looks at the first tuple in each conditioning. If either input is a multi-tuple conditioning (which happens with some regional or multi-prompt setups), the extras are dropped. And this is raw token concat, not a semantic merge: two 77-token SD 1.5 prompts become one 154-token sequence, and whether the model makes good use of the extra tokens depends entirely on what you're conditioning. It's a mechanical join, not a magic mixer - pair it with ConditioningInspector first if you want to see what you're actually joining.

Install

Through ComfyUI Manager (search comfyui-spawner-nodes) or:

cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/comfyui-spawner-nodes

Restart after install. The pack's requirements are three tiny pure-Python libs (piexif, pypng, xmltodict) - nothing heavy, no model files. The README is a stub, the on-node UI is in Chinese, and the author is a Chinese-speaking dev (of a Wan2.1 SD extension). Small pack, works, but don't expect much documentation to lean on.

Troubleshooting

  • "嵌入维度不匹配" / dimension errors - the two conditionings came from text encoders with different output widths. Feed them through TensorShapeAdapter first (the node does this automatically only when it has to).
  • Result looks like only one prompt took effect - check for sequence truncation downstream. Some models/clip encoders trim to a fixed max length; a longer concat gets cut.
  • Different-feeling output between runs - if TensorShapeAdapter kicked in, its projection is randomly initialized, so the alignment isn't stable or learned. Keep feature dims matching to avoid it entirely.
Categoryspawner/conditioning

Inputs (2)

NameTypeDefaultDescription
conditioning1CONDITIONING
conditioning2CONDITIONING

Outputs (1)

NameTypeDescription
concatenated_conditioningCONDITIONING