Nodes/10S-Comfy-nodes/🧠 LTX Likeness Semantic Clamp
ComfyUI Node

🧠 LTX Likeness Semantic Clamp

Stop 'smiling' from rewriting the face β€” suppress only the modifier tokens

By TenStripΒ·Created 4 months agoΒ·Updated 26 days agoΒ· 244
🧠 LTX Likeness Semantic Clamp
  • model
  • clip
  • positive
  • reference_info
  • MODEL
β—„suppression_strength0.50β–Ί
β—„face_modifier_textsmiling, frowning, laughing, open mouth, closed mouth, eyes closed, eyes open wide, happy, sad, angry, surprised, expressionβ–Ί
β—„similarity_threshold0.65β–Ί
β—„auto_thresholdp95β–Ί
β—„similarity_sharpness16.0β–Ί
β—„suppression_floor0.30β–Ί
β—„top_k3β–Ί
β—„soft_edge_frac0.15β–Ί
β—„override_face_bboxβ–Ί
β—„bypassfalseβ–Ί
β—„debugfalseβ–Ί

There's a classic identity-preservation dilemma with LTX: your prompt says "a person who looks like this reference, smiling" - and the model, told to make the face smile, uses that as license to rewrite the face entirely. The identity drifts toward whatever "smiling" means in its weights rather than the person in your reference. The old solution - suppress text attention in the face region wholesale - worked about as well as you'd expect: it cut off the face from scene, style, and composition information too, and the results were noise.

LTXLikenessSemanticClamp does the smarter thing. It identifies which specific text tokens in your prompt are face-modifier words ("smiling", "frowning", "eyes closed", "open mouth"...) via embedding-space correspondence to a modifier vocabulary, then suppresses only those tokens' attention to the face-region video tokens. Everything else - lighting, style, scene, position - keeps influencing the face normally. It's the symmetric inverse of the pack's LTXActionAmplifier: that one boosts action verbs at attn2, this one suppresses expression modifiers at attn2.

The setup

Required: model, clip (the text encoder your conditioning used - typically Gemma-3-12B for LTX2), positive (the positive conditioning; the node fingerprints it so only the cond pass is modified, never the uncond pass), and suppression_strength (0.5 default - halve the modifier influence; 1.0 fully blocks it but can cause rigidity). Output is a patched MODEL - chain it after LikenessAnchor if you're running both.

Optional but relevant:

  • face_modifier_text - the vocabulary (default covers common expressions; customize for your domain, e.g. "smirking, winking, biting lip").
  • auto_threshold (p95) - auto-calibrates the match threshold to your encoder's score distribution. Recommended over the literal similarity_threshold, because different encoders produce wildly different absolute similarity values.
  • suppression_floor (0.3) - hard cutoff so weak sigmoid matches don't leak suppression to non-modifier tokens.
  • top_k (3) - how many vocabulary matches each prompt token must confirm. Higher = fewer false positives.
  • soft_edge_frac (0.15) - soft falloff at the bbox edges so the suppression doesn't end in a hard line.
  • reference_info (or override_face_bbox) - supplies the face bbox and spatial dims. Wire from LTXLikenessGuide if you're using the Guide; otherwise set the override.

Why it behaves better than the old Clamp

The deprecated LikenessClamp scaled attn2 output magnitude in the bbox region, which the author's notes describe plainly: the model had nothing to compose a face from once text influence was broadly suppressed - catastrophic noise artifacts. The semantic version only removes the tokens that specify the face's expression, leaving the rest of the text stream intact. That's the entire difference between "the face is a smudge" and "the face stays your person."

Real-world tuning

The suppression is only as good as the face region it targets. If the face box is off (a common failure with auto detection on angled or small faces), the clamp suppresses the wrong region - which is why LTXFaceDetector exists as a separate node: run it, wire its bbox string into override_face_bbox, and every identity node shares one good detection. And remember the community's recurring lesson with TenStrip face workflows: identity holds best when the source face has real detail to preserve, so crop wide shots closer. If you see the box artifact, that's detection/padding tuning, not a reason to drop the clamp.

Install is the pack-wide clone (10S_Nodes into custom_nodes, restart, or ComfyUI Manager β†’ "10S-Comfy-nodes"), no extra deps, LTX2-class models only. MediaPipe is the optional extra if auto face detection needs to be sharper.

Category10S Nodes/Identity

Inputs (15)

NameTypeDefaultDescription
modelMODELLTX2 model to patch with semantic-aware attn2 forward replacements. Chain after LikenessAnchor.
clipCLIPCLIP / text encoder used by your prompt conditioning (typically Gemma-3-12B for LTX2). Required to encode the face-modifier keywords for correspondence search.
positiveCONDITIONINGThe positive prompt conditioning. The node fingerprints this and matches at runtime so only the positive (cond) pass is modified, not the negative (uncond) pass.
suppression_strengthFLOAT0.500–1How much to suppress attention from face-bbox video tokens to face-modifier text tokens. 0 = no-op. 0.5 = halve their influence (recommended). 1.0 = fully block their influence (may cause rigidity).
reference_infooptREFERENCE_INFOWire from LikenessGuide for the bbox and spatial dims. If not wired, falls back to override_face_bbox.
face_modifier_textoptSTRINGsmiling, frowning, laughing, open mouth, closed mouth, eyes closed, eyes open wide, happy, sad, angry, surprised, expressionComma-separated keywords describing the expression / facial-modifier vocabulary to suppress. The node encodes this via your CLIP and uses correspondence search to identify matching tokens in your positive prompt. The default covers common expression vocabulary β€” usually no need to customize.
similarity_thresholdoptFLOAT0.650–1Minimum top-K-mean cosine similarity for a positive-prompt token to be considered face-modifier-like. Only used when auto_threshold=disabled. Different encoders produce different absolute similarity values β€” prefer auto_threshold for portability.
auto_thresholdoptCOMBOp95Auto-calibrate similarity threshold to the encoder's score distribution. p95 = suppress top ~5% of most-modifier-like tokens. p98 = top 2%. p99 = top 1%. disabled = use similarity_threshold literal value. Recommended: p95 for balanced effect, p98 for narrower.
similarity_sharpnessoptFLOAT16.01–64Sigmoid steepness around the threshold. Higher = more binary (sharp) partition between suppressed and not. 16 (default) makes the gate effectively binary within ~0.05 of threshold. Lower values (8) create soft tails that leak suppression to most tokens.
suppression_flooroptFLOAT0.300–0.9Hard floor on final suppression weights. Tokens with weight below this become 0 (unsuppressed). Eliminates sigmoid's soft tail leak. 0.3 default cuts off all weak matches; 0.5 only keeps strong matches; 0.0 disables (full sigmoid tail).
top_koptINT31–16Number of top similarity values to average for each positive token's match score. Higher K requires more confirming matches in modifier vocabulary, reducing false positives. K=1 = max (most permissive). K=3-5 (default 3) = robust.
soft_edge_fracoptFLOAT0.150–0.5Soft falloff fraction at bbox edges. 0.15 default for smooth transition. Lower = more focused, higher = more diffuse.
override_face_bboxoptSTRINGManual bbox 'x1,y1,x2,y2' normalized 0-1. Used when reference_info not wired.
bypassoptBOOLEANfalseIf True, model passes through unchanged.
debugoptBOOLEANfalseβ€”

Outputs (1)

NameTypeDescription
MODELMODELβ€”