Nodes/ComfyUI-DragAnything/DragAnythingPipelineRunRandom
ComfyUI Node

DragAnythingPipelineRunRandom

The fastest way to preview DragAnything — random motion on a cached pipeline

By chaojie·Created 2 years ago·Updated 2 years ago· 72
DragAnythingPipelineRunRandom
  • pipeline
  • image
  • mask_list
  • image
sd_pathchilloutmix
width576
height320
frame_number20
num_inference_steps25
motion_bucket_id180
controlnet_cond_scale1.00
decode_chunk_size8
move_speed5
move_border20

If you've looked at this pack's four run nodes and felt the overlap, you're not wrong. DragAnythingPipelineRunRandom is the most specialized of the set: it's the random-walk generator with the cached-pipeline pattern, both at once. No trajectory to draw, no models reloading between attempts. It exists for one job - fast, throwaway motion previews - and it's honestly the best node in the pack for that.

How it fits

The pack gives you two ways to feed a generator: let it load everything itself (the DragAnythingRun* nodes) or take a preloaded DragAnythingPipeline from DragAnythingLoader (the DragAnythingPipelineRun* nodes). And two ways to specify motion: hand it a trajectory_list, or let it random-walk from your mask's centroid. This node is the intersection: pipeline input + generated trajectory.

The mechanism is the same under the hood as every node here. Each mask's centroid becomes a starting point; every frame the point jitters by a random amount (move_speed, default 5 pixels) clamped away from the edges (move_border, default 20px). That path drives the per-frame Gaussian heatmaps and the DragAnything ControlNet on Stable Video Diffusion, guided by the DIFT identity embedding pulled from your first frame via the chilloutmix checkpoint. You just don't get to choose the path - each run is a fresh roll of the dice, which is precisely what you want when the goal is "does this mask pick up the subject, and does the motion read?"

The inputs that matter

  • pipeline - the DragAnythingPipeline from DragAnythingLoader. Nothing else outputs this type.
  • image, mask_list (one mask per entity), frame_number, width/height (multiples of 64), num_inference_steps, motion_bucket_id, controlnet_cond_scale, decode_chunk_size - the standard DragAnything dials, defaults included.
  • move_speed (5) - max random step per frame per axis.
  • move_border (20) - how close the wandering centroid is allowed to get to the image edges.

Output is an IMAGE batch of frame_number frames; feed it to VHS_VideoCombine for a viewable file.

Installing

Same pack, same story as its siblings. Manager search "ComfyUI-DragAnything" or clone into custom_nodes/, then:

pip install -r requirements.txt   # or at minimum: pip install diffusers==0.19.3

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

Three repos, 10+ GB, hardcoded to that pretrained_models/ folder. Don't move them.

Troubleshooting

  • The pipeline input won't connect - you need the pack's DragAnythingLoader node feeding it. There is no other source of a DragAnythingPipeline.
  • "Missing Node Types" → the pack's own SaveText/LoadText nodes are fighting another pack (ComfyUI-nodes-hnmr is the usual culprit); clear it and restart.
  • Motion flies off the subject → cut move_speed to 2–3 and keep controlnet_cond_scale at 1.0.
  • If other custom nodes break after this install, the diffusers==0.19.3 pin is why.

Once a random run shows a motion you like, you can't recreate it exactly - the path is random each time. The intended flow is: preview here, then switch to DragAnythingPipelineRun (or the all-in-one DragAnythingRun) and draw the real trajectory to match what worked.

CategoryDragAnything

Inputs (13)

NameTypeDefaultDescription
pipelineDragAnythingPipeline
sd_pathCOMBOchilloutmix1 options: pretrained_models.txt
imageIMAGE
widthINT576
heightINT320
frame_numberINT20
mask_listIMAGE
num_inference_stepsINT25
motion_bucket_idINT180
controlnet_cond_scaleFLOAT1.00
decode_chunk_sizeINT8
move_speedINT5
move_borderINT20

Outputs (1)

NameTypeDescription
imageIMAGE