DragAnythingRunRandom
No trajectory? Let DragAnything take your subject on a random walk
- image
- mask_list
- image
The core DragAnything workflow needs you to hand over a trajectory_list - a JSON path of per-frame coordinates. Drawing that by hand is fiddly, and if you're just trying to see whether the pack works at all, it's a wall of setup before your first result. DragAnythingRunRandom skips the trajectory entirely: you give it a mask, and it invents the motion for you.
This node is the same all-in-one generator as DragAnythingRun (loads SVD, the DragAnything ControlNet, and the chilloutmix DIFT extractor itself), except it builds the trajectory out of thin air. Here's the mechanism: for each mask, it finds the mask's centroid, then for every frame it nudges that point by a random amount in each axis. The resulting random-walk path is fed through the exact same pipeline - DIFT identity embedding, per-frame Gaussian heatmaps, ControlNet-guided SVD - as if you'd typed it in. Every queue gives you a different motion, which is the point.
The inputs that matter
Same core as the manual node - 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 - plus the two knobs that replace trajectory_list:
move_speed(5) - the max pixel jitter per frame, in either axis. Small = slow, gentle drifting; large = wild, frantic motion.move_border(20) - keeps the centroid from wandering within 20px of the image edges. Raise it if subjects keep bumping into the frame sides.
There is no trajectory input here, and you can't predict where it'll go - that's the trade for zero setup. The random path is always generated to be frame_number long, so the README's "trajectory must be at least as long as frame_number" rule is satisfied for you automatically. Output is an IMAGE batch of frame_number frames → VHS_VideoCombine to save.
Installing
Same pack as the rest: ComfyUI Manager → "ComfyUI-DragAnything", or git clone https://github.com/chaojie/ComfyUI-DragAnything into custom_nodes/, then pip install -r requirements.txt (or at least pip install diffusers==0.19.3 - that version pin is non-negotiable here). Models go in the pack's hardcoded pretrained_models/ folder:
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
Troubleshooting
- "Missing Node Types" after install → the pack's bundled
SaveText/LoadTextnodes are colliding with another pack (the standard offender is ComfyUI-nodes-hnmr). Clear the conflict, restart ComfyUI fully. - Motion never stays on the subject → since there's no real trajectory, a high
move_speedwill visibly wander; drop it to 2–3 and keepcontrolnet_cond_scaleat 1.0. - Slow runs are expected - the pipeline uses CPU offload, so keep
frame_numberlow while experimenting. - The
diffusers==0.19.3pin can break unrelated custom nodes after install; that's the first thing to check if the pack works but others don't.
Use this node to prove the pack runs and to brainstorm what motion looks good; once you find a direction you like, grab the real thing - swap to DragAnythingRun and hand it the actual path.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| svd_path | COMBO | stable-video-diffusion-img2vid | 1 options: pretrained_models.txt |
| draganything_path | COMBO | DragAnything | 1 options: pretrained_models.txt |
| sd_path | COMBO | chilloutmix | 1 options: pretrained_models.txt |
| image | IMAGE | — | |
| width | INT | 576 | — |
| height | INT | 320 | — |
| frame_number | INT | 20 | — |
| mask_list | IMAGE | — | |
| num_inference_steps | INT | 25 | — |
| motion_bucket_id | INT | 180 | — |
| controlnet_cond_scale | FLOAT | 1.00 | — |
| decode_chunk_size | INT | 8 | — |
| move_speed | INT | 5 | — |
| move_border | INT | 20 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |