ComfyUI Node
Diff Features
Compare two conditionings through an SAE to discover which features encode the semantic difference between them. The most powerful research tool: instead of guessing features, let the diff tell you what makes 'cinematic' different from 'snapshot', or 'oil painting' from 'watercolor'. Outputs a chart and a ready-to-paste feature list for Feature Gate or Feature Probe.
Diff Features
- conditioning_a
- conditioning_b
- VISUALIZATION
- DIFF_REPORT
- A_FEATURES
- B_FEATURES
◄sae_path►
◄top_k15►
◄min_diff0.010►
◄sae_expansion8►
◄transcoder_repo►
◄pool_modemean►
◄save_lensfalse►
◄lens_namediff_discovery►
◄dict_path►
◄protect_existingtrue►
CategoryConcept Steer/Research
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning_a | CONDITIONING | First conditioning (e.g. 'cinematic photo') | |
| conditioning_b | CONDITIONING | Second conditioning (e.g. 'snapshot photo') | |
| sae_path | STRING | Absolute path to SAE weights (.pt file). Must be the same SAE used in Feature Map/Gate. | |
| top_k | INT | 153–50 | Number of top differential features to show per side |
| min_diff | FLOAT | 0.0100–1 | Minimum absolute difference to include a feature. Raise this to filter noise. Lower to see subtle differences. |
| sae_expansion | INT | 82–128 | SAE expansion factor (auto-detected for transcoders). 8x for trained SAEs, 64x for pretrained transcoders. |
| transcoder_repo | STRING | HuggingFace repo for pretrained transcoders (e.g. 'mwhanna/qwen3-4b-transcoders'). Auto-downloads on first use. Leave empty to use sae_path instead. | |
| pool_mode | COMBO | mean | 'mean' = average across tokens (recommended). 'max' = max activation per feature across tokens. |
| save_lens | BOOLEAN | false | Save the differential direction as a .pt lens file in the lenses/ directory. Use with Concept Steer to apply the discovered concept difference. |
| lens_name | STRING | diff_discovery | Name for the saved lens file (only used when save_lens is enabled). |
| dict_path | STRING | Path to feature dictionary JSON (from Feature Dictionary node). When provided, differential features are labeled. | |
| protect_existing | BOOLEAN | true | If the lens file already exists (save_lens=True), save as _v2, _v3, … instead of overwriting. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| VISUALIZATION | IMAGE | — |
| DIFF_REPORT | STRING | — |
| A_FEATURES | STRING | — |
| B_FEATURES | STRING | — |