Change model precision to float32 for CPU compatibility
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from SegBody import segment_body # Import the segmentation function
|
|
| 10 |
# Check if CUDA is available and set the device accordingly
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 12 |
|
| 13 |
-
# Load models with correct precision
|
| 14 |
if device == "cuda":
|
| 15 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) # Use fp16 for GPU
|
| 16 |
pipeline = AutoPipelineForInpainting.from_pretrained(
|
|
|
|
| 10 |
# Check if CUDA is available and set the device accordingly
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 12 |
|
| 13 |
+
# Load models with the correct precision based on the device
|
| 14 |
if device == "cuda":
|
| 15 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16) # Use fp16 for GPU
|
| 16 |
pipeline = AutoPipelineForInpainting.from_pretrained(
|