Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,17 +22,17 @@ model_id = "LuyangZ/FloorAI"
|
|
| 22 |
|
| 23 |
# controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 24 |
# controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype="auto")
|
| 25 |
-
|
| 26 |
-
controlnet = ControlNetModel.from_pretrained(model_id, force_download=True)
|
| 27 |
|
| 28 |
controlnet.to(device)
|
| 29 |
-
|
| 30 |
|
| 31 |
|
| 32 |
-
|
| 33 |
# pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype="auto")
|
| 34 |
# pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
|
| 35 |
-
pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet)
|
| 36 |
pipeline.safety_checker = None
|
| 37 |
pipeline.requires_safety_checker = False
|
| 38 |
|
|
@@ -46,7 +46,7 @@ pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.conf
|
|
| 46 |
|
| 47 |
|
| 48 |
pipeline = pipeline.to(device)
|
| 49 |
-
|
| 50 |
|
| 51 |
|
| 52 |
|
|
|
|
| 22 |
|
| 23 |
# controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 24 |
# controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype="auto")
|
| 25 |
+
controlnet = ControlNetModel.from_pretrained(model_id, torch_dtype=torch.float32, force_download=True)
|
| 26 |
+
# controlnet = ControlNetModel.from_pretrained(model_id, force_download=True)
|
| 27 |
|
| 28 |
controlnet.to(device)
|
| 29 |
+
torch.cuda.empty_cache()
|
| 30 |
|
| 31 |
|
| 32 |
+
pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float32, force_download=True)
|
| 33 |
# pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype="auto")
|
| 34 |
# pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
|
| 35 |
+
# pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet)
|
| 36 |
pipeline.safety_checker = None
|
| 37 |
pipeline.requires_safety_checker = False
|
| 38 |
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
pipeline = pipeline.to(device)
|
| 49 |
+
torch.cuda.empty_cache()
|
| 50 |
|
| 51 |
|
| 52 |
|