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.

prefetch: guard against no offload (#13703)

rattusc47633f3befb
diff --git a/comfy/model_prefetch.py b/comfy/model_prefetch.py
index 0ad35deb5..72e11dec6 100644
--- a/comfy/model_prefetch.py
+++ b/comfy/model_prefetch.py
@@ -37,7 +37,8 @@ def prefetch_queue_pop(queue, device, module):
consumed = queue.pop(0)
if consumed is not None:
offload_stream, prefetch_state = consumed
- offload_stream.wait_stream(comfy.model_management.current_stream(device))
+ if offload_stream is not None:
+ offload_stream.wait_stream(comfy.model_management.current_stream(device))
_, comfy_modules = prefetch_state
if comfy_modules is not None:
cleanup_prefetched_modules(comfy_modules)