Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,13 @@ class StableBuddyApp:
|
|
| 37 |
else:
|
| 38 |
image = self.pipe(prompt, guidance_scale=8.5).images[0]
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Save the generated image temporarily
|
| 41 |
-
image_path = '
|
| 42 |
image.save(image_path)
|
| 43 |
|
| 44 |
return image_path # Return the image path for Gradio to display
|
|
|
|
| 37 |
else:
|
| 38 |
image = self.pipe(prompt, guidance_scale=8.5).images[0]
|
| 39 |
|
| 40 |
+
# Ensure the directory exists
|
| 41 |
+
output_dir = 'data'
|
| 42 |
+
if not os.path.exists(output_dir):
|
| 43 |
+
os.makedirs(output_dir)
|
| 44 |
+
|
| 45 |
# Save the generated image temporarily
|
| 46 |
+
image_path = os.path.join(output_dir, 'generated_image.png')
|
| 47 |
image.save(image_path)
|
| 48 |
|
| 49 |
return image_path # Return the image path for Gradio to display
|