YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
import torch from diffusers import StableDiffusionPipeline
Load the Stable Diffusion model
model_id = "runwayml/stable-diffusion-v1-5" pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) pipe = pipe.to("cuda") def generate_image(prompt): with torch.no_grad(): image = pipe(prompt).images[0] return image
Example usage
prompt = "A fantasy landscape with mountains and a sunset" image = generate_image(prompt)
Save the generated image
image.save("generated_image.png")
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support