davidrd123
commited on
Commit
•
52ae588
1
Parent(s):
e1a021e
Model card auto-generated by SimpleTuner
Browse files
README.md
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
- safe-for-work
|
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: 'p4t3ntm3ds, Elegant Victorian lady, Cordelia, holding a bottle of ''Dr. Worthington''s Miracle Elixir''. She stands in an ornate parlor. Text proclaims the elixir''s ability to cure all ailments and restore youth.'
|
22 |
+
parameters:
|
23 |
+
negative_prompt: 'blurry, cropped, ugly'
|
24 |
+
output:
|
25 |
+
url: ./assets/image_1_0.png
|
26 |
+
- text: 'p4t3ntm3ds, Muscular man, Reginald, flexing while surrounded by bottles of ''Hercules Strength Tonic''. Ornate border includes before-and-after vignettes. Bold text promises instant muscle growth.'
|
27 |
+
parameters:
|
28 |
+
negative_prompt: 'blurry, cropped, ugly'
|
29 |
+
output:
|
30 |
+
url: ./assets/image_2_0.png
|
31 |
+
- text: 'p4t3ntm3ds, Professor Thaddeus demonstrating ''Cerebral Enhancement Drops'' to attentive students. Blackboard filled with complex equations. Text boasts improved mental acuity and memory.'
|
32 |
+
parameters:
|
33 |
+
negative_prompt: 'blurry, cropped, ugly'
|
34 |
+
output:
|
35 |
+
url: ./assets/image_3_0.png
|
36 |
+
- text: 'p4t3ntm3ds, Socialite Genevieve applying ''Madame Rosaline''s Beauty Cream''. Mirror reflects her radiant complexion. Floral border surrounds testimonials from satisfied customers.'
|
37 |
+
parameters:
|
38 |
+
negative_prompt: 'blurry, cropped, ugly'
|
39 |
+
output:
|
40 |
+
url: ./assets/image_4_0.png
|
41 |
+
- text: 'p4t3ntm3ds, The Thompson family gathered around table with ''Vitality Biscuits'' box. Each family member exhibits a different benefit: strength, beauty, intelligence. Text explains unique formula.'
|
42 |
+
parameters:
|
43 |
+
negative_prompt: 'blurry, cropped, ugly'
|
44 |
+
output:
|
45 |
+
url: ./assets/image_5_0.png
|
46 |
+
- text: 'p4t3ntm3ds, Futuristic robot, Model X-29, holding ''Cyber Tonic 3000'' in art nouveau style laboratory. Text in LED display promises enhanced processing power and rust prevention.'
|
47 |
+
parameters:
|
48 |
+
negative_prompt: 'blurry, cropped, ugly'
|
49 |
+
output:
|
50 |
+
url: ./assets/image_6_0.png
|
51 |
+
- text: 'p4t3ntm3ds, Astronaut Zephyr planting flag advertising ''Cosmic Vigor Pills'' on lunar surface. Earth visible in background. Text claims protection against space radiation and zero-gravity fatigue.'
|
52 |
+
parameters:
|
53 |
+
negative_prompt: 'blurry, cropped, ugly'
|
54 |
+
output:
|
55 |
+
url: ./assets/image_7_0.png
|
56 |
+
- text: 'p4t3ntm3ds, Mermaid Princess Coral applying ''Sea Goddess Beauty Cream'' underwater. Fish swimming around ornate product name. Text promises scales as smooth as pearls.'
|
57 |
+
parameters:
|
58 |
+
negative_prompt: 'blurry, cropped, ugly'
|
59 |
+
output:
|
60 |
+
url: ./assets/image_8_0.png
|
61 |
+
- text: 'p4t3ntm3ds, Steampunk inventor Dr. Cogsworth showcasing ''Aether Energy Drops'' amidst gears and pipes. Victorian text font explains how it powers both man and machine.'
|
62 |
+
parameters:
|
63 |
+
negative_prompt: 'blurry, cropped, ugly'
|
64 |
+
output:
|
65 |
+
url: ./assets/image_9_0.png
|
66 |
+
- text: 'p4t3ntm3ds, Caveman Grog and cavewoman Uga drinking from pond filled with ''Prehistoric Vitality Water''. Friendly dinosaurs in background. Stone tablet text claims evolutionary advantages.'
|
67 |
+
parameters:
|
68 |
+
negative_prompt: 'blurry, cropped, ugly'
|
69 |
+
output:
|
70 |
+
url: ./assets/image_10_0.png
|
71 |
+
- text: 'p4t3ntm3ds, Dapper gentleman from 1890s, Phileas, and futuristic woman from 2090, Nova, toasting with ''Temporal Tonic''. Swirling time vortex in background. Text promises to cure past ailments and prevent future ones.'
|
72 |
+
parameters:
|
73 |
+
negative_prompt: 'blurry, cropped, ugly'
|
74 |
+
output:
|
75 |
+
url: ./assets/image_11_0.png
|
76 |
+
- text: 'p4t3ntm3ds, Alien being Zorblax demonstrating ''Universal Harmony Elixir'' to crowd of various Earth animals. Flying saucers in sky. Text claims to bridge the gap between all species.'
|
77 |
+
parameters:
|
78 |
+
negative_prompt: 'blurry, cropped, ugly'
|
79 |
+
output:
|
80 |
+
url: ./assets/image_12_0.png
|
81 |
+
---
|
82 |
+
|
83 |
+
# Flux-Patent-Medicines-LoKr
|
84 |
+
|
85 |
+
This is a LyCORIS adapter derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
|
86 |
+
|
87 |
+
|
88 |
+
No validation prompt was used during training.
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
None
|
94 |
+
|
95 |
+
|
96 |
+
## Validation settings
|
97 |
+
- CFG: `3.0`
|
98 |
+
- CFG Rescale: `0.0`
|
99 |
+
- Steps: `20`
|
100 |
+
- Sampler: `None`
|
101 |
+
- Seed: `42`
|
102 |
+
- Resolution: `1024x1024`
|
103 |
+
|
104 |
+
Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
|
105 |
+
|
106 |
+
You can find some example images in the following gallery:
|
107 |
+
|
108 |
+
|
109 |
+
<Gallery />
|
110 |
+
|
111 |
+
The text encoder **was not** trained.
|
112 |
+
You may reuse the base model text encoder for inference.
|
113 |
+
|
114 |
+
|
115 |
+
## Training settings
|
116 |
+
|
117 |
+
- Training epochs: 0
|
118 |
+
- Training steps: 200
|
119 |
+
- Learning rate: 0.0008
|
120 |
+
- Max grad norm: 2.0
|
121 |
+
- Effective batch size: 4
|
122 |
+
- Micro-batch size: 4
|
123 |
+
- Gradient accumulation steps: 1
|
124 |
+
- Number of GPUs: 1
|
125 |
+
- Prediction type: flow-matchingNone
|
126 |
+
- Rescaled betas zero SNR: False
|
127 |
+
- Optimizer: adamw_bf16
|
128 |
+
- Precision: Pure BF16
|
129 |
+
- Quantised: Yes: int8-quanto
|
130 |
+
- Xformers: Not used
|
131 |
+
- LyCORIS Config:
|
132 |
+
```json
|
133 |
+
{
|
134 |
+
"algo": "lokr",
|
135 |
+
"multiplier": 1.0,
|
136 |
+
"linear_dim": 10000,
|
137 |
+
"linear_alpha": 1,
|
138 |
+
"factor": 16,
|
139 |
+
"apply_preset": {
|
140 |
+
"target_module": [
|
141 |
+
"Attention",
|
142 |
+
"FeedForward"
|
143 |
+
],
|
144 |
+
"module_algo_map": {
|
145 |
+
"Attention": {
|
146 |
+
"factor": 16
|
147 |
+
},
|
148 |
+
"FeedForward": {
|
149 |
+
"factor": 8
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
```
|
155 |
+
|
156 |
+
## Datasets
|
157 |
+
|
158 |
+
### patent-meds-512
|
159 |
+
- Repeats: 17
|
160 |
+
- Total number of images: 83
|
161 |
+
- Total number of aspect buckets: 6
|
162 |
+
- Resolution: 0.262144 megapixels
|
163 |
+
- Cropped: False
|
164 |
+
- Crop style: None
|
165 |
+
- Crop aspect: None
|
166 |
+
### patent-meds-768
|
167 |
+
- Repeats: 17
|
168 |
+
- Total number of images: 83
|
169 |
+
- Total number of aspect buckets: 12
|
170 |
+
- Resolution: 0.589824 megapixels
|
171 |
+
- Cropped: False
|
172 |
+
- Crop style: None
|
173 |
+
- Crop aspect: None
|
174 |
+
### patent-meds-1024
|
175 |
+
- Repeats: 5
|
176 |
+
- Total number of images: 83
|
177 |
+
- Total number of aspect buckets: 1
|
178 |
+
- Resolution: 1.048576 megapixels
|
179 |
+
- Cropped: False
|
180 |
+
- Crop style: None
|
181 |
+
- Crop aspect: None
|
182 |
+
|
183 |
+
|
184 |
+
## Inference
|
185 |
+
|
186 |
+
|
187 |
+
```python
|
188 |
+
import torch
|
189 |
+
from diffusers import DiffusionPipeline
|
190 |
+
from lycoris import create_lycoris_from_weights
|
191 |
+
|
192 |
+
model_id = 'black-forest-labs/FLUX.1-dev'
|
193 |
+
adapter_id = 'pytorch_lora_weights.safetensors' # you will have to download this manually
|
194 |
+
lora_scale = 1.0
|
195 |
+
wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_id, pipeline.transformer)
|
196 |
+
wrapper.merge_to()
|
197 |
+
|
198 |
+
prompt = "An astronaut is riding a horse through the jungles of Thailand."
|
199 |
+
|
200 |
+
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
|
201 |
+
image = pipeline(
|
202 |
+
prompt=prompt,
|
203 |
+
num_inference_steps=20,
|
204 |
+
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
|
205 |
+
width=1024,
|
206 |
+
height=1024,
|
207 |
+
guidance_scale=3.0,
|
208 |
+
).images[0]
|
209 |
+
image.save("output.png", format="PNG")
|
210 |
+
```
|
211 |
+
|