ComfyUI-DragAnything

ComfyUI-DragAnything
★ 72

视频生成轨迹驱动遮罩控制预训练模型
ComfyUI 节点,实现 DragAnything,通过轨迹与遮罩精确驱动目标对象的画面运动生成视频/帧,需满足列表长度与尺寸为64的倍数等约束,依赖预训练模型。
💡 用轨迹与遮罩驱动生成目标对象移动的视频或帧序列。
🍴 7 Forks💻 Python🔄 2024-06-14
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/2df45d172dc1
📦 requirements.txt
accelerate>=0.25.0
certifi>=2023.11.17
charset-normalizer>=3.3.2
cmake>=3.28.1
contourpy>=1.1.1
cycler>=0.12.1
decord>=0.6.0
diffusers==0.19.3
docopt>=0.6.2
einops>=0.7.0
ffmpeg>=1.4
filelock>=3.13.1
fonttools>=4.47.2
fsspec>=2023.12.2
huggingface-hub>=0.20.1
idna>=3.6
imageio>=2.33.1
importlib-metadata>=7.0.1
importlib-resources>=6.1.1
Jinja2>=3.1.2
kiwisolver>=1.4.5
lit>=17.0.6
MarkupSafe>=2.1.3
matplotlib>=3.7.4
mpmath>=1.3.0
mypy-extensions>=1.0.0
networkx>=3.1
numpy>=1.24.4
opencv-python>=4.8.1.78
packaging>=23.2
Pillow>=10.1.0
pipreqs>=0.4.13
psutil>=5.9.7
pyparsing>=3.1.1
pyre-extensions>=0.0.29
python-dateutil>=2.8.2
PyYAML>=6.0.1
regex>=2023.12.25
requests>=2.31.0
safetensors>=0.4.1
scipy>=1.10.1
segment-anything>=1.0
six>=1.16.0
sympy>=1.12
tokenizers>=0.15.0
tqdm>=4.66.1
transformers>=4.36.2
typing-inspect>=0.9.0
typing_extensions>=4.9.0
urllib3>=2.1.0
yarg>=0.1.9
zipp>=3.17.0
📄 README

ComfyUI DragAnything

Notice

mask_list length needs to be greater than or equal to trajectory_list length

trajectory_list length needs to be greater than or equal to frame_number

height and width must be multiples of 64

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

注意,如果不执行pip install -r requirements.txt进行安装,一定要执行pip install diffusers==0.19.3安装这个版本的diffusers

Basic workflow

https://github.com/chaojie/ComfyUI-DragAnything/blob/main/workflow.json

With ComfyUI-Trajectory

cd custom_nodes
git clone https://github.com/chaojie/ComfyUI-Trajectory.git

https://github.com/chaojie/ComfyUI-DragAnything/blob/main/workflow_traj.json

Cyclist workflow 无限长度视频生成

修改Max Time节点int_1为你想运行的时间,比如30,指30分钟

修改LayerMask: SegmentAnythingUltra V2节点prompt,指的是你想Drag的物体

打开ComfyUI Extra options

https://github.com/chaojie/ComfyUI-DragAnything/blob/main/wf_cyclist.json

Cyclist workflow+Ipadapter 无限长度视频生成+Ipadapter

https://github.com/chaojie/ComfyUI-DragAnything/blob/main/wf_cyclist_ipadapter.json

Cyclist final workflow

https://github.com/chaojie/ComfyUI-DragAnything/blob/main/wf_cyclist_final.json

DragAnything

DragAnything