comdoleger commited on
Commit
41d48f1
·
verified ·
1 Parent(s): af285fe

Upload config/examples/train_lora_wan22_14b_24gb.yaml with huggingface_hub

Browse files
config/examples/train_lora_wan22_14b_24gb.yaml ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # this example focuses mainly for training Wan2.2 14b on images. It will work for video as well by increasing
2
+ # the number of frames in the dataset and samples. Training on and generating video is very VRAM intensive.
3
+ ---
4
+ job: extension
5
+ config:
6
+ # this name will be the folder and filename name
7
+ name: "my_first_wan22_14b_lora_v1"
8
+ process:
9
+ - type: 'sd_trainer'
10
+ # root folder to save training sessions/samples/weights
11
+ training_folder: "output"
12
+ # uncomment to see performance stats in the terminal every N steps
13
+ # performance_log_every: 1000
14
+ device: cuda:0
15
+ # Use a trigger word if train.unload_text_encoder is true, however, if caching text embeddings, do not use a trigger word
16
+ # trigger_word: "p3r5on"
17
+ network:
18
+ type: "lora"
19
+ linear: 32
20
+ linear_alpha: 32
21
+ save:
22
+ dtype: float16 # precision to save
23
+ save_every: 250 # save every this many steps
24
+ max_step_saves_to_keep: 4 # how many intermittent saves to keep
25
+ datasets:
26
+ # datasets are a folder of images. captions need to be txt files with the same name as the image
27
+ # for instance image2.jpg and image2.txt.
28
+ # "C:\\path\\to\\images\\folder"
29
+ - folder_path: "/path/to/images/or/video/folder"
30
+ caption_ext: "txt"
31
+ caption_dropout_rate: 0.05 # will drop out the caption 5% of time
32
+ # number of frames to extract from your video. It will automatically extract them evenly spaced
33
+ # set to 1 frame for images
34
+ num_frames: 1
35
+ resolution: [ 512, 768, 1024]
36
+ train:
37
+ batch_size: 1
38
+ steps: 2000 # total number of steps to train 500 - 4000 is a good range
39
+ gradient_accumulation: 1
40
+ train_unet: true
41
+ train_text_encoder: false # probably won't work with wan
42
+ gradient_checkpointing: true # need the on unless you have a ton of vram
43
+ noise_scheduler: "flowmatch" # for training only
44
+ timestep_type: 'linear'
45
+ optimizer: "adamw8bit"
46
+ lr: 1e-4
47
+ optimizer_params:
48
+ weight_decay: 1e-4
49
+ # uncomment this to skip the pre training sample
50
+ # skip_first_sample: true
51
+ # uncomment to completely disable sampling
52
+ # disable_sampling: true
53
+ dtype: bf16
54
+
55
+ # IMPORTANT: this is for Wan 2.2 MOE. It will switch training one stage or the other every this many steps
56
+ switch_boundary_every: 10
57
+
58
+ # required for 24GB cards. You must do either unload_text_encoder or cache_text_embeddings but not both
59
+
60
+ # this will encode your trigger word and use those embeddings for every image in the dataset, captions will be ignored
61
+ # unload_text_encoder: true
62
+
63
+ # this will cache all captions in your dataset.
64
+ cache_text_embeddings: true
65
+
66
+ model:
67
+ # huggingface model name or path, this one if bf16, vs the float32 of the official repo
68
+ name_or_path: "ai-toolkit/Wan2.2-T2V-A14B-Diffusers-bf16"
69
+ arch: 'wan22_14b'
70
+ quantize: true
71
+ # This will pull and use a custom Accuracy Recovery Adapter to train at 4bit
72
+ qtype: "uint4|ostris/accuracy_recovery_adapters/wan22_14b_t2i_torchao_uint4.safetensors"
73
+ quantize_te: true
74
+ qtype_te: "qfloat8"
75
+ low_vram: true
76
+ model_kwargs:
77
+ # you can train high noise, low noise, or both. With low vram it will automatically unload the one not being trained.
78
+ train_high_noise: true
79
+ train_low_noise: true
80
+ sample:
81
+ sampler: "flowmatch"
82
+ sample_every: 250 # sample every this many steps
83
+ width: 1024
84
+ height: 1024
85
+ # set to 1 for images
86
+ num_frames: 1
87
+ fps: 16
88
+ # samples take a long time. so use them sparingly
89
+ # samples will be animated webp files, if you don't see them animated, open in a browser.
90
+ prompts:
91
+ # you can add [trigger] to the prompts here and it will be replaced with the trigger word
92
+ # - "[trigger] holding a sign that says 'I LOVE PROMPTS!'"\
93
+ - "woman with red hair, playing chess at the park, bomb going off in the background"
94
+ - "a woman holding a coffee cup, in a beanie, sitting at a cafe"
95
+ - "a horse is a DJ at a night club, fish eye lens, smoke machine, lazer lights, holding a martini"
96
+ - "a man showing off his cool new t shirt at the beach, a shark is jumping out of the water in the background"
97
+ - "a bear building a log cabin in the snow covered mountains"
98
+ - "woman playing the guitar, on stage, singing a song, laser lights, punk rocker"
99
+ - "hipster man with a beard, building a chair, in a wood shop"
100
+ - "photo of a man, white background, medium shot, modeling clothing, studio lighting, white backdrop"
101
+ - "a man holding a sign that says, 'this is a sign'"
102
+ - "a bulldog, in a post apocalyptic world, with a shotgun, in a leather jacket, in a desert, with a motorcycle"
103
+ neg: ""
104
+ seed: 42
105
+ walk_seed: true
106
+ guidance_scale: 3.5
107
+ sample_steps: 25
108
+ # you can add any additional meta info here. [name] is replaced with config name at top
109
+ meta:
110
+ name: "[name]"
111
+ version: '1.0'