Guard against None offload_stream in prefetch_queue_pop

cast_modules_with_vbar can return None when all modules in a
prefetched block are already resident. Mirrors the existing
None check in sync_stream.
This commit is contained in:
Dustin 2026-05-04 02:17:17 -04:00
parent 2806163f6e
commit 5770c7034b
No known key found for this signature in database
GPG Key ID: CD4385E7B7BA3529

View File

@ -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)