Nodes/ComfyUI QwenScope/Train Lens (Contrastive)
ComfyUI Node

Train Lens (Contrastive)

Train a steering direction from text pairs. Provide N positive and N negative prompts (one per line, equal counts). Outputs a steer plan ready for Steer Conditioning / Steer CLIP.

By Nynxz·Created 3 months ago·Updated 3 months ago· 0
Train Lens (Contrastive)
  • clip
  • steer
  • report
positive_texts
negative_texts
layer-1
steps500
lr0.0100
beta50
strength1.00
save_name
CategoryQwenScope/Train

Inputs (9)

NameTypeDefaultDescription
clipCLIP
positive_textsSTRINGTexts that EMBODY the concept (one per line).
negative_textsSTRINGNeutral / opposite texts (same count as positives).
layerINT-1-128–127Layer to capture residuals at. -1 = last layer (use this if you'll apply via Steer Conditioning). Middle layers (e.g. half of total) work well for Steer CLIP at the same layer.
stepsINT50050–10000
lrFLOAT0.01000.0001–0.1
betaFLOAT501–200Margin sharpness in the BT loss. Higher = sharper boundary.
strengthFLOAT1.00-8–8
save_nameoptSTRINGIf set, also save to lenses/qwenscope/<save_name>.safetensors.

Outputs (2)

NameTypeDescription
steerQSCOPE_STEER
reportSTRING