radames commited on
Commit
92d8540
1 Parent(s): 026eb36

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -6
README.md CHANGED
@@ -24,24 +24,25 @@ from diffusers.utils import make_image_grid
24
  import torch
25
 
26
  pipe = DiffusionPipeline.from_pretrained(
27
- # "stabilityai/stable-diffusion-2-1", # or SD-2.1
28
- "stabilityai/sd-turbo", # or SD-TURBO
29
-
30
  torch_dtype=torch.float16, variant="fp16"
31
  )
32
- pipe.load_lora_weights("radames/dpo-lora-sd2.1", adapter_name="dpo-lora-sd21", weight_name="pytorch_lora_weights-10000.safetensors")
33
- pipe.to("cuda");
 
34
  prompt = "portrait headshot professional of elon musk"
35
  negative_prompt = "3d render, cartoon, drawing, art, low light"
 
36
  images = pipe(
37
  prompt=prompt,
38
  negative_prompt=negative_prompt,
39
  width=512,
40
  height=512,
41
  num_inference_steps=2,
 
42
  guidance_scale=1.0,
43
  num_images_per_prompt=4
44
  ).images
45
  make_image_grid(images, 1, 4)
46
-
47
  ```
 
24
  import torch
25
 
26
  pipe = DiffusionPipeline.from_pretrained(
27
+ "stabilityai/sd-turbo",
28
+ # "stabilityai/stable-diffusion-2-1",
 
29
  torch_dtype=torch.float16, variant="fp16"
30
  )
31
+ pipe.load_lora_weights("radames/dpo-lora-sd2.1")
32
+ seed = 123123
33
+ pipe.to("cuda")
34
  prompt = "portrait headshot professional of elon musk"
35
  negative_prompt = "3d render, cartoon, drawing, art, low light"
36
+ generator = torch.Generator().manual_seed(seed)
37
  images = pipe(
38
  prompt=prompt,
39
  negative_prompt=negative_prompt,
40
  width=512,
41
  height=512,
42
  num_inference_steps=2,
43
+ generator=generator,
44
  guidance_scale=1.0,
45
  num_images_per_prompt=4
46
  ).images
47
  make_image_grid(images, 1, 4)
 
48
  ```