Skip to content

Commit 536684e

Browse files
Changed sample[0] to images[0] (#3304)
A pipeline object stores the results in `images` not in `sample`. Current code blocks don't work.
1 parent 384c83a commit 536684e

File tree

1 file changed

+3
-3
lines changed
  • src/diffusers/pipelines/stable_diffusion

1 file changed

+3
-3
lines changed

src/diffusers/pipelines/stable_diffusion/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
6161
pipe = pipe.to("cuda")
6262

6363
prompt = "a photo of an astronaut riding a horse on mars"
64-
image = pipe(prompt).sample[0]
64+
image = pipe(prompt).images[0]
6565

6666
image.save("astronaut_rides_horse.png")
6767
```
@@ -80,7 +80,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
8080
).to("cuda")
8181

8282
prompt = "a photo of an astronaut riding a horse on mars"
83-
image = pipe(prompt).sample[0]
83+
image = pipe(prompt).images[0]
8484

8585
image.save("astronaut_rides_horse.png")
8686
```
@@ -99,7 +99,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
9999
).to("cuda")
100100

101101
prompt = "a photo of an astronaut riding a horse on mars"
102-
image = pipe(prompt).sample[0]
102+
image = pipe(prompt).images[0]
103103

104104
image.save("astronaut_rides_horse.png")
105105
```

0 commit comments

Comments
 (0)