Nodes/AnimateDiff Evolved/Apply AnimateDiff-PIA Model πŸŽ­πŸ…πŸ…“β‘‘
ComfyUI Node Runs on cloud

Apply AnimateDiff-PIA Model πŸŽ­πŸ…πŸ…“β‘‘

Image-conditioned motion, the Gen2 way

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,519
Apply AnimateDiff-PIA Model πŸŽ­πŸ…πŸ…“β‘‘
  • motion_model
  • image
  • vae
  • pia_input
  • motion_lora
  • scale_multival
  • effect_multival
  • ad_keyframes
  • prev_m_models
  • per_block
  • M_MODELS
β—„start_percent0.000β–Ί
β—„end_percent1.000β–Ί

Most of AnimateDiff is text-to-video: you prompt, the motion module animates whatever the checkpoint would have generated anyway. PIA (Personalized Image Animator) flips that - you give it a starting image and it animates that. This node is how AnimateDiff-Evolved wires PIA support into its Gen2 node system, and per the pack's own README, it's the only way to actually feed PIA an input image; the plain PIA support elsewhere in the pack doesn't take one.

What it's doing

PIA is a separate small model (pia.ckpt) layered on top of an AnimateDiff motion model, trained to condition motion generation on a reference image rather than starting from noise alone. This node applies that combination: it takes your motion model, your reference image, and a VAE to encode it, and produces an M_MODELS object - AnimateDiff-Evolved's Gen2 chain type for stacking one or more active motion models together - ready to plug into the rest of your Gen2 sampling setup.

Because it outputs M_MODELS and accepts prev_m_models as an input, you can chain this after (or before) other Gen2 motion-model applications, which is the mechanism the README describes for "using multiple motion models at once."

Inputs and outputs that matter

  • motion_model (MOTION_MODEL_ADE, required) - the loaded AnimateDiff motion model this PIA application attaches to.
  • image (IMAGE, required) - your reference/starting frame.
  • vae (VAE, required) - needed to encode that image; the README specifically calls out using a Scale Ref Image and VAE Encode node upstream to preprocess it.
  • start_percent / end_percent (floats, default 0 and 1) - the portion of the sampling process this PIA application is active for, letting you switch it in or out partway through a run rather than only at full strength the whole time.
  • pia_input (optional, PIA_INPUT) - how strongly/which way the reference image drives motion. The README says this comes from either the paper's presets (a PIA Input [Paper Presets] node) or manual values (PIA Input [Multival]) - neither of those nodes is covered in this brief, so check the pack's node list directly if you need them.
  • motion_lora, scale_multival, effect_multival, ad_keyframes, per_block (all optional) - the same motion-tuning inputs available elsewhere in the Gen2 family.
  • prev_m_models (optional, M_MODELS) - chain another motion model application onto this one.
  • Output: M_MODELS - feed this into your Gen2 sampling chain.

Installing the pack and the extra model

ComfyUI Manager: search AnimateDiff Evolved, confirm the author is Kosinkadink, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved

restart. Beyond the base motion module requirement (mm_sd_v15_v2, v3_sd15_mm, etc. into ComfyUI/models/animatediff_models), PIA needs its own model: pia.ckpt, per the README available from Leoxing's HuggingFace repo.

Common issues

Motion looks wrong or the model won't behave. The README is explicit here: PIA requires the autoselect or sqrt_linear (AnimateDiff) beta_schedule specifically. Using the wrong schedule is the most likely reason PIA output looks broken compared to a standard AnimateDiff run.

You want it for vid2vid, not img2vid. The README notes PIA was designed for image-to-video, but the author found it works well for vid2vid purposes too - with ref_drift=0.0 on the PIA input, and running it for at least one step before switching to other Apply nodes chained via prev_m_models. apply_ref_when_disabled (on the PIA input node, not this one) can be set to keep the image encoder contributing even past end_percent.

High-resolution outputs losing coherence. The README specifically calls out PIA as useful for maintaining coherence at higher resolutions when paired with ControlNet and SD LoRAs - the author reports easily upscaling 512x512 source to 1024x1024 in a single pass this way, which is worth trying if your non-PIA AnimateDiff runs are falling apart at higher resolutions.

Reference image looks ignored. Double-check the image is actually going through a VAE-encode step matched to your vae input - and that pia_input isn't left at a value that effectively zeroes out the image's influence.

CategoryAnimate Diff πŸŽ­πŸ…πŸ…“/β‘‘ Gen2 nodes β‘‘/PIA

Inputs (12)

NameTypeDefaultDescription
motion_modelMOTION_MODEL_ADEβ€”
imageIMAGEβ€”
vaeVAEβ€”
start_percentFLOAT0.0000–1β€”
end_percentFLOAT1.0000–1β€”
pia_inputoptPIA_INPUTβ€”
motion_loraoptMOTION_LORAβ€”
scale_multivaloptMULTIVALβ€”
effect_multivaloptMULTIVALβ€”
ad_keyframesoptAD_KEYFRAMESβ€”
prev_m_modelsoptM_MODELSβ€”
per_blockoptPER_BLOCKβ€”

Outputs (1)

NameTypeDescription
M_MODELSM_MODELSβ€”