SSR Load Attentions
Loading the Bigger of the Two Model Files
- SSR_ATTENTIONS
LoadSSRAttention ("SSR Load Attentions") is the second loader in the SSR-Encoder pack, and it's the one carrying the real weight: it reads ssr_attentions.safetensors, a ~73MB file, and turns it into the trained cross-attention layers that ApplySSR grafts onto your UNet. The aligner (loaded by its sibling node) decides what to copy from the reference image; these layers are the trained machinery that does the copying. Without them, ApplySSR has nothing to install.
Why you'd reach for it
SSR-Encoder from the CVPR 2024 paper is a subject-driven adapter in the IP-Adapter family: it injects reference-image features through cross-attention while your text prompt keeps working. Where IP-Adapter adds one small adapter that influences everything, SSR trains per-block cross-attention layers so it can inject the query-selected subject at many stages of the UNet - the input blocks (1–6), the middle block, and the output blocks (3–11). LoadSSRAttention is how those trained layers get into your graph. It's the structural counterpart to the "how much and where" side of the pipeline, while EncodeSSRQuery handles the "what."
How it works
The node scans ComfyUI/models/ssr, and when you pick the file from its checkpoint dropdown it loads the state dict and reconstructs an SSRCrossAttention module for each block SSR touches. Every block gets its to_k and to_v projection layers populated from keys named like 1.to_k_SSR.weight and 1.to_v_SSR.weight in the file - one module for each of the 16 blocks. The output isn't a tensor you can look at; it's a dictionary mapping ('input', i), ('middle', 0), and ('output', i) keys to those modules. ApplySSR consumes that dictionary directly and installs each module in the right place via set_model_attn2_replace. During sampling, each one computes the normal cross-attention and then adds the scaled SSR attention on top - positive embeds on the positive branch, negative on the uncond branch.
Inputs and outputs
- checkpoint - a dropdown of
.safetensorsfiles inComfyUI/models/ssr. Pick the attention file. - SSR_ATTENTIONS - the dictionary of trained cross-attention layers, wired into ApplySSR's
ssr_attentionsinput.
Nothing else. And a small gotcha the example workflow will trip you on: the shipped workflow's widget value says ssr_layers.safetensors, but the file that actually exists on HuggingFace is ssr_attentions.safetensors. Don't go hunting for a file named ssr_layers - the loader lists whatever's actually in the folder, so the filename is cosmetic. Just point it at the 73MB attention file.
Installing
ComfyUI Manager: search "SSR Encoder", install, restart. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/logtd/ComfyUI-SSREncoder
No requirements.txt, no pip step. The download is the setup:
mkdir -p ComfyUI/models/ssr
# download ssr_attentions.safetensors (~73MB) from
# https://huggingface.co/logtd/ssr_encoder/tree/main into that folder
Common issues
Same first failure as the other loader: empty dropdown means the file isn't in ComfyUI/models/ssr, or it's sitting in models/checkpoints where this node won't look. The second most common confusion is wiring - if you connect SSR_ATTENTIONS to ApplySSR but skip the SSR_EMBEDS wire from EncodeSSRQuery (or vice versa), ApplySSR has incomplete data and you get a silent no-op: the graph renders, the output is plain SD 1.5, and nothing was injected. And keep the SD 1.5-only rule in mind - the per-block projection layers are hard-coded to 768-dim CLIP text embeddings, so this pack is a strict SD 1.5 citizen. On SD 1.5 with both files in place, it's a genuinely neat, training-free way to selectively borrow a subject from a reference.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| checkpoint | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SSR_ATTENTIONS | SSR_ATTENTIONS | — |