Open WangGosh opened 4 months ago
pytorch2.1.2tensorflow2.14.0-gpu-py310-cu121-ubuntu22.04 This is my system environment
I stopped using a1111 for a few months. When I tried it today again today, I'm getting the same error...
Can confirm this when trying out the DemonCore Workflow from Civitai, which depends on these nodes for upscaling.
After having searched and found a hint on stackoverflow, I made a desperate attempt that finally worked:
diff --git a/nodes/functions_upscale.py b/nodes/functions_upscale.py
index 2c25f03..a6c748c 100644
--- a/nodes/functions_upscale.py
+++ b/nodes/functions_upscale.py
@@ -54,7 +54,8 @@ def upscale_with_model(upscale_model, image):
if tile < 128:
raise e
- upscale_model.cpu()
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
+ upscale_model.to(device)
s = torch.clamp(s.movedim(-3,-1), min=0, max=1.0)
return s
Can confirm this when trying out the DemonCore Workflow from Civitai, which depends on these nodes for upscaling.
After having searched and found a hint on stackoverflow, I made a desperate attempt that finally worked:
diff --git a/nodes/functions_upscale.py b/nodes/functions_upscale.py index 2c25f03..a6c748c 100644 --- a/nodes/functions_upscale.py +++ b/nodes/functions_upscale.py @@ -54,7 +54,8 @@ def upscale_with_model(upscale_model, image): if tile < 128: raise e - upscale_model.cpu() + device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') + upscale_model.to(device) s = torch.clamp(s.movedim(-3,-1), min=0, max=1.0) return s
Nice, works great for me. have you already made a PR for this fix?
No, I didn't make a PR. The @Suzie1 account seems pretty inactive since Feb'24, so I didn't bother.
I deployed ComfyUI on the DSW server of Alibaba Cloud. When I tried to zoom in with the enlarged model, it displayed this error