Negative cross attention concatenate
The conditioning smuggler that sneaks your negative prompt into the positive
- positive
- negative
- empty
- Positive
- Negative
What it's for
This is the quieter half of Extraltodeus's Negative-attention pack, and on its own it looks pointless: it takes your positive and negative CONDITIONING and concatenates them into one long tensor. By itself that's a worse positive prompt - your image prompt now literally contains the tokens you're trying to avoid. The trick only pays off because the pack's other node, "Negative cross attention," splits the combined tensor in half and subtracts the negative half inside the attention math. Think of this node as the smuggler, and that one as the border guard.
The inputs that matter
Four required, one optional:
- positive / negative (CONDITIONING): straight from your two CLIP Text Encode nodes.
- concat_mode: what to do when the positive and negative aren't the same token length (weighted prompts, long negatives).
crop_to_shortestcuts both down - the safe default for a first run.prolongate_to_longest_by_looploops the shorter one to match.prolongate_to_longest_with_empty_or_0pads with the empty conditioning, or with zeros if you don't supply one. - negative_out: what the Negative output carries.
empty_or_0gives a genuinely empty/unconditional negative - which is the whole point of the pack, so the sampler's unconditional pass stays truly unconditional while the negative's real content is applied inside attention.invertswaps the halves so the negative branch also sees pos+neg - the "doubling down" mode the author warns produces overblown results.crop_to_77_tokensjust passes your original negative, cropped. - empty (CONDITIONING, optional): an empty-prompt conditioning, used for padding in the third concat mode and as the
empty_or_0negative.
The outputs
Two CONDITIONING outputs, and the wiring is short:
- Positive → the KSampler's
positiveinput. - Negative → the KSampler's
negativeinput.
With the patcher upstream: Load Checkpoint → Negative cross attention (model), the two CLIP encodes → this node, then both outputs into the sampler.
Installing it
Same pack, same install - you get both nodes in one go. ComfyUI Manager: search "Negative-attention-for-ComfyUI-". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Extraltodeus/Negative-attention-for-ComfyUI-
Restart ComfyUI. No requirements.txt, no model downloads, nothing extra to configure.
Gotchas
- It's a matched pair. Run it without the "Negative cross attention" patcher and the negative tokens just sit inside your positive conditioning - worse prompts, not better.
- Very short prompts can silently kill the effect. With
crop_to_shortestand terse prompts, the combined tensor can shrink under 77 tokens, at which point the patcher's split falls back to plain attention. Keep both prompts reasonably populated. - SDXL / SD 1.x only, by design. The pack is an experiment and explicitly doesn't support Flux.
This is the node doing all the plumbing, so it's the one with zero search impressions while its flashier sibling gets all the clicks. If a shared workflow has it, that's exactly why it's there.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| concat_mode | COMBO | 3 options: crop_to_shortest, prolongate_to_longest_by_loop, prolongate_to_longest_with_empty_or_0 | |
| negative_out | COMBO | 3 options: empty_or_0, invert, crop_to_77_tokens | |
| emptyopt | CONDITIONING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Positive | CONDITIONING | — |
| Negative | CONDITIONING | — |