comdoleger commited on
Commit
2e9ba84
·
verified ·
1 Parent(s): 77b2815

Upload config/examples/train_lora_qwen_image_edit_32gb.yaml with huggingface_hub

Browse files
config/examples/train_lora_qwen_image_edit_32gb.yaml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ job: extension
3
+ config:
4
+ # this name will be the folder and filename name
5
+ name: "my_first_qwen_image_edit_lora_v1"
6
+ process:
7
+ - type: 'sd_trainer'
8
+ # root folder to save training sessions/samples/weights
9
+ training_folder: "output"
10
+ # uncomment to see performance stats in the terminal every N steps
11
+ # performance_log_every: 1000
12
+ device: cuda:0
13
+ # if a trigger word is specified, it will be added to captions of training data if it does not already exist
14
+ # alternatively, in your captions you can add [trigger] and it will be replaced with the trigger word
15
+ # Trigger words will not work when caching text embeddings
16
+ # trigger_word: "p3r5on"
17
+ network:
18
+ type: "lora"
19
+ linear: 16
20
+ linear_alpha: 16
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. Only jpg, jpeg, and png are supported currently
28
+ # images will automatically be resized and bucketed into the resolution specified
29
+ # on windows, escape back slashes with another backslash so
30
+ # "C:\\path\\to\\images\\folder"
31
+ - folder_path: "/path/to/images/folder"
32
+ control_path: "/path/to/control/images/folder"
33
+ caption_ext: "txt"
34
+ # default_caption: "a person" # if caching text embeddings, if you don't have captions, this will get cached
35
+ caption_dropout_rate: 0.05 # will drop out the caption 5% of time
36
+ resolution: [ 512, 768, 1024 ] # qwen image enjoys multiple resolutions
37
+ train:
38
+ batch_size: 1
39
+ # caching text embeddings is required for 32GB
40
+ cache_text_embeddings: true
41
+
42
+ steps: 3000 # total number of steps to train 500 - 4000 is a good range
43
+ gradient_accumulation: 1
44
+ timestep_type: "weighted"
45
+ train_unet: true
46
+ train_text_encoder: false # probably won't work with qwen image
47
+ gradient_checkpointing: true # need the on unless you have a ton of vram
48
+ noise_scheduler: "flowmatch" # for training only
49
+ optimizer: "adamw8bit"
50
+ lr: 1e-4
51
+ # uncomment this to skip the pre training sample
52
+ # skip_first_sample: true
53
+ # uncomment to completely disable sampling
54
+ # disable_sampling: true
55
+ dtype: bf16
56
+ model:
57
+ # huggingface model name or path
58
+ name_or_path: "Qwen/Qwen-Image-Edit"
59
+ arch: "qwen_image_edit"
60
+ quantize: true
61
+ # qtype_te: "qfloat8" Default float8 qquantization
62
+ # to use the ARA use the | pipe to point to hf path, or a local path if you have one.
63
+ # 3bit is required for 32GB
64
+ qtype: "uint3|qwen_image_edit_torchao_uint3.safetensors"
65
+ quantize_te: true
66
+ qtype_te: "qfloat8"
67
+ low_vram: true
68
+ sample:
69
+ sampler: "flowmatch" # must match train.noise_scheduler
70
+ sample_every: 250 # sample every this many steps
71
+ width: 1024
72
+ height: 1024
73
+ samples:
74
+ - prompt: "do the thing to it"
75
+ ctrl_img: "/path/to/control/image.jpg"
76
+ - prompt: "do the thing to it"
77
+ ctrl_img: "/path/to/control/image.jpg"
78
+ - prompt: "do the thing to it"
79
+ ctrl_img: "/path/to/control/image.jpg"
80
+ - prompt: "do the thing to it"
81
+ ctrl_img: "/path/to/control/image.jpg"
82
+ - prompt: "do the thing to it"
83
+ ctrl_img: "/path/to/control/image.jpg"
84
+ - prompt: "do the thing to it"
85
+ ctrl_img: "/path/to/control/image.jpg"
86
+ - prompt: "do the thing to it"
87
+ ctrl_img: "/path/to/control/image.jpg"
88
+ - prompt: "do the thing to it"
89
+ ctrl_img: "/path/to/control/image.jpg"
90
+ - prompt: "do the thing to it"
91
+ ctrl_img: "/path/to/control/image.jpg"
92
+ - prompt: "do the thing to it"
93
+ ctrl_img: "/path/to/control/image.jpg"
94
+ neg: ""
95
+ seed: 42
96
+ walk_seed: true
97
+ guidance_scale: 3
98
+ sample_steps: 25
99
+ # you can add any additional meta info here. [name] is replaced with config name at top
100
+ meta:
101
+ name: "[name]"
102
+ version: '1.0'