Nodes/ComfyCollectorNodes/Hyper Remap (CCN)
ComfyUI Node

Hyper Remap (CCN)

Four ways to change what a word means, all in embedding space

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Hyper Remap (CCN)
  • clip
  • conditioning
  • untouched_conditioning
  • original_prompt
  • modified_prompt
text
remappings# string replace: find, replace # token remap: source -> target # token remap: source -> target (0.8) # concept remap: source => target # concept remap: source => target (b:0.8, s:2.0, t:0.1) # delta remap: base ~~ subtracted # delta remap: base ~~ subtracted (b:0.5, s:1.0, sx:2.0)
blend1.000
sharpness1.00
threshold0.000
normalize_deltatrue
case_sensitivetrue
debugfalse

Hyper Remap is the pack's flagship tinker node, and it's the one the author clearly had the most fun building. The idea: instead of editing prompt text and re-encoding, you edit the conditioning - the actual embedding tensors - after encoding, which lets you land partway between two concepts, nudge a whole scene's mood, or inject something the model never had a word for. It's experimental, it's fiddly, and for some workflows it's genuinely magical.

The node reads a text prompt plus a remappings field, and applies up to four phases in sequence. Entries are separated by semicolons or newlines, lines starting with # are comments, and each operator uses its own arrow:

  • String replace - red, blue. Plain text substitution before encoding: "red" becomes "blue". The only phase that's model-independent and consistent everywhere. Note it's substring replacement, so red, blue happily turns "hatred" into "hatblue" - the case_sensitive toggle is here.
  • Token remap - source -> target. Encodes the prompt as written, then encodes it again with the swap, and blends the embeddings at the changed positions. The text is never modified, so you can sit at 40% between red and blue instead of swapping. Whole words only; tokenizers can be resilient to it.
  • Concept remap - source => target. Nudges the conditioning along the direction from one concept toward another. If the source word is in your prompt, it measures exactly where that concept lives (including contextual bleed like reflections and palette); if not, it approximates by similarity, so you can shift "gloomy => cheerful" on a prompt that never says gloomy.
  • Delta remap - A ~~ B. Encodes two arbitrary prompts, subtracts them ("A without B"), and adds that residual to your conditioning. This is the experimental-est phase, aimed at pulling out details a model knows but has no token for - the author's example is extracting "flower" from "macrophotography of a bee in the wild" minus "bee, insect". Results are "sometimes. kinda." by the author's own admission.

The knobs that actually matter

  • blend - global strength. For token remap it lerps between original and remapped; for concept/delta it's the magnitude of the nudge. >1 overshoots, negative inverts.
  • sharpness / threshold - these govern where a concept or delta lands in your conditioning: sharpness concentrates the effect on positions most similar to the source concept (0 = uniform, negative = least-similar), threshold masks out positions below a similarity weight.
  • normalize_delta - L2-normalizes deltas so blend means the same thing regardless of how different the two prompts are. Leave it on until you have a reason not to.

Every operator takes per-pair overrides in parentheses - water => fire (b:0.8, s:2.0, t:0.1), or a bare number (0.8) as blend - and those beat the globals. That's how you tame one stubborn entry without flattening the others.

Outputs

You get conditioning (the remapped result, into your sampler) and untouched_conditioning (the clean encode, handy for comparison or as a separate branch). It also hands back original_prompt and modified_prompt strings, which is surprisingly useful when you're iterating - you can see exactly what the string-replace phase did.

The cost and the catch

Except for string replacement, every phase means re-encoding the prompt multiple times. For most CLIP/T5 encoders that's fast; for vision-encoding models it can add noticeable seconds per run. And this is a tinker node through and through - the README is upfront that results vary model to model, and the manifold of "what a delta pushes you into" can land in under-defined space. Start with string replace and token remap, get a feel, then graduate to concepts and deltas.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

restart, or grab it from Manager under ComfyCollectorNodes. No model downloads for the base node. If you want the image-grounded version that runs the same pipeline on a Krea2Edit encode, that's Hyper Remap Krea2 Edit - and it needs the Krea2Edit CLIP/LoRA setup on top.

CategoryCCN/conditioning

Inputs (9)

NameTypeDefaultDescription
clipCLIP
textSTRING
remappingsSTRING# string replace: find, replace # token remap: source -> target # token remap: source -> target (0.8) # concept remap: source => target # concept remap: source => target (b:0.8, s:2.0, t:0.1) # delta remap: base ~~ subtracted # delta remap: base ~~ subtracted (b:0.5, s:1.0, sx:2.0)
blendFLOAT1.000-100–100Default blend for all operators. For ->: lerp between original and remapped embeddings. For => and ~~: magnitude of the nudge vector. >1 overshoots, negative inverts direction. Per-pair (b:X) overrides take precedence.
sharpnessFLOAT1.00-100–100Default incoming-conditioning sharpness for => and ~~. Controls how sharply positions are weighted by their cosine similarity to the source/base concept. 0 = uniform across all positions. Higher = concentrated on most-similar positions. Negative = favour least-similar positions. Ignored by ->. Per-pair (s:X) overrides take precedence.
thresholdFLOAT0.000-1–1Default incoming-conditioning threshold for => and ~~. Masks out positions whose similarity weight falls below this value after sharpness is applied. 0 = all positions eligible. Ignored by ->. Per-pair (t:X) overrides take precedence.
normalize_deltaoptBOOLEANtrueL2-normalise the delta tensor before blending for ~~ entries. When on, blend has a consistent magnitude regardless of how different the two prompts are. When off, larger semantic differences produce stronger effects at the same blend value.
case_sensitiveoptBOOLEANtrueCase sensitivity for string replacement pairs.
debugoptBOOLEANfalsePrint phase diagnostics to console.

Outputs (4)

NameTypeDescription
conditioningCONDITIONING
untouched_conditioningCONDITIONING
original_promptSTRING
modified_promptSTRING