Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,17 @@ import matplotlib.pyplot as plt
|
|
| 13 |
# Load the Stable Diffusion model for text-to-image generation and inpainting
|
| 14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 15 |
pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4").to(device)
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
DEFAULT_OBJ_FILE = "female.obj"
|
| 22 |
DEFAULT_GLB_FILE = "vroid_girl1.glb"
|
|
|
|
| 13 |
# Load the Stable Diffusion model for text-to-image generation and inpainting
|
| 14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 15 |
pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4").to(device)
|
| 16 |
+
|
| 17 |
+
# Adjusted to handle device compatibility
|
| 18 |
+
if device == "cuda":
|
| 19 |
+
pipeline_inpaint = StableDiffusionInpaintPipeline.from_pretrained(
|
| 20 |
+
"runwayml/stable-diffusion-inpainting",
|
| 21 |
+
torch_dtype=torch.float16
|
| 22 |
+
).to(device)
|
| 23 |
+
else:
|
| 24 |
+
pipeline_inpaint = StableDiffusionInpaintPipeline.from_pretrained(
|
| 25 |
+
"runwayml/stable-diffusion-inpainting"
|
| 26 |
+
).to(device)
|
| 27 |
|
| 28 |
DEFAULT_OBJ_FILE = "female.obj"
|
| 29 |
DEFAULT_GLB_FILE = "vroid_girl1.glb"
|