lucasdellabella
commited on
Commit
•
a78c763
1
Parent(s):
b4c6f3a
Model card auto-generated by SimpleTuner
Browse files
README.md
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: creativeml-openrail-m
|
3 |
+
base_model: "stabilityai/stable-diffusion-xl-base-1.0"
|
4 |
+
tags:
|
5 |
+
- sdxl
|
6 |
+
- sdxl-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 |
+
|
16 |
+
---
|
17 |
+
|
18 |
+
# simpletuner-lora
|
19 |
+
|
20 |
+
This is a LyCORIS adapter derived from [stabilityai/stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0).
|
21 |
+
|
22 |
+
|
23 |
+
The main validation prompt used during training was:
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
```
|
28 |
+
a girl eating a sandwich, black hair
|
29 |
+
```
|
30 |
+
|
31 |
+
## Validation settings
|
32 |
+
- CFG: `4.2`
|
33 |
+
- CFG Rescale: `0.0`
|
34 |
+
- Steps: `20`
|
35 |
+
- Sampler: `None`
|
36 |
+
- Seed: `42`
|
37 |
+
- Resolution: `1024x1024`
|
38 |
+
|
39 |
+
Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
<Gallery />
|
45 |
+
|
46 |
+
The text encoder **was not** trained.
|
47 |
+
You may reuse the base model text encoder for inference.
|
48 |
+
|
49 |
+
|
50 |
+
## Training settings
|
51 |
+
|
52 |
+
- Training epochs: 1
|
53 |
+
- Training steps: 150
|
54 |
+
- Learning rate: 0.0001
|
55 |
+
- Effective batch size: 16
|
56 |
+
- Micro-batch size: 16
|
57 |
+
- Gradient accumulation steps: 1
|
58 |
+
- Number of GPUs: 1
|
59 |
+
- Prediction type: epsilon
|
60 |
+
- Rescaled betas zero SNR: False
|
61 |
+
- Optimizer: adamw_bf16
|
62 |
+
- Precision: Pure BF16
|
63 |
+
- Quantised: Yes: int8-quanto
|
64 |
+
- Xformers: Not used
|
65 |
+
- LyCORIS Config:
|
66 |
+
```json
|
67 |
+
{
|
68 |
+
"algo": "lora",
|
69 |
+
"multiplier": 1.0,
|
70 |
+
"linear_dim": 64,
|
71 |
+
"linear_alpha": 32,
|
72 |
+
"apply_preset": {
|
73 |
+
"target_module": [
|
74 |
+
"Attention",
|
75 |
+
"FeedForward"
|
76 |
+
],
|
77 |
+
"module_algo_map": {
|
78 |
+
"Attention": {
|
79 |
+
"factor": 16
|
80 |
+
},
|
81 |
+
"FeedForward": {
|
82 |
+
"factor": 8
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
```
|
88 |
+
|
89 |
+
## Datasets
|
90 |
+
|
91 |
+
### test-dataset-512
|
92 |
+
- Repeats: 10
|
93 |
+
- Total number of images: 26
|
94 |
+
- Total number of aspect buckets: 1
|
95 |
+
- Resolution: 0.262144 megapixels
|
96 |
+
- Cropped: False
|
97 |
+
- Crop style: None
|
98 |
+
- Crop aspect: None
|
99 |
+
### test-dataset-1024
|
100 |
+
- Repeats: 10
|
101 |
+
- Total number of images: 26
|
102 |
+
- Total number of aspect buckets: 1
|
103 |
+
- Resolution: 1.048576 megapixels
|
104 |
+
- Cropped: False
|
105 |
+
- Crop style: None
|
106 |
+
- Crop aspect: None
|
107 |
+
### test-dataset-512-crop
|
108 |
+
- Repeats: 10
|
109 |
+
- Total number of images: 26
|
110 |
+
- Total number of aspect buckets: 1
|
111 |
+
- Resolution: 0.262144 megapixels
|
112 |
+
- Cropped: True
|
113 |
+
- Crop style: random
|
114 |
+
- Crop aspect: square
|
115 |
+
### test-dataset-1024-crop
|
116 |
+
- Repeats: 10
|
117 |
+
- Total number of images: 26
|
118 |
+
- Total number of aspect buckets: 1
|
119 |
+
- Resolution: 1.048576 megapixels
|
120 |
+
- Cropped: True
|
121 |
+
- Crop style: random
|
122 |
+
- Crop aspect: square
|
123 |
+
|
124 |
+
|
125 |
+
## Inference
|
126 |
+
|
127 |
+
|
128 |
+
```python
|
129 |
+
import torch
|
130 |
+
from diffusers import DiffusionPipeline
|
131 |
+
from lycoris import create_lycoris_from_weights
|
132 |
+
|
133 |
+
model_id = 'stabilityai/stable-diffusion-xl-base-1.0'
|
134 |
+
adapter_id = 'pytorch_lora_weights.safetensors' # you will have to download this manually
|
135 |
+
lora_scale = 1.0
|
136 |
+
wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_id, pipeline.transformer)
|
137 |
+
wrapper.merge_to()
|
138 |
+
|
139 |
+
prompt = "a girl eating a sandwich, black hair"
|
140 |
+
negative_prompt = 'blurry, cropped, ugly'
|
141 |
+
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
|
142 |
+
image = pipeline(
|
143 |
+
prompt=prompt,
|
144 |
+
negative_prompt=negative_prompt,
|
145 |
+
num_inference_steps=20,
|
146 |
+
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
|
147 |
+
width=1024,
|
148 |
+
height=1024,
|
149 |
+
guidance_scale=4.2,
|
150 |
+
guidance_rescale=0.0,
|
151 |
+
).images[0]
|
152 |
+
image.save("output.png", format="PNG")
|
153 |
+
```
|
154 |
+
|