Skip to content

Commit 78445b4

Browse files
Add animate diff (#174)
1 parent 2180a08 commit 78445b4

File tree

14 files changed

+937
-4
lines changed

14 files changed

+937
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) Alibaba, Inc. and its affiliates.
2+
3+
from swift.llm.run import animatediff_infer_main
4+
5+
if __name__ == '__main__':
6+
animatediff_infer_main()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) Alibaba, Inc. and its affiliates.
2+
3+
from swift.llm.run import animatediff_main
4+
5+
if __name__ == '__main__':
6+
animatediff_main()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Experimental environment: A100
2+
# 18GB GPU memory
3+
PYTHONPATH=../../.. \
4+
CUDA_VISIBLE_DEVICES=0 \
5+
python animatediff_infer.py \
6+
--model_id_or_path wyj123456/Realistic_Vision_V5.1_noVAE \
7+
--sft_type full \
8+
--ckpt_dir /output/path/like/checkpoints/iter-xxx \
9+
--eval_human true \
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Experimental environment: A100 * 4
2+
# 200GB GPU memory totally
3+
PYTHONPATH=../../.. \
4+
CUDA_VISIBLE_DEVICES=0,1,2,3 \
5+
torchrun --nproc_per_node=4 animatediff_sft.py \
6+
--model_id_or_path wyj123456/Realistic_Vision_V5.1_noVAE \
7+
--csv_path /mnt/workspace/yzhao/tastelikefeet/webvid/results_2M_train.csv \
8+
--video_folder /mnt/workspace/yzhao/tastelikefeet/webvid/videos2 \
9+
--sft_type full \
10+
--lr_scheduler_type constant \
11+
--trainable_modules .*motion_modules.* \
12+
--batch_size 4 \
13+
--eval_steps 100 \
14+
--gradient_accumulation_steps 16 \
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Experimental environment: A100
2+
# 18GB GPU memory
3+
PYTHONPATH=../../.. \
4+
CUDA_VISIBLE_DEVICES=0 \
5+
python animatediff_infer.py \
6+
--model_id_or_path wyj123456/Realistic_Vision_V5.1_noVAE \
7+
--motion_adapter_id_or_path Shanghai_AI_Laboratory/animatediff-motion-adapter-v1-5-2 \
8+
--sft_type lora \
9+
--ckpt_dir /output/path/like/checkpoints/iter-xxx \
10+
--eval_human true \
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Experimental environment: A100
2+
# 20GB GPU memory
3+
PYTHONPATH=../../.. \
4+
CUDA_VISIBLE_DEVICES=0 \
5+
python animatediff_sft.py \
6+
--model_id_or_path wyj123456/Realistic_Vision_V5.1_noVAE \
7+
--csv_path /mnt/workspace/yzhao/tastelikefeet/webvid/results_2M_train.csv \
8+
--video_folder /mnt/workspace/yzhao/tastelikefeet/webvid/videos2 \
9+
--motion_adapter_id_or_path Shanghai_AI_Laboratory/animatediff-motion-adapter-v1-5-2 \
10+
--sft_type lora \
11+
--lr_scheduler_type constant \
12+
--trainable_modules .*motion_modules.* \
13+
--batch_size 1 \
14+
--eval_steps 200 \
15+
--dataset_sample_size 10000 \
16+
--gradient_accumulation_steps 16 \

swift/llm/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Copyright (c) Alibaba, Inc. and its affiliates.
2+
from .animatediff import animatediff_sft
3+
from .animatediff_infer import animatediff_infer
24
from .infer import llm_infer, merge_lora, prepare_model_template
35
from .rome import rome_infer
46
from .sft import llm_sft

0 commit comments

Comments
 (0)