akazmi commited on
Commit
da36322
·
verified ·
1 Parent(s): 95ba608

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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]