File size: 408 Bytes
ee8a733
d278887
ee8a733
25cedca
 
d278887
 
25cedca
 
d278887
ee8a733
25cedca
ee8a733
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from diffusers import StableDiffusionPipeline
import torch

# Load the model from Hugging Face repo
pipeline = StableDiffusionPipeline.from_pretrained("Malik99999/MyModel")
pipeline.to("cuda" if torch.cuda.is_available() else "cpu")

# Generate an image from a prompt
prompt = "A beautiful landscape at sunset"
image = pipeline(prompt).images[0]

# Save the generated image
image.save("generated_image.png")