Insert and apply attention to additional conds
Splice a second conditioning into your prompt at any token position
- conditioning_main
- conditioning_attn
- CONDITIONING
Most conditioning nodes treat your prompt as a single blob. InsertAttnConds treats it like a string you can edit mid-way: it takes one CONDITIONING, splices the token embeddings from a second CONDITIONING into it at a position you choose, and hands back a single CONDITIONING ready for the sampler. If you have ever wanted "put this style conditioning here in the sentence, not at the end," this is the node.
The thing to understand first is what CONDITIONING actually is in ComfyUI: a list of [tokens_tensor, metadata_dict] pairs. The tensor is what your text encoder spat out - a sequence of token vectors - and the dict carries extras like pooled_output and, in some models, an attention_mask. Most nodes treat that pair as opaque. This one does surgery on it.
How it works. You feed it conditioning_main (your main prompt's encoding) and conditioning_attn (a second encoding - a separately-encoded style prompt, an IP-Adapter-style image embedding, whatever). The node cuts the main token sequence at insert_at_index, drops the second conditioning's tokens in the gap, and re-glues it. Then comes the fiddly part it does for you: it rebuilds the attention_mask so the spliced block participates correctly in the model's attention. insert_at_index of -1 means "before the last token," which is where you usually want extra stuff - right before the end-of-sequence token, not at position 0 where it can nudge the start token around.
The inputs that matter:
strength_type- the fork in the road.multiplyscales the inserted embeddings bystrength(1.0 = as-encoded).attn_biasleaves the embeddings alone and instead addslog(strength)to the attention-mask cells connecting the inserted block to everything else, so the model attends to those tokens more or less strongly without changing their vectors. That's the "apply attention to conds" in the node's display name, and it's the more interesting of the two - you can crank attention toward a style embedding without blowing out its magnitude.strength- −10 to 10, default 1. Withmultiplyyou can even go negative for an anti-influence trick.insert_at_index- default 0 (front),-1for just before the end token.
It outputs one CONDITIONING, which wires straight into your sampler like any other. If the conditioning has no attention mask at all, the node builds one from scratch - which is handy for the newer models that only carry a padding mask.
Installing. This is one of six nodes in silveroxides' ComfyUI_CondsUtils, a small WIP conditioning toolkit. ComfyUI Manager → search "CondsUtils" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI_CondsUtils
then restart ComfyUI. There's no requirements.txt, no model downloads, no pip deps beyond what ComfyUI already ships - the whole pack is torch calls and comfy.utils. The author, silveroxides, is the same handle behind the Chroma GGUF quants on HuggingFace and the ComfyUI_SamplingUtils pack; the repo's own metadata calls this a "WIP Conditioning Toolkit," and the README is essentially empty, so expect the API to shift and the node menu names to lag the class names.
Where people get burned. Both inputs must be compatible conditionings - same model family, same token dimension - or you'll get a shape error at queue time, not a friendly warning. And if insert_at_index is bigger than your main prompt's token count, the node silently clamps to the end instead of erroring, which looks like the node "not working" when it's really just appending. When in doubt, set insert_at_index to -1 and tune strength_type/strength - that's the pattern the display name is actually pointing at.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning_main | CONDITIONING | — | |
| conditioning_attn | CONDITIONING | — | |
| strength | FLOAT | 1.000-10–10 | — |
| strength_type | COMBO | 2 options: attn_bias, multiply | |
| insert_at_index | INT | 0-1–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |