ComfyUI Node
Train Lens (Contrastive)
Train a concept direction via contrastive paired-margin optimization. Provide positive texts embodying the concept and negative texts describing similar scenes WITHOUT the concept. Fast (~30s).
Train Lens (Contrastive)
- lens_path
◄concept_namemy_concept►
◄positive_texts►
◄negative_texts►
◄targetzimage►
◄contrastive_steps500►
◄encoder_path►
◄output_dir►
◄protect_existingtrue►
CategoryConcept Steer
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| concept_name | STRING | my_concept | Name for the concept (used in filename) |
| positive_texts | STRING | Texts that EMBODY the concept (one per line). E.g. for 'cinematic': 'A dramatic chiaroscuro portrait with deep shadows and golden rim lighting' | |
| negative_texts | STRING | Neutral/opposite texts (one per line, same count as positive). E.g. 'A portrait with standard studio lighting and even exposure' | |
| target | COMBO | zimage | Target model architecture. 'zimage' = Qwen 3.4B (2560d), 'sd15' = SigLIP (768d) |
| contrastive_steps | INT | 500500–20000 | Contrastive optimization steps (more = more refined) |
| encoder_path | STRING | Path to Qwen 3.4B safetensors file (for zimage target). Leave empty to use QWEN_ENCODER_PATH env var. | |
| output_dir | STRING | Override output directory for the lens file | |
| protect_existing | BOOLEAN | true | If the output lens file already exists, save as _v2, _v3, … instead of overwriting. Disable only when intentionally replacing. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| lens_path | STRING | — |