manbeast3b commited on
Commit
de0c2b5
·
verified ·
1 Parent(s): 09f9aa8

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +149 -0
README.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: "black-forest-labs/FLUX.1-schnell"
4
+ tags:
5
+ - flux
6
+ - flux-diffusers
7
+ - text-to-image
8
+ - diffusers
9
+ - simpletuner
10
+ - not-for-all-audiences
11
+ - lora
12
+ - template:sd-lora
13
+ - standard
14
+ inference: true
15
+ widget:
16
+ - text: 'unconditional (blank prompt)'
17
+ parameters:
18
+ negative_prompt: ''''
19
+ output:
20
+ url: ./assets/image_0_0.png
21
+ - text: 'A happy pizza.'
22
+ parameters:
23
+ negative_prompt: ''''
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ ---
27
+
28
+ # flux-lora-training
29
+
30
+ This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell).
31
+
32
+
33
+ The main validation prompt used during training was:
34
+ ```
35
+ A happy pizza.
36
+ ```
37
+
38
+
39
+ ## Validation settings
40
+ - CFG: `0.0`
41
+ - CFG Rescale: `0.0`
42
+ - Steps: `15`
43
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
44
+ - Seed: `42`
45
+ - Resolution: `1024x1024`
46
+ - Skip-layer guidance:
47
+
48
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
49
+
50
+ You can find some example images in the following gallery:
51
+
52
+
53
+ <Gallery />
54
+
55
+ The text encoder **was not** trained.
56
+ You may reuse the base model text encoder for inference.
57
+
58
+
59
+ ## Training settings
60
+
61
+ - Training epochs: 1
62
+ - Training steps: 25
63
+ - Learning rate: 0.0001
64
+ - Learning rate schedule: constant_with_warmup
65
+ - Warmup steps: 100
66
+ - Max grad norm: 1.0
67
+ - Effective batch size: 16
68
+ - Micro-batch size: 2
69
+ - Gradient accumulation steps: 8
70
+ - Number of GPUs: 1
71
+ - Gradient checkpointing: True
72
+ - Prediction type: flow-matching (extra parameters=['flux_fast_schedule', 'flux_schedule_auto_shift', 'shift=0.0', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all+ffs'])
73
+ - Optimizer: adamw_bf16
74
+ - Trainable parameter precision: Pure BF16
75
+ - Caption dropout probability: 0.0%
76
+
77
+
78
+ - LoRA Rank: 16
79
+ - LoRA Alpha: None
80
+ - LoRA Dropout: 0.1
81
+ - LoRA initialisation style: default
82
+
83
+
84
+ ## Datasets
85
+
86
+ ### default_dataset
87
+ - Repeats: 0
88
+ - Total number of images: 90
89
+ - Total number of aspect buckets: 1
90
+ - Resolution: 1.048576 megapixels
91
+ - Cropped: True
92
+ - Crop style: center
93
+ - Crop aspect: square
94
+ - Used for regularisation data: No
95
+ ### default_dataset_512
96
+ - Repeats: 0
97
+ - Total number of images: 90
98
+ - Total number of aspect buckets: 1
99
+ - Resolution: 0.262144 megapixels
100
+ - Cropped: True
101
+ - Crop style: center
102
+ - Crop aspect: square
103
+ - Used for regularisation data: No
104
+ ### default_dataset_768
105
+ - Repeats: 0
106
+ - Total number of images: 90
107
+ - Total number of aspect buckets: 1
108
+ - Resolution: 0.589824 megapixels
109
+ - Cropped: True
110
+ - Crop style: center
111
+ - Crop aspect: square
112
+ - Used for regularisation data: No
113
+
114
+
115
+ ## Inference
116
+
117
+
118
+ ```python
119
+ import torch
120
+ from diffusers import DiffusionPipeline
121
+
122
+ model_id = 'black-forest-labs/FLUX.1-schnell'
123
+ adapter_id = 'manbeast3b/flux-lora-training'
124
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
125
+ pipeline.load_lora_weights(adapter_id)
126
+
127
+ prompt = "A happy pizza."
128
+
129
+
130
+ ## Optional: quantise the model to save on vram.
131
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
132
+ from optimum.quanto import quantize, freeze, qint8
133
+ quantize(pipeline.transformer, weights=qint8)
134
+ freeze(pipeline.transformer)
135
+
136
+ pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
137
+ image = pipeline(
138
+ prompt=prompt,
139
+ num_inference_steps=15,
140
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
141
+ width=1024,
142
+ height=1024,
143
+ guidance_scale=0.0,
144
+ ).images[0]
145
+ image.save("output.png", format="PNG")
146
+ ```
147
+
148
+
149
+