[v0] Remove V0 code (#621)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
|
||||
|
||||
def generate_merged_validation_json(input_dir, output_file):
|
||||
# read in video2caption.json
|
||||
with open(os.path.join(input_dir, "video2caption_replace.json"), "r") as f:
|
||||
video2caption = json.load(f)
|
||||
|
||||
# count how many elements are in the list
|
||||
num_elements = len(video2caption)
|
||||
print(f"Number of elements in video2caption.json: {num_elements}")
|
||||
|
||||
# randomly sample 64 elements from the list
|
||||
sampled_elements = random.sample(video2caption, 64)
|
||||
|
||||
# Transform sampled elements into validation.json format
|
||||
validation_data = []
|
||||
for element in sampled_elements:
|
||||
assert element.get("cap") is not None, f"Caption is None for element: {element}"
|
||||
validation_entry = {
|
||||
"caption": element["cap"],
|
||||
"video_path": element.get("path", ""),
|
||||
"num_inference_steps": 40,
|
||||
"height": 480,
|
||||
"width": 832,
|
||||
"num_frames": 77
|
||||
}
|
||||
validation_data.append(validation_entry)
|
||||
|
||||
# Create the final validation structure
|
||||
validation_json = {
|
||||
"data": validation_data
|
||||
}
|
||||
|
||||
# Write the validation JSON to the output file
|
||||
with open(output_file, "w") as f:
|
||||
json.dump(validation_json, f, indent=2)
|
||||
|
||||
print(f"Generated validation JSON with {len(validation_data)} entries and saved to {output_file}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
# dataset_type: "mixkit"
|
||||
parser.add_argument("--dataset_type", choices=["merged"], required=True)
|
||||
parser.add_argument("--input_dir", type=str, required=True)
|
||||
parser.add_argument("--output_file", type=str, required=True)
|
||||
parser.add_argument("--num_elements", type=int, default=64)
|
||||
parser.add_argument("--num_frames", type=int, default=77)
|
||||
parser.add_argument("--height", type=int, default=480)
|
||||
parser.add_argument("--width", type=int, default=832)
|
||||
parser.add_argument("--num_inference_steps", type=int, default=40)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.dataset_type == "merged":
|
||||
generate_merged_validation_json(args.input_dir, args.output_file)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,87 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
DATA_DIR=./data
|
||||
IP=[MASTER NODE IP]
|
||||
|
||||
torchrun --nnodes 4 --nproc_per_node 8\
|
||||
--node_rank=0 \
|
||||
--rdzv_id=456 \
|
||||
--rdzv_backend=c10d \
|
||||
--rdzv_endpoint=$IP:29500 \
|
||||
fastvideo/distill.py\
|
||||
--seed 42\
|
||||
--pretrained_model_name_or_path $DATA_DIR/hunyuan\
|
||||
--dit_model_name_or_path $DATA_DIR/hunyuan/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt\
|
||||
--model_type "hunyuan" \
|
||||
--cache_dir "$DATA_DIR/.cache"\
|
||||
--data_json_path "$DATA_DIR/HD-Mixkit-Finetune-Hunyuan/videos2caption.json"\
|
||||
--validation_prompt_dir "$DATA_DIR/HD-Mixkit-Finetune-Hunyuan/validation"\
|
||||
--gradient_checkpointing\
|
||||
--train_batch_size=1\
|
||||
--num_latent_t 32 \
|
||||
--sp_size 2 \
|
||||
--train_sp_batch_size 1\
|
||||
--dataloader_num_workers 4\
|
||||
--gradient_accumulation_steps=1\
|
||||
--max_train_steps=320\
|
||||
--learning_rate=1e-6\
|
||||
--mixed_precision="bf16"\
|
||||
--checkpointing_steps=64\
|
||||
--validation_steps 64\
|
||||
--validation_sampling_steps "2,4,8" \
|
||||
--checkpoints_total_limit 3\
|
||||
--allow_tf32\
|
||||
--ema_start_step 0\
|
||||
--cfg 0.0\
|
||||
--log_validation\
|
||||
--output_dir="$DATA_DIR/outputs/hy_phase1_shift17_bs_16_HD"\
|
||||
--tracker_project_name Hunyuan_Distill \
|
||||
--num_height 720 \
|
||||
--num_width 1280 \
|
||||
--num_frames 125 \
|
||||
--shift 17 \
|
||||
--validation_guidance_scale "1.0" \
|
||||
--num_euler_timesteps 50 \
|
||||
--multi_phased_distill_schedule "4000-1" \
|
||||
--not_apply_cfg_solver
|
||||
|
||||
|
||||
# If you do not have 32 GPUs and to fit in memory, you can: 1. increase sp_size. 2. reduce num_latent_t
|
||||
torchrun --nnodes 1 --nproc_per_node 8\
|
||||
fastvideo/distill.py\
|
||||
--seed 42\
|
||||
--pretrained_model_name_or_path $DATA_DIR/hunyuan\
|
||||
--dit_model_name_or_path $DATA_DIR/hunyuan/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt\
|
||||
--model_type "hunyuan" \
|
||||
--cache_dir "$DATA_DIR/.cache"\
|
||||
--data_json_path "$DATA_DIR/HD-Mixkit-Finetune-Hunyuan/videos2caption.json"\
|
||||
--validation_prompt_dir "$DATA_DIR/HD-Mixkit-Finetune-Hunyuan/validation"\
|
||||
--gradient_checkpointing\
|
||||
--train_batch_size=1\
|
||||
--num_latent_t 32 \
|
||||
--sp_size 2 \
|
||||
--train_sp_batch_size 1\
|
||||
--dataloader_num_workers 4\
|
||||
--gradient_accumulation_steps=1\
|
||||
--max_train_steps=320\
|
||||
--learning_rate=1e-6\
|
||||
--mixed_precision="bf16"\
|
||||
--checkpointing_steps=64\
|
||||
--validation_steps 64\
|
||||
--validation_sampling_steps "2,4,8" \
|
||||
--checkpoints_total_limit 3\
|
||||
--allow_tf32\
|
||||
--ema_start_step 0\
|
||||
--cfg 0.0\
|
||||
--log_validation\
|
||||
--output_dir="$DATA_DIR/outputs/hy_phase1_shift17_bs_16_HD"\
|
||||
--tracker_project_name Hunyuan_Distill \
|
||||
--num_height 720 \
|
||||
--num_width 1280 \
|
||||
--num_frames 125 \
|
||||
--shift 17 \
|
||||
--validation_guidance_scale "1.0" \
|
||||
--num_euler_timesteps 50 \
|
||||
--multi_phased_distill_schedule "4000-1" \
|
||||
--not_apply_cfg_solver
|
||||
@@ -1,38 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
torchrun --nnodes 1 --nproc_per_node 4 \
|
||||
fastvideo/distill.py \
|
||||
--seed 42 \
|
||||
--pretrained_model_name_or_path data/mochi \
|
||||
--model_type "mochi" \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Merge-30k-Data/video2caption.json \
|
||||
--validation_prompt_dir data/Image-Vid-Finetune-Mochi/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size=1 \
|
||||
--num_latent_t 28 \
|
||||
--sp_size 4 \
|
||||
--train_sp_batch_size 2 \
|
||||
--dataloader_num_workers 4 \
|
||||
--gradient_accumulation_steps=1 \
|
||||
--max_train_steps=4000 \
|
||||
--learning_rate=1e-6 \
|
||||
--mixed_precision=bf16 \
|
||||
--checkpointing_steps=64 \
|
||||
--validation_steps 1 \
|
||||
--validation_sampling_steps 8 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--log_validation \
|
||||
--output_dir="data/outputs/lq_euler_50_thres0.1_lrg_0.75_phase1_lr1e-6_repro" \
|
||||
--tracker_project_name PCM \
|
||||
--num_frames 163 \
|
||||
--scheduler_type pcm_linear_quadratic \
|
||||
--validation_guidance_scale 0.5,1.5,2.5 \
|
||||
--num_euler_timesteps 50 \
|
||||
--linear_quadratic_threshold 0.1 \
|
||||
--linear_range 0.75 \
|
||||
--multi_phased_distill_schedule 4000-1
|
||||
@@ -1,39 +0,0 @@
|
||||
#https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B-Diffusers/tree/main
|
||||
DATA_DIR=./data
|
||||
|
||||
torchrun --nnodes 1 --nproc_per_node 8\
|
||||
fastvideo/distill.py\
|
||||
--seed 42\
|
||||
--pretrained_model_name_or_path $DATA_DIR/wan\
|
||||
--model_type "wan" \
|
||||
--cache_dir "$DATA_DIR/.cache"\
|
||||
--data_json_path "$DATA_DIR/Image-Vid-Finetune-Wan/videos2caption.json"\
|
||||
--validation_prompt_dir "$DATA_DIR/Image-Vid-Finetune-Wan/validation"\
|
||||
--gradient_checkpointing\
|
||||
--train_batch_size=1\
|
||||
--num_latent_t 32 \
|
||||
--sp_size 1 \
|
||||
--train_sp_batch_size 1\
|
||||
--dataloader_num_workers 4\
|
||||
--gradient_accumulation_steps=1\
|
||||
--max_train_steps=320\
|
||||
--learning_rate=1e-6\
|
||||
--mixed_precision="bf16"\
|
||||
--checkpointing_steps=64\
|
||||
--validation_steps 64\
|
||||
--validation_sampling_steps "8" \
|
||||
--checkpoints_total_limit 3\
|
||||
--allow_tf32\
|
||||
--ema_start_step 0\
|
||||
--cfg 5.0\
|
||||
--log_validation\
|
||||
--output_dir="$DATA_DIR/outputs/wan"\
|
||||
--tracker_project_name Wan_PCM \
|
||||
--num_height 480 \
|
||||
--num_width 832 \
|
||||
--num_frames 81 \
|
||||
--shift 3 \
|
||||
--validation_guidance_scale "1.0" \
|
||||
--num_euler_timesteps 50 \
|
||||
--multi_phased_distill_schedule "4000-1" \
|
||||
--not_apply_cfg_solver
|
||||
@@ -1,38 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
torchrun --nnodes 1 --nproc_per_node 8 \
|
||||
fastvideo/train.py \
|
||||
--seed 42 \
|
||||
--pretrained_model_name_or_path data/hunyuan \
|
||||
--dit_model_name_or_path data/hunyuan/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt\
|
||||
--model_type "hunyuan" \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Image-Vid-Finetune-HunYuan/videos2caption.json \
|
||||
--validation_prompt_dir data/Image-Vid-Finetune-HunYuan/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size=1 \
|
||||
--num_latent_t 32 \
|
||||
--sp_size 4 \
|
||||
--train_sp_batch_size 1 \
|
||||
--dataloader_num_workers 4 \
|
||||
--gradient_accumulation_steps=1 \
|
||||
--max_train_steps=2000 \
|
||||
--learning_rate=1e-5 \
|
||||
--mixed_precision=bf16 \
|
||||
--checkpointing_steps=200 \
|
||||
--validation_steps 100 \
|
||||
--validation_sampling_steps 50 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--ema_decay 0.999 \
|
||||
--log_validation \
|
||||
--output_dir=data/outputs/HSH-Taylor-Finetune-Hunyuan \
|
||||
--tracker_project_name HSH-Taylor-Finetune-Hunyuan \
|
||||
--num_frames 125 \
|
||||
--num_height 720 \
|
||||
--num_width 1280 \
|
||||
--shift 7 \
|
||||
--validation_guidance_scale "1.0" \
|
||||
@@ -1,37 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
torchrun --nnodes 1 --nproc_per_node 4 --master_port 29903 \
|
||||
fastvideo/train.py \
|
||||
--seed 1024 \
|
||||
--pretrained_model_name_or_path data/hunyuan_diffusers \
|
||||
--model_type hunyuan_hf \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Black-Myth-Wukong/videos2caption.json \
|
||||
--validation_prompt_dir data/Black-Myth-Wukong/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size 1 \
|
||||
--num_latent_t 32 \
|
||||
--sp_size 4 \
|
||||
--train_sp_batch_size 1 \
|
||||
--dataloader_num_workers 4 \
|
||||
--gradient_accumulation_steps 4 \
|
||||
--max_train_steps 6000 \
|
||||
--learning_rate 8e-5 \
|
||||
--mixed_precision bf16 \
|
||||
--checkpointing_steps 500 \
|
||||
--validation_steps 100 \
|
||||
--validation_sampling_steps 50 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--ema_decay 0.999 \
|
||||
--log_validation \
|
||||
--output_dir data/outputs/Hunyuan-lora-finetuning-Black-Myth-Wukong \
|
||||
--tracker_project_name Hunyuan-lora-finetuning-Black-Myth-Wukong \
|
||||
--num_frames 125 \
|
||||
--validation_guidance_scale "1.0" \
|
||||
--shift 7 \
|
||||
--use_lora \
|
||||
--lora_rank 32 \
|
||||
--lora_alpha 32
|
||||
@@ -1,32 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
torchrun --nnodes 1 --nproc_per_node 4 \
|
||||
fastvideo/train.py \
|
||||
--seed 42 \
|
||||
--pretrained_model_name_or_path data/mochi \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Mochi-Black-Myth/videos2caption.json \
|
||||
--validation_prompt_dir data/Mochi-Black-Myth/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size=1 \
|
||||
--num_latent_t 16 \
|
||||
--sp_size 1 \
|
||||
--train_sp_batch_size 1 \
|
||||
--dataloader_num_workers 4 \
|
||||
--gradient_accumulation_steps=1 \
|
||||
--max_train_steps=2000 \
|
||||
--learning_rate=5e-6 \
|
||||
--mixed_precision=bf16 \
|
||||
--checkpointing_steps=200 \
|
||||
--validation_steps 100 \
|
||||
--validation_sampling_steps 64 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--ema_decay 0.999 \
|
||||
--log_validation \
|
||||
--output_dir=data/outputs/Black-Myth-Finetune \
|
||||
--tracker_project_name Black-Myth-Finetune \
|
||||
--num_frames 93
|
||||
@@ -1,37 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
torchrun --nnodes 1 --nproc_per_node 2 \
|
||||
fastvideo/train.py \
|
||||
--seed 42 \
|
||||
--pretrained_model_name_or_path data/mochi \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Mochi-Black-Myth/videos2caption.json \
|
||||
--validation_prompt_dir data/Mochi-Black-Myth/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size 1 \
|
||||
--num_latent_t 14 \
|
||||
--sp_size 2 \
|
||||
--train_sp_batch_size 1 \
|
||||
--dataloader_num_workers 1 \
|
||||
--gradient_accumulation_steps 2 \
|
||||
--max_train_steps 2000 \
|
||||
--learning_rate 5e-6 \
|
||||
--mixed_precision bf16 \
|
||||
--checkpointing_steps 200 \
|
||||
--validation_steps 100 \
|
||||
--validation_sampling_steps 64 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--ema_decay 0.999 \
|
||||
--log_validation \
|
||||
--output_dir=data/outputs/Black-Myth-Lora-FT \
|
||||
--tracker_project_name Black-Myth-Lora-Finetune \
|
||||
--num_frames 91 \
|
||||
--lora_rank 128 \
|
||||
--lora_alpha 256 \
|
||||
--master_weight_type "bf16" \
|
||||
--use_lora \
|
||||
--use_cpu_offload
|
||||
@@ -1,37 +0,0 @@
|
||||
export WANDB_BASE_URL="https://api.wandb.ai"
|
||||
export WANDB_MODE=online
|
||||
|
||||
CUDA_VISIBLE_DEVICES=5 torchrun --nnodes 1 --nproc_per_node 1 \
|
||||
fastvideo/train.py \
|
||||
--seed 42 \
|
||||
--pretrained_model_name_or_path data/mochi \
|
||||
--cache_dir data/.cache \
|
||||
--data_json_path data/Image-Vid-Finetune-Mochi/videos2caption.json \
|
||||
--validation_prompt_dir data/Image-Vid-Finetune-Mochi/validation \
|
||||
--gradient_checkpointing \
|
||||
--train_batch_size=1 \
|
||||
--num_latent_t 14 \
|
||||
--sp_size 1 \
|
||||
--train_sp_batch_size 1 \
|
||||
--dataloader_num_workers 1 \
|
||||
--gradient_accumulation_steps=1 \
|
||||
--max_train_steps=2000 \
|
||||
--learning_rate=5e-6 \
|
||||
--mixed_precision=bf16 \
|
||||
--checkpointing_steps=200 \
|
||||
--validation_steps 100 \
|
||||
--validation_sampling_steps 64 \
|
||||
--checkpoints_total_limit 3 \
|
||||
--allow_tf32 \
|
||||
--ema_start_step 0 \
|
||||
--cfg 0.0 \
|
||||
--ema_decay 0.999 \
|
||||
--log_validation \
|
||||
--output_dir=data/outputs/HSH-Taylor-Finetune-Lora \
|
||||
--tracker_project_name HSH-Taylor-Finetune-Lora \
|
||||
--num_frames 91 \
|
||||
--group_frame \
|
||||
--lora_rank 128 \
|
||||
--lora_alpha 256 \
|
||||
--master_weight_type "bf16" \
|
||||
--use_lora
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
num_gpus=4
|
||||
export MODEL_BASE=data/FastHunyuan
|
||||
torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29503 \
|
||||
fastvideo/sample/sample_t2v_hunyuan.py \
|
||||
--height 720 \
|
||||
--width 1280 \
|
||||
--num_frames 125 \
|
||||
--num_inference_steps 6 \
|
||||
--guidance_scale 1 \
|
||||
--embedded_cfg_scale 6 \
|
||||
--flow_shift 17 \
|
||||
--flow-reverse \
|
||||
--prompt ./assets/prompt.txt \
|
||||
--seed 1024 \
|
||||
--output_path outputs_video/hunyuan/vae_sp/ \
|
||||
--model_path $MODEL_BASE \
|
||||
--dit-weight ${MODEL_BASE}/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt \
|
||||
--vae-sp
|
||||
|
||||
# Inference original Hunyuan
|
||||
num_gpus=4
|
||||
export MODEL_BASE=data/hunyuan
|
||||
torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29503 \
|
||||
fastvideo/sample/sample_t2v_hunyuan.py \
|
||||
--height 720 \
|
||||
--width 1280 \
|
||||
--num_frames 125 \
|
||||
--num_inference_steps 50 \
|
||||
--guidance_scale 1 \
|
||||
--embedded_cfg_scale 6 \
|
||||
--flow_shift 7 \
|
||||
--flow-reverse \
|
||||
--prompt ./assets/prompt.txt \
|
||||
--seed 1024 \
|
||||
--output_path outputs_video/hunyuan/vae_sp/ \
|
||||
--model_path $MODEL_BASE \
|
||||
--dit-weight ${MODEL_BASE}/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt \
|
||||
--vae-sp
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Inference with STA + Teacache
|
||||
num_gpus=1 # currently it should be a factor of 30
|
||||
mask_strategy_file_path=assets/mask_strategy_hunyuan.json
|
||||
export MODEL_BASE=data/hunyuan
|
||||
rel_l1_thresh=0.15
|
||||
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29603 \
|
||||
fastvideo/sample/sample_t2v_hunyuan_STA.py \
|
||||
--height 768 \
|
||||
--width 1280 \
|
||||
--num_frames 117 \
|
||||
--num_inference_steps 50 \
|
||||
--guidance_scale 1 \
|
||||
--embedded_cfg_scale 6 \
|
||||
--flow_shift 7 \
|
||||
--flow-reverse \
|
||||
--prompt ./assets/prompt.txt \
|
||||
--seed 12345 \
|
||||
--output_path outputs_video/hunyuan_STA/ \
|
||||
--model_path $MODEL_BASE \
|
||||
--mask_strategy_file_path $mask_strategy_file_path \
|
||||
--rel_l1_thresh $rel_l1_thresh \
|
||||
--dit-weight ${MODEL_BASE}/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt \
|
||||
--vae-sp \
|
||||
--enable_teacache
|
||||
|
||||
# Inference with STA only
|
||||
num_gpus=1
|
||||
mask_strategy_file_path=assets/mask_strategy_hunyuan.json
|
||||
export MODEL_BASE=data/hunyuan
|
||||
CUDA_VISIBLE_DEVICES=1 torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29603 \
|
||||
fastvideo/sample/sample_t2v_hunyuan_STA.py \
|
||||
--height 768 \
|
||||
--width 1280 \
|
||||
--num_frames 117 \
|
||||
--num_inference_steps 50 \
|
||||
--guidance_scale 1 \
|
||||
--embedded_cfg_scale 6 \
|
||||
--flow_shift 7 \
|
||||
--flow-reverse \
|
||||
--prompt ./assets/prompt.txt \
|
||||
--seed 12345 \
|
||||
--output_path outputs_video/hunyuan_STA/ \
|
||||
--model_path $MODEL_BASE \
|
||||
--mask_strategy_file_path $mask_strategy_file_path \
|
||||
--dit-weight ${MODEL_BASE}/hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt \
|
||||
--vae-sp \
|
||||
--enable_torch_compile
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
num_gpus=4
|
||||
torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29503 \
|
||||
fastvideo/sample/sample_t2v_hunyuan_hf.py \
|
||||
--model_path ~/data/hunyuan_diffusers/ \
|
||||
--prompt_path "assets/prompt.txt" \
|
||||
--num_frames 125 \
|
||||
--height 720 \
|
||||
--width 1280 \
|
||||
--num_inference_steps 50 \
|
||||
--output_path outputs_video/hunyuan_hf/ \
|
||||
--seed 1024 \
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
num_gpus=1
|
||||
export MODEL_BASE="data/FastHunyuan-diffusers"
|
||||
torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 12345 \
|
||||
fastvideo/sample/sample_t2v_hunyuan_hf.py \
|
||||
--height 720 \
|
||||
--width 1280 \
|
||||
--num_frames 45 \
|
||||
--num_inference_steps 6 \
|
||||
--guidance_scale 1 \
|
||||
--embedded_cfg_scale 6 \
|
||||
--flow_shift 17 \
|
||||
--prompt ./assets/prompt.txt \
|
||||
--seed 1024 \
|
||||
--output_path outputs_video/hunyuan_quant/nf4/ \
|
||||
--model_path $MODEL_BASE \
|
||||
--quantization "nf4" \
|
||||
--cpu_offload
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
num_gpus=4
|
||||
|
||||
torchrun --nnodes=1 --nproc_per_node=$num_gpus --master_port 29503 \
|
||||
fastvideo/sample/sample_t2v_mochi.py \
|
||||
--model_path data/FastMochi-diffusers \
|
||||
--prompt_path "assets/prompt.txt" \
|
||||
--num_frames 163 \
|
||||
--height 480 \
|
||||
--width 848 \
|
||||
--num_inference_steps 8 \
|
||||
--guidance_scale 1.5 \
|
||||
--output_path outputs_video/mochi_hf/ \
|
||||
--seed 1024 \
|
||||
--scheduler_type "pcm_linear_quadratic" \
|
||||
--linear_threshold 0.1 \
|
||||
--linear_range 0.75
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
# You better have two terminal, one for the remote server, and one for DiT
|
||||
CUDA_VISIBLE_DEVICES=7 python fastvideo/sample/call_remote_server_stepvideo.py --model_dir data/stepvideo-t2v/ &
|
||||
|
||||
parallel=4
|
||||
url='127.0.0.1'
|
||||
model_dir=data/stepvideo-t2v
|
||||
torchrun --nproc_per_node $parallel fastvideo/sample/sample_t2v_stepvideo.py \
|
||||
--model_dir $model_dir \
|
||||
--vae_url $url \
|
||||
--caption_url $url \
|
||||
--prompt assets/prompt.txt \
|
||||
--infer_steps 50 \
|
||||
--width 768 \
|
||||
--height 768 \
|
||||
--num_frames 204 \
|
||||
--cfg_scale 9.0 \
|
||||
--save_path outputs/ \
|
||||
--time_shift 13.0
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Inference with STA + Teacache
|
||||
# You better have two terminal, one for the remote server, and one for DiT
|
||||
# remove enable_teacache to disable Teacache
|
||||
CUDA_VISIBLE_DEVICES=7 python fastvideo/sample/call_remote_server_stepvideo.py --model_dir data/stepvideo-t2v/ &
|
||||
parallel=4
|
||||
url='127.0.0.1'
|
||||
model_dir=data/stepvideo-t2v
|
||||
mask_strategy_file_path=assets/mask_strategy_stepvideo.json
|
||||
rel_l1_thresh=0.23
|
||||
torchrun --nproc_per_node $parallel fastvideo/sample/sample_t2v_stepvideo_STA.py \
|
||||
--model_dir $model_dir \
|
||||
--vae_url $url \
|
||||
--caption_url $url \
|
||||
--prompt "A rocket blasting off from the launch pad, accelerating rapidly into the sky." \
|
||||
--infer_steps 50 \
|
||||
--width 768 \
|
||||
--height 768 \
|
||||
--num_frames 204 \
|
||||
--cfg_scale 9.0 \
|
||||
--save_path outputs/ \
|
||||
--time_shift 13.0 \
|
||||
--rel_l1_thresh $rel_l1_thresh \
|
||||
--enable_teacache \
|
||||
--mask_strategy_file_path $mask_strategy_file_path
|
||||
@@ -1,33 +0,0 @@
|
||||
# export WANDB_MODE="offline"
|
||||
GPU_NUM=1 # 2,4,8
|
||||
MODEL_PATH="data/hunyuan"
|
||||
MODEL_TYPE="hunyuan"
|
||||
DATA_MERGE_PATH="data/Image-Vid-Finetune-Src/merge.txt"
|
||||
OUTPUT_DIR="data/Image-Vid-Finetune-HunYuan"
|
||||
VALIDATION_PATH="assets/prompt.txt"
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_vae_latents.py \
|
||||
--model_path $MODEL_PATH \
|
||||
--data_merge_path $DATA_MERGE_PATH \
|
||||
--train_batch_size=1 \
|
||||
--max_height=480 \
|
||||
--max_width=848 \
|
||||
--num_frames=93 \
|
||||
--dataloader_num_workers 1 \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--model_type $MODEL_TYPE \
|
||||
--train_fps 24
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR
|
||||
|
||||
torchrun --nproc_per_node=1 \
|
||||
fastvideo/data_preprocess/preprocess_validation_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--validation_prompt_txt $VALIDATION_PATH
|
||||
@@ -1,33 +0,0 @@
|
||||
# export WANDB_MODE="offline"
|
||||
GPU_NUM=1 # 2,4,8
|
||||
MODEL_PATH="data/FastMochi-diffusers"
|
||||
MODEL_TYPE="mochi"
|
||||
DATA_MERGE_PATH="data/Image-Vid-Finetune-Src/merge.txt"
|
||||
OUTPUT_DIR="data/Image-Vid-Finetune-Mochi"
|
||||
VALIDATION_PATH="assets/prompt.txt"
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_vae_latents.py \
|
||||
--model_path $MODEL_PATH \
|
||||
--data_merge_path $DATA_MERGE_PATH \
|
||||
--train_batch_size=1 \
|
||||
--max_height=480 \
|
||||
--max_width=848 \
|
||||
--num_frames=93 \
|
||||
--dataloader_num_workers 1 \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--model_type $MODEL_TYPE \
|
||||
--train_fps 24
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR
|
||||
|
||||
torchrun --nproc_per_node=1 \
|
||||
fastvideo/data_preprocess/preprocess_validation_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--validation_prompt_txt $VALIDATION_PATH
|
||||
@@ -1,33 +0,0 @@
|
||||
# export WANDB_MODE="offline"
|
||||
GPU_NUM=1 # 2,4,8
|
||||
MODEL_PATH="data/wan-diffusers"
|
||||
MODEL_TYPE="wan"
|
||||
DATA_MERGE_PATH="data/Image-Vid-Finetune-Src/merge.txt"
|
||||
OUTPUT_DIR="data/Image-Vid-Finetune-Wan"
|
||||
VALIDATION_PATH="assets/prompt.txt"
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_vae_latents.py \
|
||||
--model_path $MODEL_PATH \
|
||||
--data_merge_path $DATA_MERGE_PATH \
|
||||
--train_batch_size=1 \
|
||||
--max_height=480 \
|
||||
--max_width=848 \
|
||||
--num_frames=81 \
|
||||
--dataloader_num_workers 1 \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--model_type $MODEL_TYPE \
|
||||
--train_fps 24
|
||||
|
||||
torchrun --nproc_per_node=$GPU_NUM \
|
||||
fastvideo/data_preprocess/preprocess_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR
|
||||
|
||||
torchrun --nproc_per_node=1 \
|
||||
fastvideo/data_preprocess/preprocess_validation_text_embeddings.py \
|
||||
--model_type $MODEL_TYPE \
|
||||
--model_path $MODEL_PATH \
|
||||
--output_dir=$OUTPUT_DIR \
|
||||
--validation_prompt_txt $VALIDATION_PATH
|
||||
Reference in New Issue
Block a user