Nodes/ComfyUI-AnimateAnyone-Evolved/Load UNet2D ConditionModel
ComfyUI Node

Load UNet2D ConditionModel

Load the network that remembers what your character looks like

By MrForExample·Created 3 years ago·Updated 2 years ago· 562
Load UNet2D ConditionModel
    • unet2d
    pretrained_base_unet_folder_path./pretrained_weights/stable-diffusion-v1-5/unet/
    unet2d_model_path./pretrained_weights/reference_unet.pth

    Of the two model loaders in the AnimateAnyone-Evolved pack, this is the one people skim past because its output isn't a video - it's the character's "memory." The [AnimateAnyone] Load UNet2D ConditionModel node loads the reference net, the component that keeps your character looking like the person in the reference image while their body follows the pose video.

    What you're actually loading

    AnimateAnyone's trick is splitting the job between two UNets. This one, the 2D reference net (reference_unet.pth), is the appearance specialist. It's functionally closest to an IP-Adapter: it looks at your reference image and produces conditioning that tells the generator "the character in every frame looks like this." The author's own summary of the whole pipeline calls it exactly that - "reference net (which function wise is kind of similar to IP-Adapter)" - one of four components trained end-to-end rather than bolted together from separately-trained models.

    Under the hood the node does two things. First it loads a stock SD 1.5 UNet from a diffusers-format folder, then it overwrites those weights with the reference net's state dict from reference_unet.pth. That two-step pattern is why there are two path inputs instead of one.

    Inputs and output

    • pretrained_base_unet_folder_path - defaults to ./pretrained_weights/stable-diffusion-v1-5/unet/. This is a folder containing the diffusers config.json plus the diffusion_pytorch_model.bin weights, downloaded from the SD 1.5 repo.
    • unet2d_model_path - defaults to ./pretrained_weights/reference_unet.pth, from the Moore-AnimateAnyone weights on Hugging Face (patrolli/AnimateAnyone).

    Both defaults are relative to the pack's own install folder, so the standard layout is to keep everything under ComfyUI/custom_nodes/ComfyUI-AnimateAnyone-Evolved/pretrained_weights/. If your paths are wrong you'll get a file-not-found or a state-dict shape mismatch at load time, and the node names which file it couldn't find.

    The single output is unet2d (type UNET2D), wired directly into the Animate Anyone Sampler's reference_unet input. Nothing else in the graph consumes it.

    Installing it

    Install the pack first, then fetch the two pieces of this loader:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved
    pip install -r requirements.txt
    

    The base UNet comes from the runwayml/stable-diffusion-v1-5 repo on Hugging Face - you only need its unet/ folder, not the whole model. reference_unet.pth comes from patrolli/AnimateAnyone. Neither is auto-downloaded, so this is a genuinely fiddly pack to bring up: four .pth files, an SD 1.5 UNet folder, a CLIP vision encoder, and a VAE all need to land in the right places before the example workflow runs.

    Gotchas

    Because the reference net is what keeps identity consistent, a weak or wrong load here shows up as the character drifting or swapping faces mid-video. And a stale note: this pack's last commit is from February 2024, so on a modern ComfyUI the common failure is a diffusers version clash at import - the README's fix is pip install --force-reinstall diffusers>=0.26.1. Get past that and this loader is boring in the good way: point it at the two files, watch it light up green.

    CategoryAnimateAnyone-Evolved/loaders

    Inputs (2)

    NameTypeDefaultDescription
    pretrained_base_unet_folder_pathSTRING./pretrained_weights/stable-diffusion-v1-5/unet/
    unet2d_model_pathSTRING./pretrained_weights/reference_unet.pth

    Outputs (1)

    NameTypeDescription
    unet2dUNET2D