From 8f7bf14c6ffb6502698b40d80dba815022ac4a68 Mon Sep 17 00:00:00 2001 From: Sirshendu Ganguly Date: Tue, 7 Oct 2025 08:42:55 -0400 Subject: [PATCH] Fix infinite polling loop in video inference --- modules/videoInference.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/videoInference.py b/modules/videoInference.py index f7140e7..70e8cd7 100644 --- a/modules/videoInference.py +++ b/modules/videoInference.py @@ -1,6 +1,7 @@ from .utils import runwareUtils as rwUtils from .videoModelSearch import videoModelSearch import json +import comfy.model_management class RunwareFrameImages: @@ -325,6 +326,8 @@ class txt2vid: # Poll for video completion while True: + # Check for interrupt before each poll + comfy.model_management.throw_exception_if_processing_interrupted() # Poll for video result pollResult = rwUtils.pollVideoResult(taskUUID) @@ -358,8 +361,13 @@ class txt2vid: # If status is "processing", continue polling - # Wait before next poll - rwUtils.time.sleep(1) + # Check for interrupt before waiting + comfy.model_management.throw_exception_if_processing_interrupted() + + # Wait before next poll (split into smaller chunks to allow more frequent interrupt checks) + for _ in range(10): # 10 x 0.1 second = 1 second total + comfy.model_management.throw_exception_if_processing_interrupted() + rwUtils.time.sleep(0.1) # Node class mappings for ComfyUI registration