Junolovesnowboard commited on
Commit
fb1bbc4
·
verified ·
1 Parent(s): 82fde2d

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +174 -0
README.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: "black-forest-labs/FLUX.1-dev"
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
+ - lycoris
14
+ inference: true
15
+ widget:
16
+ - text: 'unconditional (blank prompt)'
17
+ parameters:
18
+ negative_prompt: 'blurry, cropped, ugly'
19
+ output:
20
+ url: ./assets/image_0_0.png
21
+ - text: 'A man called Wanglingguan, the head is a hand and there is wings at the back of the man'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ - text: 'A man called Wanglingguan, the head is a hand and there is wings at the back of the man'
27
+ parameters:
28
+ negative_prompt: 'blurry, cropped, ugly'
29
+ output:
30
+ url: ./assets/image_2_0.png
31
+ - text: 'A photo-realistic image of a cat'
32
+ parameters:
33
+ negative_prompt: 'blurry, cropped, ugly'
34
+ output:
35
+ url: ./assets/image_3_0.png
36
+ ---
37
+
38
+ # simpletuner-lora
39
+
40
+ This is a LyCORIS adapter derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
41
+
42
+
43
+ The main validation prompt used during training was:
44
+
45
+
46
+
47
+ ```
48
+ A photo-realistic image of a cat
49
+ ```
50
+
51
+ ## Validation settings
52
+ - CFG: `3.0`
53
+ - CFG Rescale: `0.0`
54
+ - Steps: `20`
55
+ - Sampler: `None`
56
+ - Seed: `42`
57
+ - Resolution: `1024x1024`
58
+
59
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
60
+
61
+ You can find some example images in the following gallery:
62
+
63
+
64
+ <Gallery />
65
+
66
+ The text encoder **was not** trained.
67
+ You may reuse the base model text encoder for inference.
68
+
69
+
70
+ ## Training settings
71
+
72
+ - Training epochs: 2
73
+ - Training steps: 500
74
+ - Learning rate: 0.0001
75
+ - Max grad norm: 1.0
76
+ - Effective batch size: 1
77
+ - Micro-batch size: 1
78
+ - Gradient accumulation steps: 1
79
+ - Number of GPUs: 1
80
+ - Prediction type: flow-matchingNone
81
+ - Rescaled betas zero SNR: False
82
+ - Optimizer: adamw_bf16
83
+ - Precision: Pure BF16
84
+ - Quantised: Yes: int8-quanto
85
+ - Xformers: Not used
86
+ - LyCORIS Config:
87
+ ```json
88
+ {
89
+ "algo": "lokr",
90
+ "multiplier": 1.0,
91
+ "linear_dim": 10000,
92
+ "linear_alpha": 1,
93
+ "factor": 16,
94
+ "apply_preset": {
95
+ "target_module": [
96
+ "Attention",
97
+ "FeedForward"
98
+ ],
99
+ "module_algo_map": {
100
+ "Attention": {
101
+ "factor": 16
102
+ },
103
+ "FeedForward": {
104
+ "factor": 8
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ ## Datasets
112
+
113
+ ### my-dataset-512
114
+ - Repeats: 10
115
+ - Total number of images: 4
116
+ - Total number of aspect buckets: 2
117
+ - Resolution: 0.262144 megapixels
118
+ - Cropped: False
119
+ - Crop style: None
120
+ - Crop aspect: None
121
+ ### my-dataset-1024
122
+ - Repeats: 10
123
+ - Total number of images: 4
124
+ - Total number of aspect buckets: 3
125
+ - Resolution: 1.048576 megapixels
126
+ - Cropped: False
127
+ - Crop style: None
128
+ - Crop aspect: None
129
+ ### my-dataset-512-crop
130
+ - Repeats: 10
131
+ - Total number of images: 4
132
+ - Total number of aspect buckets: 1
133
+ - Resolution: 0.262144 megapixels
134
+ - Cropped: True
135
+ - Crop style: random
136
+ - Crop aspect: square
137
+ ### my-dataset-1024-crop
138
+ - Repeats: 10
139
+ - Total number of images: 4
140
+ - Total number of aspect buckets: 1
141
+ - Resolution: 1.048576 megapixels
142
+ - Cropped: True
143
+ - Crop style: random
144
+ - Crop aspect: square
145
+
146
+
147
+ ## Inference
148
+
149
+
150
+ ```python
151
+ import torch
152
+ from diffusers import DiffusionPipeline
153
+ from lycoris import create_lycoris_from_weights
154
+
155
+ model_id = 'black-forest-labs/FLUX.1-dev'
156
+ adapter_id = 'pytorch_lora_weights.safetensors' # you will have to download this manually
157
+ lora_scale = 1.0
158
+ wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_id, pipeline.transformer)
159
+ wrapper.merge_to()
160
+
161
+ prompt = "A photo-realistic image of a cat"
162
+
163
+ pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
164
+ image = pipeline(
165
+ prompt=prompt,
166
+ num_inference_steps=20,
167
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
168
+ width=1024,
169
+ height=1024,
170
+ guidance_scale=3.0,
171
+ ).images[0]
172
+ image.save("output.png", format="PNG")
173
+ ```
174
+