ComfyUI Node

ADMD_ComfyModelLoader

The ComfyUI-native path into MotionDirector training — reuse what's already loaded

By kijai·Created 3 years ago·Updated 2 years ago· 187
ADMD_ComfyModelLoader
  • model
  • clip
  • vae
  • motion_model
  • PIPELINE
schedulerDDIMScheduler
use_xformersfalse

ADMD_ComfyModelLoader is the odd one out among the pack's three loaders: instead of taking a checkpoint filename, it takes already-loaded ComfyUI objects - a MODEL, a CLIP, a VAE, and an AnimateDiff motion model from MOTION_MODEL_ADE. It's the path for people who already have a working AnimateDiff inference graph and want to train from the exact same pieces, without juggling a second copy of the weights on disk.

Think of it as "everything's already in my ComfyUI graph, just convert it for training." If that sentence sounds like you, this is the loader to reach for. If your whole setup is a checkpoint file and a motion module, ADMD_CheckpointLoader or ADMD_DiffusersLoader is simpler.

How it works

The mechanism mirrors ADMD_CheckpointLoader with one difference at the front: instead of reading a checkpoint file, it calls model.model.state_dict_for_saving(...) to pull the state dict out of the ComfyUI model you already have loaded (it loads the model to GPU first via load_models_gpu). That dict is then converted through the same single_file_utils machinery - VAE, CLIP text encoder, 3D UNet - and the motion model comes straight from your AnimateDiff-Evolved loader. Freeze, gradient checkpoint, xformers toggle, done. Same PIPELINE out.

One thing to notice in the source: where the other loaders attach the domain adapter LoRA from ADMD_AdditionalModelSelect, this node hard-codes an empty adapter path. The Comfy path gets its motion from the MOTION_MODEL_ADE input instead, so there's no adapter slot here. If your workflow depends on the v3 domain adapter for quality, load it through AnimateDiff-Evolved as part of the motion model rather than expecting this node to add it.

Inputs and output

  • model / clip / vae - straight from a standard Load Checkpoint (or any node producing those types).
  • motion_model - MOTION_MODEL_ADE, i.e. the output of AnimateDiff-Evolved's motion model loader. This input is required, so ComfyUI-AnimateDiff-Evolved has to be installed for this node to be usable at all.
  • scheduler - DDIMScheduler (default) or DDPMScheduler, for the training noise schedule. Leave it.
  • use_xformers - off by default; only matters if xformers is installed.

Output: one PIPELINEADMD_InitializeTraining.

Install and gotchas

Same pack install as the siblings - Manager → "ADMotionDirector", or clone into custom_nodes/ - and then the dependencies, which ComfyUI does not ship:

cd ComfyUI/custom_nodes/ComfyUI-ADMotionDirector
pip install -r requirements.txt

(portable: python_embeded\python.exe -m pip install -r ...). Diffusers, transformers, lion-pytorch, peft, loralib, einops, omegaconf, imageio. requirements.txt doesn't pin a CUDA torch build, so make sure your ComfyUI env has the CUDA wheel - a CPU torch here makes training silently miserable.

Two practical notes. This node also re-executes on every queue (IS_CHANGED returns nan), so expect the model conversion each run. And because it lives inside AnimateDiff-Evolved's ecosystem, remember the wider context: AnimateDiff is a 2023-era motion-module stack for SD 1.5 that modern video models (Wan, LTX) have largely displaced - if you're building something new for general video quality, look there instead; this loader is for people deliberately training the AnimateDiff look.

CategoryAD_MotionDirector

Inputs (6)

NameTypeDefaultDescription
modelMODEL
clipCLIP
vaeVAE
motion_modelMOTION_MODEL_ADE
schedulerCOMBODDIMScheduler2 options: DDIMScheduler, DDPMScheduler
use_xformersBOOLEANfalse

Outputs (1)

NameTypeDescription
PIPELINEPIPELINE