patrickvonplaten commited on
Commit
6f8cdb5
1 Parent(s): dfa8b92

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -43,17 +43,17 @@ pip install --upgrade git+https://github.com/huggingface/diffusers.git transform
43
  Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
44
 
45
  ```python
46
- from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
47
 
48
- model_id = "stabilityai/stable-diffusion-2"
49
 
50
  # Use the Euler scheduler here instead
51
- scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
52
- pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, revision="fp16", torch_dtype=torch.float16)
53
  pipe = pipe.to("cuda")
54
 
55
  prompt = "a photo of an astronaut riding a horse on mars"
56
- image = pipe(prompt, height=768, width=768).images[0]
57
 
58
  image.save("astronaut_rides_horse.png")
59
  ```
 
43
  Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
44
 
45
  ```python
46
+ from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
47
 
48
+ model_id = "stabilityai/stable-diffusion-2-1"
49
 
50
  # Use the Euler scheduler here instead
51
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
52
+ pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
53
  pipe = pipe.to("cuda")
54
 
55
  prompt = "a photo of an astronaut riding a horse on mars"
56
+ image = pipe(prompt).images[0]
57
 
58
  image.save("astronaut_rides_horse.png")
59
  ```