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

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -2
README.md CHANGED
@@ -15,11 +15,19 @@ Base Model: https://huggingface.co/stabilityai/stable-diffusion-2-1
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"
24
  negative_prompt = "3d render, cartoon, drawing, art, low light"
25
  generator = torch.Generator().manual_seed(seed)
 
15
 
16
  ```python
17
 
18
+ from diffusers import DiffusionPipeline
19
+ from diffusers.utils import make_image_grid
20
+ import torch
21
+
22
+ pipe = DiffusionPipeline.from_pretrained(
23
+ "stabilityai/sd-turbo", # SD Turbo is a destilled version of Stable Diffusion 2.1
24
+ # "stabilityai/stable-diffusion-2-1", # for the original stable diffusion 2.1 model
25
+ torch_dtype=torch.float16, variant="fp16"
26
+ )
27
+ pipe.to("cuda")
28
  pipe.load_lora_weights("radames/stable-diffusion-2-1-DPO-LoRA", adapter_name="dpo-lora-sd21")
29
  pipe.set_adapters(["dpo-lora-sd21"], adapter_weights=[1.0]) # you can play with adapter_weights to increase the effect of the LoRA model
30
  seed = 123123
 
31
  prompt = "portrait headshot professional of elon musk"
32
  negative_prompt = "3d render, cartoon, drawing, art, low light"
33
  generator = torch.Generator().manual_seed(seed)