adhisetiawan
commited on
Commit
•
936b20c
1
Parent(s):
accdad9
Update README.md
Browse files
README.md
CHANGED
@@ -62,7 +62,28 @@ Weights for this model are available in Safetensors format.
|
|
62 |
#### How to use
|
63 |
|
64 |
```python
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
```
|
67 |
|
68 |
#### Limitations and bias
|
|
|
62 |
#### How to use
|
63 |
|
64 |
```python
|
65 |
+
import torch
|
66 |
+
from diffusers import DiffusionPipeline
|
67 |
+
|
68 |
+
# Load Stable Diffusion XL Base1.0
|
69 |
+
pipeline = DiffusionPipeline.from_pretrained(
|
70 |
+
"stabilityai/stable-diffusion-xl-base-1.0",
|
71 |
+
torch_dtype=torch.float16,
|
72 |
+
variant="fp16",
|
73 |
+
use_safetensors=True
|
74 |
+
).to("cuda")
|
75 |
+
|
76 |
+
# Optional CPU offloading to save some GPU Memory
|
77 |
+
pipeline.enable_model_cpu_offload()
|
78 |
+
|
79 |
+
# Loading Trained DreamBooth LoRA Weights
|
80 |
+
pipeline.load_lora_weights("adhisetiawan/sdxl-base-1.0-indonesian-food-dreambooth-lora")
|
81 |
+
|
82 |
+
images = pipeline(
|
83 |
+
"a delicous takoyaki in a plate", num_images_per_prompt=4, guidance_scale=8
|
84 |
+
)
|
85 |
+
for i in range(len(images.images)):
|
86 |
+
display(images.images[i])
|
87 |
```
|
88 |
|
89 |
#### Limitations and bias
|