comdoleger commited on
Commit
38d7d2b
·
verified ·
1 Parent(s): 3d7b47d

Upload config/examples/train_lora_qwen_image_24gb.yaml with huggingface_hub

Browse files
config/examples/train_lora_qwen_image_24gb.yaml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ job: extension
3
+ config:
4
+ # this name will be the folder and filename name
5
+ name: "my_first_qwen_image_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
+ caption_ext: "txt"
33
+ # default_caption: "a person" # if caching text embeddings, if you dont have captions, this will get cached
34
+ caption_dropout_rate: 0.05 # will drop out the caption 5% of time
35
+ shuffle_tokens: false # shuffle caption order, split by commas
36
+ cache_latents_to_disk: true # leave this true unless you have a large dataset
37
+ # if you OOM, 1024 may be too much, but should work
38
+ resolution: [ 512, 768, 1024 ] # qwen image enjoys multiple resolutions
39
+ train:
40
+ batch_size: 1
41
+ # caching text embeddings is required for 24GB
42
+ cache_text_embeddings: true
43
+
44
+ steps: 2000 # total number of steps to train 500 - 4000 is a good range
45
+ gradient_accumulation: 1
46
+ train_unet: true
47
+ train_text_encoder: false # probably won't work with qwen image
48
+ gradient_checkpointing: true # need the on unless you have a ton of vram
49
+ noise_scheduler: "flowmatch" # for training only
50
+ optimizer: "adamw8bit"
51
+ lr: 1e-4
52
+ # uncomment this to skip the pre training sample
53
+ # skip_first_sample: true
54
+ # uncomment to completely disable sampling
55
+ # disable_sampling: true
56
+ dtype: bf16
57
+ model:
58
+ # huggingface model name or path
59
+ name_or_path: "Qwen/Qwen-Image"
60
+ arch: "qwen_image"
61
+ quantize: true
62
+ # qtype_te: "qfloat8" Default float8 qquantization
63
+ # to use the ARA use the | pipe to point to hf path, or a local path if you have one.
64
+ # 3bit is required for 24GB
65
+ qtype: "uint3|ostris/accuracy_recovery_adapters/qwen_image_torchao_uint3.safetensors"
66
+ quantize_te: true
67
+ qtype_te: "qfloat8"
68
+ low_vram: true
69
+ sample:
70
+ sampler: "flowmatch" # must match train.noise_scheduler
71
+ sample_every: 250 # sample every this many steps
72
+ width: 1024
73
+ height: 1024
74
+ prompts:
75
+ # you can add [trigger] to the prompts here and it will be replaced with the trigger word
76
+ # - "[trigger] holding a sign that says 'I LOVE PROMPTS!'"\
77
+ - "woman with red hair, playing chess at the park, bomb going off in the background"
78
+ - "a woman holding a coffee cup, in a beanie, sitting at a cafe"
79
+ - "a horse is a DJ at a night club, fish eye lens, smoke machine, lazer lights, holding a martini"
80
+ - "a man showing off his cool new t shirt at the beach, a shark is jumping out of the water in the background"
81
+ - "a bear building a log cabin in the snow covered mountains"
82
+ - "woman playing the guitar, on stage, singing a song, laser lights, punk rocker"
83
+ - "hipster man with a beard, building a chair, in a wood shop"
84
+ - "photo of a man, white background, medium shot, modeling clothing, studio lighting, white backdrop"
85
+ - "a man holding a sign that says, 'this is a sign'"
86
+ - "a bulldog, in a post apocalyptic world, with a shotgun, in a leather jacket, in a desert, with a motorcycle"
87
+ neg: ""
88
+ seed: 42
89
+ walk_seed: true
90
+ guidance_scale: 3
91
+ sample_steps: 25
92
+ # you can add any additional meta info here. [name] is replaced with config name at top
93
+ meta:
94
+ name: "[name]"
95
+ version: '1.0'