Nodes/ComfyUI-DragAnything/DragAnythingRun
ComfyUI Node

DragAnythingRun

Drag anything in a video — mask it, plot a path, hit run

By chaojie·Created 2 years ago·Updated 2 years ago· 72
DragAnythingRun
  • image
  • mask_list
  • image
svd_pathstable-video-diffusion-img2vid
draganything_pathDragAnything
sd_pathchilloutmix
width576
height320
frame_number20
trajectory_list[[]]
num_inference_steps25
motion_bucket_id180
controlnet_cond_scale1.00
decode_chunk_size8

This is the node to reach for when you want one specific thing in a still image to move along a path you drew, while everything else stays put - a car driving across a junction, a bird gliding, a person walking. No prompt like "car drives right," no hoping the model invents motion. You mask the thing, give it a trajectory, and DragAnythingRun animates exactly that entity.

It's the flagship node of chaojie's ComfyUI-DragAnything pack, a ComfyUI port of Show Lab's DragAnything (AAAI 2025). This node is the all-in-one path: it loads every model it needs itself, so you can build a working graph from just LoadImage, this node, and a video saver. It's the one in the pack's reference workflow.json.

How it works

DragAnything's trick is calling the thing you drag a "motion entity" instead of a point. The first frame runs through a frozen SD1.5 checkpoint (chilloutmix, which the pack downloads for this purpose) to pull DIFT diffusion features out of your masked region. Those features become an identity embedding - the model knows what object it's moving, not just where a cursor point is. Your trajectory becomes a per-frame Gaussian heatmap showing where the entity should be, and a DragAnything ControlNet wired into Stable Video Diffusion's UNet pushes the entity along that path. ControlNet plus SVD, aimed at motion instead of structure.

The inputs that matter

Most defaults are fine. The ones you actually set:

  • image - your first frame, any IMAGE.
  • mask_list - one mask per thing you want to drag, passed as an IMAGE batch (each item in the batch is one mask). Feed it from a segmentation/grounding node or a plain LoadImage of a black-and-white mask.
  • trajectory_list - a JSON string, not a list widget: [[[x0,y0],[x1,y1],...], ...], one nested list per mask with at least frame_number points. Coordinates are in the original image's pixels; they get rescaled internally.
  • frame_number (20) - clip length. Your trajectory has to be at least this long.
  • width / height (576×320) - must be multiples of 64. This is a low-res model; pushing far past the defaults is where results start falling apart, which is the pack's most common complaint.
  • motion_bucket_id (180) - SVD's native "how much motion is allowed" dial. Lower it if the scene looks too fidgety, raise it for drama.
  • controlnet_cond_scale (1.0) - strength of the DragAnything control. If your entity drifts off-path, drop toward 0.5.
  • decode_chunk_size (8) - how many frames are decoded per chunk; raise to 16+ if you have VRAM to spare.

num_inference_steps (25) and sd_path (chilloutmix) you can usually leave alone - sd_path is the DIFT feature extractor, not the renderer.

The output

A single IMAGE batch of frame_number frames. Wire it into VHS_VideoCombine (VideoHelperSuite) to get an actual mp4 or gif - the reference workflow also uses ImageBatch up front to shape things.

Installing it (the real way)

ComfyUI Manager → search "ComfyUI-DragAnything", or clone manually. Either way, the model downloads are the actual install:

pip install -r requirements.txt

cd custom_nodes/ComfyUI-DragAnything/pretrained_models
git-lfs clone https://huggingface.co/windwhinny/chilloutmix.git
git-lfs clone https://huggingface.co/weijiawu/DragAnything
git-lfs clone https://huggingface.co/stabilityai/stable-video-diffusion-img2vid

That's 10+ GB across three repos, and they have to land in that exact folder - the node hardcodes pretrained_models/. Two gotchas. First, the pack pins diffusers==0.19.3; if you skip requirements.txt, at minimum run pip install diffusers==0.19.3, and be aware that pin can fight other custom nodes wanting a newer diffusers. Second, the pack defines its own SaveText/LoadText nodes, which collide with packs like ComfyUI-nodes-hnmr - Manager flags it as "Conflicted Nodes" and it can block the pack loading.

Troubleshooting

  • "Missing Node Types: DragAnythingRun" after install - the pack didn't actually load. Fix the SaveText conflict, then do a full ComfyUI restart.
  • README's length rules: mask_list count must be ≥ trajectory_list count, and each trajectory must be ≥ frame_number.
  • Width/height not multiples of 64 → hard error.
  • It's slow. The pipeline enables model CPU offload, so even a decent GPU grinds - that's why you test with a small frame_number.

One honest note: by 2026 standards the base SVD quality shows its age, and Wan-based workflows produce nicer video outright. But nothing in the modern stack does one entity, scripted trajectory, steady background this directly. That's the job this node exists for.

CategoryDragAnything

Inputs (13)

NameTypeDefaultDescription
svd_pathCOMBOstable-video-diffusion-img2vid1 options: pretrained_models.txt
draganything_pathCOMBODragAnything1 options: pretrained_models.txt
sd_pathCOMBOchilloutmix1 options: pretrained_models.txt
imageIMAGE
widthINT576
heightINT320
frame_numberINT20
mask_listIMAGE
trajectory_listSTRING[[]]
num_inference_stepsINT25
motion_bucket_idINT180
controlnet_cond_scaleFLOAT1.00
decode_chunk_sizeINT8

Outputs (1)

NameTypeDescription
imageIMAGE