mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-16 04:49:35 +08:00
Add cleanup only on the error exit (when tile < 128) before re-raising the OOM exception
This commit is contained in:
parent
70408503fb
commit
b749e0db49
@ -89,6 +89,7 @@ class ImageUpscaleWithModel(io.ComfyNode):
|
|||||||
except model_management.OOM_EXCEPTION as e:
|
except model_management.OOM_EXCEPTION as e:
|
||||||
tile //= 2
|
tile //= 2
|
||||||
if tile < 128:
|
if tile < 128:
|
||||||
|
upscale_model.to("cpu")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
# upscale_model.to("cpu") # Commented out to keep model on GPU because when processing batch images then model unnecessarily moves to CPU
|
# upscale_model.to("cpu") # Commented out to keep model on GPU because when processing batch images then model unnecessarily moves to CPU
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user