Unverified Commit 536684eb authored by Ilia Larchenko's avatar Ilia Larchenko Committed by GitHub
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.
parent 384c83aa
...@@ -61,7 +61,7 @@ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5") ...@@ -61,7 +61,7 @@ pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipe = pipe.to("cuda") pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars" 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") image.save("astronaut_rides_horse.png")
``` ```
...@@ -80,7 +80,7 @@ pipe = StableDiffusionPipeline.from_pretrained( ...@@ -80,7 +80,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
).to("cuda") ).to("cuda")
prompt = "a photo of an astronaut riding a horse on mars" 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") image.save("astronaut_rides_horse.png")
``` ```
...@@ -99,7 +99,7 @@ pipe = StableDiffusionPipeline.from_pretrained( ...@@ -99,7 +99,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
).to("cuda") ).to("cuda")
prompt = "a photo of an astronaut riding a horse on mars" 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") image.save("astronaut_rides_horse.png")
``` ```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment