Nodes/ComfyUI-MimicMotion/MimicMotionNode
ComfyUI Node

MimicMotionNode

Make a photo dance by copying motion from a reference video

By AIFSH·Created 2 years ago·Updated 2 years ago· 386
MimicMotionNode
  • ref_image
  • ref_video_path
  • VIDEO
resolution576
sample_stride2
tile_size16
tile_overlap6
decode_chunk_size8
num_inference_steps25
guidance_scale2.00
fps15
seed42

This is the node behind every "I put my character's face on a TikTok dancer" video you saw on r/StableDiffusion back in mid-2024. Feed it one still photo and one video of someone moving, and it generates a new video where the person from your photo performs the motion from the reference clip. It's a single node doing the entire job - pose extraction and video generation both happen inside it, so there's no upstream pipeline to assemble.

Under the hood this is Tencent's MimicMotion research model - "High-Quality Human Motion Video Generation with Confidence-aware Pose Guidance" - wrapped into a ComfyUI node by AIFSH. It landed in the same window as LivePortrait and, later, StableAnimator, when pose-transfer/motion-transfer tools were genuinely everywhere for a few months. It's built on a Stable Video Diffusion (SVD) backbone: the same family of model that does image-to-video generation, here steered frame-by-frame by a pose sequence instead of drifting freely.

How it works

First it runs pose estimation over your ref_video_path to get a sequence of skeletal poses - the same kind of body-keypoint detection ControlNet's OpenPose/DWPose preprocessors do for still images, just applied across every frame of a clip. The "confidence-aware" part in the paper's title is the actual contribution: rather than trusting every detected pose equally, it weights down frames where the pose detector was uncertain, so one bad detection mid-clip doesn't wreck the whole output. That pose sequence then drives an SVD-based diffusion model, conditioned on ref_image to keep the person's identity, clothing, and appearance intact while the motion comes entirely from the reference video. There's no text prompt anywhere - it's 100% image- and motion-conditioned.

The inputs and outputs that matter

Two things actually change your result the most:

  • ref_image (IMAGE) - the person you want animated. This defines identity, appearance, and framing.
  • ref_video_path (VIDEO) - the motion source. Despite the "_path" in the name, ComfyICU wires this as a real VIDEO input from a video loader, not a text field - that's a leftover from how the original script took a file path.

From there, resolution (576 or 768, default 576) sets the output size - 768 looks sharper but costs more VRAM and time. num_inference_steps (default 25) and guidance_scale (default 2) are your diffusion knobs; the low default guidance scale is normal for SVD-family models, not a mistake - pushing it up toward SD-typical values (7+) tends to degrade the output rather than sharpen it, since there's no prompt for it to "follow" harder. fps (default 15) sets the output frame rate, and seed (default 42) is the usual RNG seed.

The rest - sample_stride, tile_size, tile_overlap, decode_chunk_size - are memory and pacing knobs you mostly leave alone. sample_stride (default 2) subsamples how densely the pose sequence is read from the reference video. tile_size/tile_overlap (defaults 16/6) process the video in overlapping chunks - the same sliding-window idea AnimateDiff uses for long clips without one giant context blowing out your GPU - and decode_chunk_size (default 8) is a separate knob for frames-per-VAE-decode, worth lowering if you OOM specifically during decode rather than sampling.

Output is a single VIDEO, which wires straight into PreViewVideo to check the result, or into a save-video node to keep it.

How to install it

Search "ComfyUI-MimicMotion" in ComfyUI Manager, or do it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/AIFSH/ComfyUI-MimicMotion.git
cd ComfyUI-MimicMotion
pip install -r requirements.txt

restart ComfyUI, and make sure ffmpeg actually works from your command line first. The README also pins xformers to a specific torch build (torch==2.1.0+cu121xformers==0.0.22.post7 in their example) - match yours instead of copying it blindly. Model weights aren't bundled; they download from HuggingFace the first time you run the node, and given the SVD backbone plus the motion module, that first-run download isn't small - budget time for it and don't assume ComfyUI has frozen.

Common issues & troubleshooting

VRAM. The author's own testing was on an 11GB 2080 Ti at default settings. If you're tighter than that, drop resolution to 576 and reduce tile_size or decode_chunk_size before anything else - those are the actual memory levers, not num_inference_steps.

Install fails on xformers. This is the single most common failure with this pack, and it's the classic ComfyUI dependency-conflict problem: everything shares one Python environment, so a mismatched xformers/torch pairing can break the import outright. Match the exact combo for your torch/CUDA build rather than assuming the README's example applies to you.

Nothing happens for a long time on first run. That's almost certainly the HuggingFace weight download, not a hang - ComfyUI doesn't always surface a clear progress indicator for it.

Support is thin if something breaks. The repo hasn't been pushed to since August 2024 and carries 15 open issues, so this is very much a snapshot-in-time tool rather than an actively maintained one. It still works - it's just not getting fixes.

CategoryAIFSH_MimicMotion

Inputs (11)

NameTypeDefaultDescription
ref_imageIMAGE
ref_video_pathVIDEO
resolutionCOMBO5762 options: 576, 768
sample_strideINT2
tile_sizeINT16
tile_overlapINT6
decode_chunk_sizeINT8
num_inference_stepsINT25
guidance_scaleFLOAT2.00
fpsINT15
seedINT42

Outputs (1)

NameTypeDescription
VIDEOVIDEO