Nodes/Concept Steer/Diff Features
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.

By Nynxz·Created 5 months ago·Updated 5 months ago· 4
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)

NameTypeDefaultDescription
conditioning_aCONDITIONINGFirst conditioning (e.g. 'cinematic photo')
conditioning_bCONDITIONINGSecond conditioning (e.g. 'snapshot photo')
sae_pathSTRINGAbsolute path to SAE weights (.pt file). Must be the same SAE used in Feature Map/Gate.
top_kINT153–50Number of top differential features to show per side
min_diffFLOAT0.0100–1Minimum absolute difference to include a feature. Raise this to filter noise. Lower to see subtle differences.
sae_expansionINT82–128SAE expansion factor (auto-detected for transcoders). 8x for trained SAEs, 64x for pretrained transcoders.
transcoder_repoSTRINGHuggingFace repo for pretrained transcoders (e.g. 'mwhanna/qwen3-4b-transcoders'). Auto-downloads on first use. Leave empty to use sae_path instead.
pool_modeCOMBOmean'mean' = average across tokens (recommended). 'max' = max activation per feature across tokens.
save_lensBOOLEANfalseSave the differential direction as a .pt lens file in the lenses/ directory. Use with Concept Steer to apply the discovered concept difference.
lens_nameSTRINGdiff_discoveryName for the saved lens file (only used when save_lens is enabled).
dict_pathSTRINGPath to feature dictionary JSON (from Feature Dictionary node). When provided, differential features are labeled.
protect_existingBOOLEANtrueIf the lens file already exists (save_lens=True), save as _v2, _v3, … instead of overwriting.

Outputs (4)

NameTypeDescription
VISUALIZATIONIMAGE
DIFF_REPORTSTRING
A_FEATURESSTRING
B_FEATURESSTRING