CLIP Remap (CCN)
Make every encode swap one word for another, automatically
- clip
- CLIP
Sometimes you want a word swapped in every prompt you encode - your LoRA is trained on "starship" but every reference says "ship," or you're standardizing terminology across a batch. Doing that by hand in a dozen prompt boxes is exactly the kind of repetition ComfyUI plumbing exists to kill. CLIP Remap (CCN) wraps your CLIP model so that any word replacement you define gets applied automatically during tokenization, on every downstream encode. It's a hard remap, no blending - the swap just happens, invisibly, before the text is tokenized.
How it works
The node takes your CLIP, clones it, and patches the clone's tokenize method. From then on, any text passed to that CLIP gets your remappings applied first. The replacement is whole-word and case-insensitive - it uses word boundaries, so ship -> starship will swap "ship" but leave "warship" and "shipyard" alone (unlike the pack's HyperRemap string-replace phase, which is plain substring). Because it happens at tokenization, it works for positive and negative prompts alike and for any downstream encoder that uses the patched CLIP. The original CLIP object is untouched - you get a patched clone out, so the unpatched model still exists elsewhere in your graph.
The enabled toggle is the whole bypass story: flip it off and the CLIP passes through with no patching at all, which makes A/B testing a one-click affair.
The inputs that matter
clip is the model to wrap, remappings is a multiline box with one source -> target per line (lines starting with # are comments - the default ships with a ship -> starship example to crib from). enabled turns the whole thing on and off. Output is the patched CLIP, and the note in the node description is the key placement rule: put it before your CLIPTextEncode nodes. Wire the CLIP output into every encoder you want affected.
Install
Same as every node in this pack. ComfyUI Manager → search ComfyCollectorNodes → Install → restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Then restart ComfyUI. No extra dependencies, no pip install. All nodes carry the (CCN) suffix, so search CCN in the picker.
Where people get bitten
The main trap is expecting blending. This node is all-or-nothing: it rewrites the text, so "ship" becomes "starship" everywhere, with no partial landing between meanings. If you want to nudge a word toward another meaning in embedding space - partway between "red" and "blue," say - you want the pack's Token Remap or Concept Remap instead, which blend rather than replace. Also note the whole-word rule cuts both ways: it's safer than substring replacement, but if your source is a phrase that appears mid-word in some forms, it won't catch them. And since remapping happens before tokenization, it's fully deterministic and model-independent - no hidden encode passes, no extra time. For a "just make the words consistent" job, this is the node you'd reach for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| remappings | STRING | # source -> target # ship -> starship | — |
| enabled | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CLIP | CLIP | — |