-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathZ-Image.sh
More file actions
17 lines (16 loc) · 914 Bytes
/
Z-Image.sh
File metadata and controls
17 lines (16 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
modelscope download --dataset DiffSynth-Studio/diffsynth_example_dataset --include "z_image/Z-Image/*" --local_dir ./data/diffsynth_example_dataset
accelerate launch examples/z_image/model_training/train.py \
--dataset_base_path data/diffsynth_example_dataset/z_image/Z-Image \
--dataset_metadata_path data/diffsynth_example_dataset/z_image/Z-Image/metadata.csv \
--max_pixels 1048576 \
--dataset_repeat 50 \
--model_id_with_origin_paths "Tongyi-MAI/Z-Image:transformer/*.safetensors,Tongyi-MAI/Z-Image-Turbo:text_encoder/*.safetensors,Tongyi-MAI/Z-Image-Turbo:vae/diffusion_pytorch_model.safetensors" \
--learning_rate 1e-4 \
--num_epochs 5 \
--remove_prefix_in_ckpt "pipe.dit." \
--output_path "./models/train/Z-Image_lora" \
--lora_base_model "dit" \
--lora_target_modules "to_q,to_k,to_v,to_out.0,w1,w2,w3" \
--lora_rank 32 \
--use_gradient_checkpointing \
--dataset_num_workers 8