Nodes/ComfyUI-RefUNet/REF] Create Bank
ComfyUI Node

REF] Create Bank

A shared empty dictionary, dressed up as a node

By logtd·Created 2 years ago·Updated 2 years ago· 46
REF] Create Bank
    • REF_BANK

    CreateRefBank is the simplest node in ComfyUI-RefUNet, and if you strip the fancy name it's literally just an empty Python dictionary. It has no inputs, no knobs, and its one output is a custom type this pack defines: REF_BANK. But that dictionary is the bridge between the pack's two sampling passes, so it earns its place in every working workflow.

    Here's the flow. Your reference-UNet graph has a write pass (WriteSampler) and a read pass (ReadSampler), and they share one thing: the bank. During the write pass, the selected attention blocks store the reference image's per-block features in the bank, keyed by block and conditioning type. During the read pass, those same blocks pull the stored features back out and concatenate them into the animation frames' self-attention. One node creates that bank, and the same REF_BANK wire has to reach both samplers - this is the part people get wrong.

    Because the bank is a mutable object passed by reference, wiring one CreateRefBank into both samplers means they're mutating the same underlying dict. That's the intended design: WriteSampler clears and refills it, ReadSampler reads it. If you accidentally create two banks - one per sampler - the read pass finds an empty bank, gets no reference features, and your animation ignores the reference entirely. The symptoms look like a strength problem, but they're a wiring problem. One bank, both samplers, done.

    There's genuinely nothing else to say about the node itself: it takes no configuration, downloads nothing, and costs nothing at runtime. It's the shared-memory idiom of the whole technique, made visible on the graph. If you're following the pack's example workflow, you'll see a single CreateRefBank feeding both WriteSampler and ReadSampler, with a PrepareRefLatents in between to force execution order.

    Install is the pack-wide step: ComfyUI Manager → search "ComfyUI-RefUNet", or git clone https://github.com/logtd/ComfyUI-RefUNet into custom_nodes/, then restart. No Python requirements (the README says so explicitly). This node also tells you a lot about how the pack ages: because REF_BANK is just a dict traveling through transformer_options, it only works as long as the ComfyUI internals it hooks into (the BasicTransformerBlock forward pass) keep their current shape - which is why this whole pack is sensitive to big ComfyUI updates.

    Categoryreference

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    REF_BANKREF_BANK