Nodes/ComfyUI-RefUNet/REF] Read Sampling
ComfyUI Node

REF] Read Sampling

Every animation frame attends to your reference

By logtd·Created 2 years ago·Updated 2 years ago· 46
REF] Read Sampling
  • ref_bank
  • sampler
  • SAMPLER
sampler_name
start_percent0.00
end_percent1.00

If WriteSampler is the pack's capture half, ReadSampler is the payoff half. It's a SAMPLER replacement you drop into the sampler node that's actually generating your animation, and during a chosen window of steps it does the thing that makes reference-UNet animation work: at each selected attention block, it pulls the reference features out of the shared ref_bank and concatenates them into the self-attention context. Your animation frames' tokens then literally attend to your reference image's tokens - that's how the character's look gets carried frame after frame instead of drifting.

The inputs: sampler_name (any standard sampler from ComfyUI's list), start_percent and end_percent (default 0 and 1 - the fraction of the total step range where reference reading is active), and ref_bank (required - must be the same bank your WriteSampler wrote to). There's also an optional sampler input so you can chain an existing KSAMPLER if you need a specific base behavior. The single output is SAMPLER, which goes into your KSampler or SamplerCustom's sampler slot - note it has no SIGMAS output; in the example workflow the read pass takes its sigmas from a BasicScheduler, not from this node.

There's a subtle piece of correctness here worth respecting: the pack handles the unconditional (negative) branch properly. The reference features in the bank belong to the conditioned pass, so when the unconditional branch runs, the code detects it has no stored reference for that conditioning and recomputes self-attention without the reference rather than feeding it garbage. That's the kind of detail that separates a working pipeline from a smeary one, and it's why you shouldn't just swap in a vanilla sampler.

Why would you care about start_percent/end_percent? Reference influence doesn't have to be on for every step. Many people run read mode for the early/middle steps where the composition gets locked in, then let the sampler run free at the end so fine detail isn't overcooked by the reference. It's the same instinct as using a ControlNet with an end-percent. Defaults are fine to start; trimming comes later, once your base result is good.

Install: ComfyUI Manager → search "ComfyUI-RefUNet", or git clone https://github.com/logtd/ComfyUI-RefUNet into custom_nodes/, restart. No Python deps. Gotchas are the pack's usual ones: the read model needs a ConfigureRefNet applied, and the ref_bank wire must be the same one the write pass used. If the output looks like the reference never happened, check the bank wire and the ConfigureRefNet before you touch any sampling setting.

Categoryreference/sampling

Inputs (5)

NameTypeDefaultDescription
sampler_nameCOMBO34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28
start_percentFLOAT0.000–1
end_percentFLOAT1.000–1
ref_bankREF_BANK
sampleroptSAMPLER

Outputs (1)

NameTypeDescription
SAMPLERSAMPLER