Nodes/ComfyUI-RefUNet/REF] Ref Attn Map SD1
ComfyUI Node

REF] Ref Attn Map SD1

Toggle which UNet blocks capture the reference — no typing required

By logtd·Created 2 years ago·Updated 2 years ago· 46
REF] Ref Attn Map SD1
    • ATTN_MAP
    input_0true
    input_1true
    input_2true
    input_3true
    input_4true
    input_5true
    middle_0true
    output_0true
    output_1true
    output_2true
    output_3true
    output_4true
    output_5true
    output_6true
    output_7true
    output_8true

    CustomRefMapSD1 is the friendlier half of the pack's attention-map pair. Where ConfigRefMapAdv makes you type comma-separated block indices, this node gives you sixteen on/off booleans that map one-to-one onto the SD1.5 UNet's self-attention blocks: input_0 through input_5, a single middle_0, and output_0 through output_8. Every toggle defaults to True, and the output is an ATTN_MAP you feed into the opt_attn_map input on WriteSampler and ReadSampler.

    What you're controlling is which attention blocks participate in the reference feature swap. Turn a block on and it will store the reference's features during the write pass and re-inject them during the read pass; turn it off and that block ignores the reference entirely. It's a fidelity-versus-cost dial. All on gives you the strongest reference adherence the pack can manage; trimming blocks trades adherence for VRAM and speed. There's no universal "right" answer - it's a knob, and the defaults exist because they're the safe middle.

    The "SD1" in the name is doing real work. This node's block layout is hard-coded to the classic SD1.5 UNet structure - six input blocks, one middle block, nine output blocks - which is also the architecture FollowYourEmoji, MusePose, and AnimateAnyone were built on. That's why this pack is a 2024-era SD1.5 tool and not something you apply to SDXL or Flux. If your model isn't an SD1.5 UNet with a BasicTransformerBlock layout, this node and the whole pack will quietly do nothing useful.

    A small honesty note: the pack's built-in fallback map (used when you don't wire an ATTN_MAP at all) actually covers more blocks than these sixteen toggles expose - twelve input blocks and ten output in the code's constant. So the SD1 node's sixteen toggles are a curated subset, not the full internal list. If you need the exact full coverage, that's what ConfigRefMapAdv's text inputs are for; for everyone else, the toggles are perfectly fine.

    Install is the pack-wide step: ComfyUI Manager → search "ComfyUI-RefUNet", or git clone https://github.com/logtd/ComfyUI-RefUNet into custom_nodes/, restart. No Python requirements per the README. Start with everything on, get a working animation, and only start toggling things off when you're chasing VRAM or speed - that's the honest order of operations for a node like this.

    Categoryreference/custom

    Inputs (16)

    NameTypeDefaultDescription
    input_0BOOLEANtrue
    input_1BOOLEANtrue
    input_2BOOLEANtrue
    input_3BOOLEANtrue
    input_4BOOLEANtrue
    input_5BOOLEANtrue
    middle_0BOOLEANtrue
    output_0BOOLEANtrue
    output_1BOOLEANtrue
    output_2BOOLEANtrue
    output_3BOOLEANtrue
    output_4BOOLEANtrue
    output_5BOOLEANtrue
    output_6BOOLEANtrue
    output_7BOOLEANtrue
    output_8BOOLEANtrue

    Outputs (1)

    NameTypeDescription
    ATTN_MAPATTN_MAP