Nodes/ComfyUI-AnimaFastTrain/AnimaFastTrain - Patch Model
ComfyUI Node

AnimaFastTrain - Patch Model

The node that turns trained Anima reference tokens into actual pictures

By quinteroac·Created 3 months ago·Updated 3 months ago· 27
AnimaFastTrain - Patch Model
  • model
  • context
  • model
reference_context_scale0.45
reference_context_modepositive

The train node is the front half of ComfyUI-AnimaFastTrain - it bakes your reference image into in-memory context tokens. This is the back half, the node that makes those tokens actually do something. AnimaFastTrain - Patch Model takes the trained context and a model, and hands back a patched MODEL you plug straight into a normal KSampler. If the train node gives you the identity, this is where you turn it on. Without it, all you have is a tensor sitting in RAM looking smug.

How it works

The node wraps your model and, on every denoising call, splices the trained tokens onto the front of the cross-attention context in all 28 Anima blocks - concatenated, not added, so the model sees "reference identity + your prompt" as one context. It then restores every block's original forward pass immediately after the call, so the patch can't leak into other workflows or linger between generations. The implementation uses a model-function wrapper, which is the detail that makes it survive model clones that would otherwise drop the injection. It's a clean design for something labeled experimental.

The inputs that matter

Only four, and two of them are your knobs:

  • model - the MODEL you want patched. Critical detail: feed it the final model, after any LoRA or model patch nodes. Checkpoint Loader -> LoRA Loader -> Patch Model -> KSampler.
  • context - the ANIMA_REFERENCE_CONTEXT output of either train node.
  • reference_context_scale (default 0.45, range 0–5) - the "how hard does the reference hit" knob. Training runs at scale 1.0; the README defaults runtime to 0.45 because full strength tends to dominate the prompt. Identity too faint? Nudge up. Reference overpowering your scene? Nudge down. 0 is a free A/B switch.
  • reference_context_mode - positive (default) injects only into the positive conditioning; all injects into positive and negative (uncond) alike. Start with positive; all can make the negative prompt fight the reference.

Output: a single MODEL - straight into KSampler, no special handling.

The trap to respect: graph order

The README is explicit and it's the one thing that will actually break you:

If another model patch node runs after Patch Model, it may clone the model and drop this experimental wrapper.

So keep it last in the chain. Any node that re-patches the model after this one can silently strip the injection - you'll get perfectly fine images that just don't look like your reference, and it's easy to blame the training.

Install

ComfyUI Manager → search ComfyUI-AnimaFastTrain, or:

cd ComfyUI/custom_nodes
git clone https://github.com/quinteroac/ComfyUI-AnimaFastTrain.git

Restart ComfyUI. No extra pip dependencies, no model files to download - the pack ships none. The nodes live under Anima/AnimaFastTrain.

Where people get burned

Nothing looks like the reference. Before touching scale, re-check the graph order above - a LoRA applied after the patch is the usual culprit. If order is right, raise reference_context_scale a bit at a time; 0.45 is a gentle default, and the author's own testing says the tokens also learn pose and composition, so don't expect a perfect face-print.

The context is stale. Swap the reference image but forget to re-run the train node, and you're generating with the old identity. Re-train; the context object is replaced wholesale.

VRAM. Patching itself is light, but the training that feeds it loads the whole model - if training was a squeeze, generation inherits the tension. See the train node page for the details.

CategoryAnima/AnimaFastTrain

Inputs (4)

NameTypeDefaultDescription
modelMODEL
contextANIMA_REFERENCE_CONTEXT
reference_context_scaleFLOAT0.450–5
reference_context_modeCOMBOpositive2 options: positive, all

Outputs (1)

NameTypeDescription
modelMODEL