Raphaël D
commited on
Commit
·
38f55f0
1
Parent(s):
0df7eec
Update README.md
Browse files
README.md
CHANGED
@@ -17,42 +17,4 @@ To use this Lora trained on Jean-Auguste-Dominique Ingres paintings with Stable
|
|
17 |
```
|
18 |
ingresstyles
|
19 |
```
|
20 |
-
inside your prompt.
|
21 |
-
LoRA for the text encoder was enabled: False.
|
22 |
-
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
23 |
-
## Usage
|
24 |
-
Make sure to upgrade diffusers to >= 0.19.0:
|
25 |
-
```
|
26 |
-
pip install diffusers --upgrade
|
27 |
-
```
|
28 |
-
In addition make sure to install transformers, safetensors, accelerate as well as the invisible watermark:
|
29 |
-
```
|
30 |
-
pip install invisible_watermark transformers accelerate safetensors
|
31 |
-
```
|
32 |
-
To just use the base model, you can run:
|
33 |
-
```python
|
34 |
-
import torch
|
35 |
-
from diffusers import DiffusionPipeline, AutoencoderKL
|
36 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
37 |
-
vae = AutoencoderKL.from_pretrained('madebyollin/sdxl-vae-fp16-fix', torch_dtype=torch.float16)
|
38 |
-
pipe = DiffusionPipeline.from_pretrained(
|
39 |
-
"stabilityai/stable-diffusion-xl-base-1.0",
|
40 |
-
vae=vae, torch_dtype=torch.float16, variant="fp16",
|
41 |
-
use_safetensors=True
|
42 |
-
)
|
43 |
-
pipe.to(device)
|
44 |
-
# This is where you load your trained weights
|
45 |
-
specific_safetensors = "pytorch_lora_weights.safetensors"
|
46 |
-
lora_scale = 0.9
|
47 |
-
pipe.load_lora_weights(
|
48 |
-
'Raf7801/ingresstyles',
|
49 |
-
weight_name = specific_safetensors,
|
50 |
-
# use_auth_token = True
|
51 |
-
)
|
52 |
-
prompt = "A majestic ingresstyles jumping from a big stone at night"
|
53 |
-
image = pipe(
|
54 |
-
prompt=prompt,
|
55 |
-
num_inference_steps=50,
|
56 |
-
cross_attention_kwargs={"scale": lora_scale}
|
57 |
-
).images[0]
|
58 |
-
```
|
|
|
17 |
```
|
18 |
ingresstyles
|
19 |
```
|
20 |
+
inside your prompt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|