Update README.md
Browse files
README.md
CHANGED
|
@@ -41,4 +41,33 @@ pipe.load_lora_weights("Mohan-diffuser/lora_platypus_sd_15")
|
|
| 41 |
|
| 42 |
prompt = "platypus"
|
| 43 |
image = pipe(prompt).images[0]
|
| 44 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
prompt = "platypus"
|
| 43 |
image = pipe(prompt).images[0]
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Varying The LoRA Scale
|
| 47 |
+
```python
|
| 48 |
+
import matplotlib.pyplot as plt
|
| 49 |
+
|
| 50 |
+
gen_images=[]
|
| 51 |
+
lora_scales = [0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4]
|
| 52 |
+
for lora_scale in lora_scales:
|
| 53 |
+
gen_image = pipeline(
|
| 54 |
+
prompt="platypus",
|
| 55 |
+
guidance_scale=7.5,
|
| 56 |
+
num_inference_steps=25,
|
| 57 |
+
height=512,
|
| 58 |
+
width=512,
|
| 59 |
+
cross_attention_kwargs={"scale": lora_scale},
|
| 60 |
+
clip_skip=2,
|
| 61 |
+
generator=torch.manual_seed(0)
|
| 62 |
+
).images[0]
|
| 63 |
+
|
| 64 |
+
gen_images.append(gen_image)
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
fig,axes = plt.subplots(1,8,figsize=(20,10))
|
| 68 |
+
for i,ax in enumerate(axes):
|
| 69 |
+
ax.imshow(gen_images[i])
|
| 70 |
+
ax.set_title(f"lora_scale: {lora_scales[i]}")
|
| 71 |
+
ax.axis('off')
|
| 72 |
+
plt.show()
|
| 73 |
+
```
|