Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,9 @@ import gradio as gr
|
|
| 5 |
# Load model with CPU optimization
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 7 |
"CompVis/stable-diffusion-v1-4",
|
| 8 |
-
torch_dtype=torch.
|
| 9 |
)
|
|
|
|
| 10 |
pipe.to("cpu") # Ensure it's running on CPU
|
| 11 |
|
| 12 |
def generate_image(prompt):
|
|
@@ -22,4 +23,4 @@ demo = gr.Interface(
|
|
| 22 |
)
|
| 23 |
|
| 24 |
# Launch app
|
| 25 |
-
demo.launch()
|
|
|
|
| 5 |
# Load model with CPU optimization
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 7 |
"CompVis/stable-diffusion-v1-4",
|
| 8 |
+
torch_dtype=torch.float32 # Use float32 on CPU for compatibility
|
| 9 |
)
|
| 10 |
+
|
| 11 |
pipe.to("cpu") # Ensure it's running on CPU
|
| 12 |
|
| 13 |
def generate_image(prompt):
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Launch app
|
| 26 |
+
demo.launch()
|