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:
committed by
Daniel Gu
parent
08fbaaf579
commit
799015c19c
@@ -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")
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user