Nodes/Anima Edit LoRA/Anima Edit LoRA
ComfyUI Node

Anima Edit LoRA

It doesn't load a LoRA — it's the glue that makes Anima Edit LoRAs work in ComfyUI

By wochenlong·Created 3 months ago·Updated 3 months ago· 1
Anima Edit LoRA
  • model
  • MODEL

First thing to know, because the name is a lie: Anima Edit LoRA doesn't load a LoRA. It's a compatibility patch, one MODEL in and one MODEL out, and its whole job is to make ComfyUI's built-in ReferenceLatent workflow talk to an Anima Edit LoRA you loaded some other way.

Why does that need to happen at all? Anima Edit LoRAs - the small adapter files people train for the 2B Anima base so you can take an existing image and change its expression, outfit, or composition without the character drifting into a stranger - were trained with a very specific input format. The reference image's latent gets concatenated onto the time axis of the DiT latent, like frames stacked in a video: target latent + ref latent feeds the model, and the model predicts the target. ComfyUI's built-in ReferenceLatent node, on the other hand, hands references to the sampler through the standard reference_latents conditioning channel. Those two contracts don't match. This node is the bridge.

How it works

It's small, and it's clean. The node clones your model (model.clone(), so your original stays untouched), then does two surgical patches:

  • It intercepts extra_conds so that whatever reference_latents the ReferenceLatent node passes get converted into a ref_latents condition on the model.
  • It wraps the UNet function so that when those refs exist, each is pushed onto the time axis ([B, C, H, W][B, C, 1, H, W]), then concatenated after the target latent. The model runs, and the output is sliced back down to just the original target's time length.

So the model genuinely sees target + ref1 [+ ref2 ...] exactly as it was trained to, and your output tensor stays the shape you expect. You won't get reference frames leaking into the result.

The inputs and outputs that matter

All of them, since there's only one of each:

  • model (MODEL) - an Anima model that already has your Anima Edit LoRA applied by whatever LoRA/adapter loader you use.
  • MODEL output - the patched model, which goes straight into KSampler.

Chain: load the Anima checkpoint → apply the Edit LoRA with your normal LoRA loader → run this node → attach ReferenceLatent (or more than one, multi-reference works) → sample.

Install

No dependencies, no model downloads, no weights to hunt down - the whole thing is one Python file.

cd ComfyUI/custom_nodes
git clone https://github.com/wochenlong/ComfyUI-Anima-Edit-LoRA.git

Then restart ComfyUI. ComfyUI Manager users can just search "Anima Edit LoRA". That's the entire install.

Where people get burned

The one real trap is shapes. Every reference latent must match the target latent's channel count and spatial size, and if it doesn't, the node throws a ValueError telling you exactly that. VAE-encode your reference at the same resolution as your generation - if you're mixing sizes, resize to a multiple of 8 first. A second gotcha is ordering: patch after you've applied the LoRA, not before, and make sure the patched model - not the original - feeds the KSampler.

One thing worth knowing if you're shopping: because this is a patch rather than a loader, it doesn't care which adapter node you used for the LoRA. Any loader that ends with a MODEL works, which keeps you out of loader wars. And don't expect this node to fix Anima Edit LoRAs that were trained against a different Anima version - if the LoRA was made for Preview 3 and you're on base 1.0, that's a weights problem, not something glue can repair.

Categoryanima/edit/reference

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
MODELMODEL