1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Changed sample[0] to images[0] (#3304)

A pipeline object stores the results in `images` not in `sample`.
Current code blocks don't work.
This commit is contained in:
Ilia Larchenko
2023-05-01 20:33:51 +07:00
committed by GitHub
parent 384c83aa9a
commit 536684eb2f

View File

@@ -61,7 +61,7 @@ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).sample[0]
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
```
@@ -80,7 +80,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
).to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).sample[0]
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
```
@@ -99,7 +99,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
).to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).sample[0]
image = pipe(prompt).images[0]
image.save("astronaut_rides_horse.png")
```