Analyze CLIP (SAE)
Analyze CLIP (SAE) — read the features of the text encoder actually powering your image model
- clip
- sae
- features
- info
Analyze CLIP (SAE) is the node that makes this whole pack interesting to image people, not just LLM nerds. The text encoder in modern image models isn't CLIP anymore - FLUX.2 [klein] 9B encodes your prompt with a Qwen3-8B, Qwen-Image with a Qwen2.5-VL. Which means the exact same Qwen-Scope SAE machinery that reads an LLM's "thoughts" can read what your image model's encoder is doing with your prompt. This node does exactly that: hook the transformer that lives inside any ComfyUI CLIP object, run your prompt through it, and encode the residual at one layer through a Qwen-Scope SAE.
So instead of loading a separate Qwen model just to analyze text, you point this at the CLIP you already have loaded for generation. Same feature output, no extra 2–9GB LLM in VRAM.
How it works
The clever bit is discovery. ComfyUI wraps text encoders under different attribute paths depending on loader and quantisation - fp16, fp8mixed, fp4mixed, GGUF, whatever. clip_bridge probes a list of known paths (model.layers, language_model.model.layers, …) plus a fallback that scans for the biggest ModuleList that looks like decoder blocks, and attaches the capture hook wherever it finds the real transformer. That's why it works on quantised encoders too: the SAE runs on the activations, whatever precision they arrive in.
There's one hard requirement: the SAE pack's d_model must match the encoder's hidden size. The node checks this explicitly and, if they don't match, prints an error with a "did you mean…?" list of packs that fit your encoder dimension. For FLUX.2 [klein] 9B that means Qwen/SAE-Res-Qwen3-8B-Base-W64K-L0_50; Qwen-Image's Qwen2.5-VL has no released SAE yet, so you're out of luck there for now.
The inputs that matter
- clip - the
CLIPfrom any Load CLIP / unCLIP-checkpoint node in your graph. - sae - from Load Qwen-Scope SAE. The layer you pick there is the layer analyzed.
- prompt - your text. Since this is an image-model encoder, write it like an image prompt, not an essay.
- top_k - features kept per token (default 64;
0= all ReLU activations). - skip_first_token - drop the boilerplate first token; usually leave off.
Outputs: features (QSCOPE_FEATURES) into the inspect nodes - you can literally drop a Feature Heatmap on your own image-model prompt and see which features it leans on. info reports the layer, token count and sparsity.
Installing it
Same one-install pack: ComfyUI Manager → search "ComfyUI QwenScope", or
cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-QwenScope
restart. Dependencies (transformers, huggingface_hub, safetensors, Pillow, numpy) are the usual suspects; the SAE layer downloads on first use.
Common issues
If you get "Could not find transformer layers inside this CLIP", it usually means your loader wraps the encoder somewhere the probe didn't expect - the error includes a dump of the CLIP's structure to debug against. And if top_k visualizations look sparse or wrong, double-check the layer you picked: encoder layers are few and the SAE's layer field maps 1:1 to them, so pick a layer well inside the encoder's range.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| sae | QSCOPE_SAE | — | |
| prompt | STRING | a photo of a cat | — |
| top_k | INT | 640–4096 | Top-K features kept per token. 0 = ReLU only. |
| skip_first_token | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| features | QSCOPE_FEATURES | — |
| info | STRING | — |