Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

mm: reset_cast_buffers: sync compute stream before free (#12822)

rattusbcf1a1fab1e9
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 39b4aa483..07bc8ad67 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -1148,6 +1148,7 @@ def reset_cast_buffers():
LARGEST_CASTED_WEIGHT = (None, 0)
for offload_stream in STREAM_CAST_BUFFERS:
offload_stream.synchronize()
+ synchronize()
STREAM_CAST_BUFFERS.clear()
soft_empty_cache()