You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-2Lines changed: 44 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ Inference of [Stable Diffusion](https://github.com/CompVis/stable-diffusion) in
18
18
- Original `txt2img` and `img2img` mode
19
19
- Negative prompt
20
20
-[stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) style tokenizer (not all the features, only token weighting for now)
21
+
- LoRA support, same as [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#lora)
22
+
- Latent Consistency Models support(LCM/LCM-LoRA)
21
23
- Sampling method
22
24
-`Euler A`
23
25
-`Euler`
@@ -42,7 +44,6 @@ Inference of [Stable Diffusion](https://github.com/CompVis/stable-diffusion) in
42
44
-[ ] Make inference faster
43
45
- The current implementation of ggml_conv_2d is slow and has high memory usage
44
46
-[ ] Continuing to reduce memory usage (quantizing the weights of ggml_conv_2d)
45
-
-[ ] LoRA support
46
47
-[ ] k-quants support
47
48
48
49
## Usage
@@ -125,6 +126,7 @@ arguments:
125
126
-t, --threads N number of threads to use during computation (default: -1).
126
127
If threads <= 0, then threads will be set to the number of CPU physical cores
127
128
-m, --model [MODEL] path to model
129
+
--lora-model-dir [DIR] lora model directory
128
130
-i, --init-img [IMAGE] path to the input image, required by img2img
129
131
-o, --output OUTPUT path to write result image to (default: .\output.png)
130
132
-p, --prompt [PROMPT] the prompt to render
@@ -134,11 +136,12 @@ arguments:
134
136
1.0 corresponds to full destruction of information in init image
135
137
-H, --height H image height, in pixel space (default: 512)
136
138
-W, --width W image width, in pixel space (default: 512)
# For example, python convert.py marblesh.safetensors
181
+
```
182
+
183
+
- You can specify the directory where the lora weights are stored via `--lora-model-dir`. If not specified, the default is the current working directory.
184
+
185
+
- LoRA is specified via prompt, just like [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#lora).
186
+
187
+
Here's a simple example:
188
+
189
+
```
190
+
./bin/sd -m ../models/v1-5-pruned-emaonly-ggml-model-f16.bin -p "a lovely cat<lora:marblesh:1>" --lora-model-dir ../models
191
+
```
192
+
193
+
`../models/marblesh-ggml-lora.bin` will be applied to the model
194
+
195
+
#### LCM/LCM-LoRA
196
+
197
+
- Download LCM-LoRA form https://huggingface.co/latent-consistency/lcm-lora-sdv1-5
198
+
- Specify LCM-LoRA by adding `<lora:lcm-lora-sdv1-5:1>` to prompt
199
+
- It's advisable to set `--cfg-scale` to `1.0` instead of the default `7.0`. For `--steps`, a range of `2-8` steps is recommended. For `--sampling-method`, `lcm`/`euler_a` is recommended.
0 commit comments