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).images[0]

image.save("astronaut_rides_horse.png")

Image-to-Image text-guided generation with Stable Diffusion
	
The StableDiffusionImg2ImgPipeline lets you pass a text prompt and an initial image to condition the generation of new images.


	Copied
import requests
from