Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,10 @@ pipeline = StableDiffusionPipeline.from_pretrained(
|
|
| 14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 15 |
pipeline.to(device)
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Generate an image
|
| 18 |
prompt = "A serene lake surrounded by mountains during sunset"
|
| 19 |
image = pipeline(prompt).images[0]
|
|
|
|
| 14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 15 |
pipeline.to(device)
|
| 16 |
|
| 17 |
+
# Reduce the image resolution for faster generation
|
| 18 |
+
pipeline.set_format("jpeg")
|
| 19 |
+
pipeline.set_resolution(512) # Reduce resolution (e.g., 512x512)
|
| 20 |
+
|
| 21 |
# Generate an image
|
| 22 |
prompt = "A serene lake surrounded by mountains during sunset"
|
| 23 |
image = pipeline(prompt).images[0]
|