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