Nodes/ComfyUI-CustomNodePacks/Identity Lock — refine without moving
ComfyUI Node

Identity Lock — refine without moving

Refine the pixels without letting the face move

By Code2Collapse·Created 8 months ago·Updated a day ago· 58
Identity Lock — refine without moving
  • original
  • refined
  • protect
  • image
  • drift_map
  • drift
  • info
◄radius8.0►
◄strength1.00►
◄corrections2►
◄want_drift_mapfalse►

You upscaled a portrait. The detail is gorgeous and the nose is three pixels to the left. Or you ran a refine pass at denoise 0.3, got lovely skin texture, and the eyes are now subtly a different person. This is the oldest complaint about every "enhance" step that exists - SUPIR is famous for it, and it's the same reason people argue about denoise values for hours.

Identity Lock attacks it from the signal side rather than the settings side. It splits both images into a low-frequency band (composition, pose, where the eyes sit) and a high-frequency band (texture, pores, fabric weave), keeps the plate's low frequencies, and takes only the model's high frequencies. The face cannot move, because the part being replaced is the part that doesn't encode where anything is.

The knobs

original is the plate and refined is what came back from your model - both required, and they must be the same pixel size. If the refinement upscaled, upscale the plate to match first; the node raises a plain error naming both sizes rather than pretending.

radius sets the split frequency, default 8. Smaller locks harder and lets less refinement through; larger passes more detail and more movement with it. If a face is still creeping, go smaller - that's the author's own instruction and it's the right instinct.

strength runs 0 to 1: 0 is the raw refinement, 1 is fully locked. It defaults to 1, which means "keep my plate", and the interesting position isn't a middle value - it's 0 combined with a protect mask. That locks the face at full strength while leaving everything else completely free, which is what you usually want: identical face, genuinely new background detail.

corrections handles the honest limitation of the approach. A Gaussian split is not a brick-wall filter, so a single blend pass holds only around 70% of a face shift. Two passes hold about 94%, for roughly 2% of detail, and it defaults to 2. That number pair is from the author, and it's the kind of measured claim you rarely get in a node tooltip - take the default.

There's also want_drift_map, which adds a second output showing where structure moved (bright = it moved). The outputs are image, drift_map, drift (a single float - how far things moved overall) and info. Wire drift into a note node while you tune, and stop tuning when it stops falling.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git

Or install "CustomNodePacks" from ComfyUI Manager. Restart and confirm the console shows [C2C] CustomNodePacks: 142 nodes loaded. Pure tensor work, tier-1 VRAM, no models. Same warning as the rest of the pack: don't run pip install -r requirements.txt blind on a working install - it lists opencv-python, scipy, safetensors and a pile of commented-out extras, and it can overwrite the torch ComfyUI gave you.

Where it fits in a real graph

The honest use case is after an upscale or a refine, not instead of one. Typical shape: plate → upscale or img2img refine → Identity Lock with the upscaled plate as original and the model output as refined → save. The one thing it doesn't do is fix an upscale that invented a different face: if the model rebuilt the bone structure at low frequency, locking the plate's low band makes the result look like your plate with the model's detail on top, which is the best possible outcome and not a full restoration.

Worth setting expectations against the KB's read on this whole category: identity drift under upscaling and refinement isn't a settings mistake, it's the design of the models doing it. A node that constrains the damage is more useful than another slider.

Category🐺 C2C/🧰 Core/Tiling

Inputs (7)

NameTypeDefaultDescription
originalIMAGEThe plate, at the SAME size as the refined image. If the refinement upscaled, upscale this to match first.
refinedIMAGEWhat came back from the model.
radiusFLOAT8.00–128The split frequency. SMALLER locks harder and lets less refinement through; LARGER passes more detail and more movement with it. If a face is still moving, go SMALLER.
strengthFLOAT1.000–10 = the raw refinement, 1 = fully locked. Set it to 0 WITH a protect mask to lock only the face and leave the background completely free.
correctionsINT20–8Extra passes that push the result's structure back onto the plate's. A Gaussian is not a brick-wall filter, so one pass alone holds only about 70% of a face shift; two hold about 94%, at a 2% cost in detail.
protectoptMASKWhere the lock is at FULL strength regardless of the strength above - a face. Everywhere else gets whatever strength says.
want_drift_mapoptBOOLEANfalseAlso output a map of where structure moved. Bright means it moved. Use it to find what the drift number is telling you about.

Outputs (4)

NameTypeDescription
imageIMAGE—
drift_mapMASK—
driftFLOAT—
infoSTRING—