Nodes/ComfyUI-DragAnything/DragAnythingPipelineRun
ComfyUI Node

DragAnythingPipelineRun

DragAnything on a cached pipeline — stop reloading three models every run

By chaojie·Created 2 years ago·Updated 2 years ago· 72
DragAnythingPipelineRun
  • pipeline
  • image
  • mask_list
  • image
sd_pathchilloutmix
width576
height320
frame_number20
trajectory_list[[]]
num_inference_steps25
motion_bucket_id180
controlnet_cond_scale1.00
decode_chunk_size8

DragAnythingRun is the friendly all-in-one node, but it has a flaw: it loads Stable Video Diffusion, the DragAnything ControlNet, and the DIFT feature extractor from disk every single run. When you're iterating on a trajectory or testing five masks, that's minutes of loading between every test. DragAnythingPipelineRun fixes exactly that - it takes a preloaded DragAnythingPipeline and runs the same generation against it.

If you're going to run this more than twice in a session, this is the node you want.

What it changes

It's the same generation code as DragAnythingRun - same mask handling, same trajectory parsing, same per-frame Gaussian heatmaps pushing the motion entity through the SVD UNet. The only difference is where the models come from. Instead of pointing at model folders itself, this node takes a pipeline object from the pack's DragAnythingLoader node.

That loader is the pack's DragAnythingLoader (same "DragAnything" category in the node menu). It loads the SVD base and the DragAnything ControlNet once, and hands you a DragAnythingPipeline you feed into this node's pipeline input. Load once, iterate freely. The sd_path / DIFT side still loads per run, since chilloutmix's features are computed from your first frame each time - but that's the cheap part compared to the video UNet.

The inputs that matter

The field list is DragAnythingRun's minus the two model paths, plus pipeline:

  • pipeline - the DragAnythingPipeline from DragAnythingLoader. The only thing that connects here.
  • image - first frame.
  • mask_list - one mask per dragged entity, as an IMAGE batch.
  • trajectory_list - JSON string: [[[x0,y0],[x1,y1],...], ...], one path per mask, at least frame_number points.
  • frame_number (20), width/height (576×320, multiples of 64), num_inference_steps (25), motion_bucket_id (180), controlnet_cond_scale (1.0), decode_chunk_size (8) - all the same dials, same defaults as the all-in-one node.

Output is an IMAGE batch of frame_number frames → straight into VHS_VideoCombine for the actual video file.

Installing

Same pack, same requirements as the sibling nodes - Manager search "ComfyUI-DragAnything" or git clone https://github.com/chaojie/ComfyUI-DragAnything into custom_nodes/. The heavy part is models, downloaded into the pack's pretrained_models/ folder (the path is hardcoded, don't relocate them):

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

Don't skip pip install -r requirements.txt - or at minimum pip install diffusers==0.19.3, because the pack pins that version and other custom nodes may have opinions about it.

Troubleshooting

  • The DragAnythingPipeline input has no matching output - you need the DragAnythingLoader node from this same pack wired in. There's no other source for that type.
  • "Missing Node Types" on load usually means the pack collided on its bundled SaveText/LoadText nodes (with ComfyUI-nodes-hnmr or similar) and failed to load. Resolve the conflict and fully restart ComfyUI.
  • The usual DragAnything rules still apply: width/height multiples of 64, mask_list count ≥ trajectory count, each trajectory ≥ frame_number.
  • Watch for the diffusers==0.19.3 pin breaking other nodes after install - if the pack works but something else exploded, that's the first thing to suspect.

If you're only doing a single shot, DragAnythingRun is simpler. The moment you're tuning, the loader-plus-this-node pair pays for itself in reloads you never sit through.

CategoryDragAnything

Inputs (12)

NameTypeDefaultDescription
pipelineDragAnythingPipeline
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