Concept Remap (CCN)
Turn 'water' into 'fire' everywhere the concept lives, not just the word
- conditioning
- clip
- conditioning
- prompt_text_out
Word swap is easy; concept swap is the interesting part. If your prompt is "a ship on the water at sunset" and you remap "water -> fire," you probably want the reflections, the mood, the palette to shift too - not just the literal token replaced. Concept Remap (CCN) works on already-encoded conditioning and nudges it along the direction from one concept to another, weighted to where the source concept actually has influence. Because it follows influence rather than token positions, it catches all the contextual bleed from attention - the reflections, the color cast, the atmosphere - in one shot.
How it works
You feed it conditioning (from any CLIPTextEncode) and a clip, plus remapping lines like water -> fire. For each pair it figures out where the source concept lives in the conditioning, then shifts those regions toward the target concept vector. There are two modes for locating the concept, and the difference is precision:
- Cosine mode (default): encodes the source word separately and uses cosine similarity to estimate where it's influential. Fast, approximate, doesn't need your prompt text.
- Differential mode: connect
prompt_text- your original prompt - and it encodes the prompt with and without the source word, measuring the actual per-position difference. Much more precise, because it captures how attention blended the concept into this specific prompt.
The three dials govern how the nudge is applied. blend is overall strength: 1.0 is the full direction vector, above 1 overshoots, negative pushes away from the target. sharpness controls selectivity - 0 shifts everywhere uniformly, higher concentrates on the matching positions, negative inverts to affect everything except the concept. threshold sets a minimum influence weight for a position to be touched at all (0 means everything eligible).
Wiring it in
It takes conditioning in and gives conditioning out, so it slots inline between your encoder and the sampler - plus a prompt_text_out that passes your prompt through untouched. debug prints per-concept diagnostics to the console when you're tuning.
Install
From ComfyUI Manager, search ComfyCollectorNodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Restart, no pip step. The node shows up under the (CCN) suffix.
Where the magic and the traps are
The beauty is the fallback: because cosine mode works on the source concept rather than requiring it in the prompt, you can remap implied concepts - "gloomy => cheerful" on a prompt that never says gloomy. That's also the caveat: cosine is a looser approximation, so results are model-dependent and tinker-grade, not guaranteed. Re-encoding costs time too - differential mode means extra encode passes, so on vision-encoded models expect the workflow to slow by seconds. Start with a single pair, blend at 1, and tune sharpness before you stack a list of remappings. It's the most "experiment" flavored of the pack's conditioning tools, and it rewards patience.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| clip | CLIP | — | |
| remappings | STRING | # source -> target # water -> fire # calm -> chaotic | — |
| blend | FLOAT | 1.00-100–100 | Overall strength of the concept shift. 1.0 = full direction vector. >1 overshoots. Negative = push away from target. |
| sharpness | FLOAT | 1.00-100–100 | How selectively the effect targets matching positions. 0 = uniform shift everywhere. Higher = concentrated on matching positions. Negative = inverted: affects everything EXCEPT the source concept. |
| threshold | FLOAT | 0.000-1–1 | Minimum influence weight for a position to be affected. 0 = everything eligible. Higher = more selective. |
| prompt_textopt | STRING | The original prompt text. When provided, enables differential mode for much more precise concept targeting. Leave disconnected for cosine mode. | |
| debugopt | BOOLEAN | false | Print per-concept diagnostics to console |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| prompt_text_out | STRING | — |