clementchadebec
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -63,6 +63,9 @@ FlashSDXL can also be combined with existing LoRAs to unlock few steps generatio
|
|
63 |
from diffusers import DiffusionPipeline, LCMScheduler
|
64 |
import torch
|
65 |
|
|
|
|
|
|
|
66 |
flash_lora_id = "jasperai/flash-sdxl"
|
67 |
|
68 |
# Load Pipeline
|
@@ -78,14 +81,18 @@ pipe.scheduler = LCMScheduler.from_config(
|
|
78 |
|
79 |
# Load LoRAs
|
80 |
pipe.load_lora_weights(flash_lora_id, adapter_name="flash")
|
81 |
-
pipe.load_lora_weights(
|
82 |
|
83 |
-
pipe.set_adapters(["flash", "
|
84 |
pipe.to(device="cuda", dtype=torch.float16)
|
85 |
|
86 |
-
prompt = "
|
87 |
|
88 |
-
image = pipe(
|
|
|
|
|
|
|
|
|
89 |
```
|
90 |
<p align="center">
|
91 |
<img style="width:400px;" src="images/corgi.jpg">
|
|
|
63 |
from diffusers import DiffusionPipeline, LCMScheduler
|
64 |
import torch
|
65 |
|
66 |
+
user_lora_id = "TheLastBen/Papercut_SDXL"
|
67 |
+
trigger_word = "papercut"
|
68 |
+
|
69 |
flash_lora_id = "jasperai/flash-sdxl"
|
70 |
|
71 |
# Load Pipeline
|
|
|
81 |
|
82 |
# Load LoRAs
|
83 |
pipe.load_lora_weights(flash_lora_id, adapter_name="flash")
|
84 |
+
pipe.load_lora_weights(user_lora_id, adapter_name="lora")
|
85 |
|
86 |
+
pipe.set_adapters(["flash", "lora"], adapter_weights=[1.0, 1.0])
|
87 |
pipe.to(device="cuda", dtype=torch.float16)
|
88 |
|
89 |
+
prompt = f"{trigger_word} a cute corgi"
|
90 |
|
91 |
+
image = pipe(
|
92 |
+
prompt,
|
93 |
+
num_inference_steps=4,
|
94 |
+
guidance_scale=0
|
95 |
+
).images[0]
|
96 |
```
|
97 |
<p align="center">
|
98 |
<img style="width:400px;" src="images/corgi.jpg">
|