radames commited on
Commit
5034861
1 Parent(s): e78bc50

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -15
README.md CHANGED
@@ -14,16 +14,10 @@ Base Model: https://huggingface.co/stabilityai/stable-diffusion-2-1
14
 
15
 
16
  ```python
17
- from diffusers import DiffusionPipeline
18
- from diffusers.utils import make_image_grid
19
- import torch
20
-
21
- pipe = DiffusionPipeline.from_pretrained(
22
- "stabilityai/sd-turbo",
23
- # "stabilityai/stable-diffusion-2-1",
24
- torch_dtype=torch.float16, variant="fp16"
25
- )
26
- pipe.load_lora_weights("stable-diffusion-2-1-DPO-LoRA")
27
  seed = 123123
28
  pipe.to("cuda")
29
  prompt = "portrait headshot professional of elon musk"
@@ -42,10 +36,13 @@ images = pipe(
42
  make_image_grid(images, 1, 4)
43
  ```
44
 
45
- ## Example
 
 
46
 
47
- Without DPO Lora
48
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/3o1UBMgrBTT5SFfgYFmaq.png)
 
 
 
49
 
50
- With DPO Lora
51
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/chu29lik7TVGEyVddWyqb.png)
 
14
 
15
 
16
  ```python
17
+
18
+ try:
19
+ pipe.load_lora_weights("radames/stable-diffusion-2-1-DPO-LoRA", adapter_name="dpo-lora-sd21")
20
+ pipe.set_adapters(["dpo-lora-sd21"], adapter_weights=[1.0]) # you can play with adapter_weights to increase the effect of the LoRA model
 
 
 
 
 
 
21
  seed = 123123
22
  pipe.to("cuda")
23
  prompt = "portrait headshot professional of elon musk"
 
36
  make_image_grid(images, 1, 4)
37
  ```
38
 
39
+ ## Examples
40
+
41
+ Left Withoud DPO right with DPO LoRA
42
 
43
+ <img src=https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/R8E0hRpWIE6OhhtvgJeEU.png style="max-width: 60rem;">
44
+ <img src=https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/Eg4LbyxCfhmsk2INzqODw.png style="max-width: 60rem;">
45
+ <img src=https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/GD7KumSCNweBWMJ1TArI-.png style="max-width: 60rem;">
46
+ <img src=https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/SO7QoA9lZJY9hI0U4fBLy.png style="max-width: 60rem;">
47
+ <img src=https://cdn-uploads.huggingface.co/production/uploads/6064e095abd8d3692e3e2ed6/ZWbQwIQ5OklEgF9RW581R.png style="max-width: 60rem;">
48