From 0cdc0394fe8773aa7bd65b081670f1bef3a6ce63 Mon Sep 17 00:00:00 2001 From: Meisoftcoltd <38667978+Meisoftcoltd@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:20:54 +0000 Subject: [PATCH] refactor: remove VALIDATE_INPUTS to fix dynamic routing block Deleted `opt_video_path` parameter and the strict `VALIDATE_INPUTS` classmethod in `VideoAnalyzerWithAudio`. ComfyUI was validating the cached manual widget value before downstream dynamic nodes could finish processing strings. Routing everything directly through a single `video` input and completely removing `VALIDATE_INPUTS` properly delegates execution dependency to ComfyUI's native graph path order. --- video.py | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/video.py b/video.py index 58d5ee1..5a335ba 100644 --- a/video.py +++ b/video.py @@ -33,9 +33,6 @@ class VideoAnalyzerWithAudio: "reference_frame_idx": ("INT", {"default": 0, "min": 0, "max": 100000, "step": 1}), "use_face_detector": ("BOOLEAN", {"default": True}), "blur_threshold": ("FLOAT", {"default": 100.0, "min": 0.0, "max": 1000.0, "step": 1.0}), - }, - "optional": { - "opt_video_path": ("STRING", {"forceInput": True}), } } @@ -47,12 +44,7 @@ class VideoAnalyzerWithAudio: @classmethod def IS_CHANGED(cls, video, **kwargs): - # Usar entrada opcional si está disponible, sino usar video - opt_video_path = kwargs.get("opt_video_path", None) - if opt_video_path is not None: - video_name = opt_video_path[0] if isinstance(opt_video_path, (list, tuple)) else opt_video_path - else: - video_name = video[0] if isinstance(video, (list, tuple)) else video + video_name = video[0] if isinstance(video, (list, tuple)) else video if os.path.exists(video_name): video_path = video_name @@ -63,27 +55,8 @@ class VideoAnalyzerWithAudio: return os.path.getmtime(video_path) return time.time() - @classmethod - def VALIDATE_INPUTS(cls, **kwargs): - # 1. Bypass dinámico: Si el puerto opcional está conectado, delegamos la existencia al tiempo de ejecución - if "opt_video_path" in kwargs and kwargs["opt_video_path"] is not None: - return True - - # 2. Validación estricta UX: Si se usa el widget manual estándar, verificamos físicamente el archivo - if "video" in kwargs: - video_val = kwargs["video"] - if isinstance(video_val, str): - video_path = folder_paths.get_annotated_filepath(video_val) - if not os.path.exists(video_path): - return f"❌ El archivo de video no existe en: {video_path}" - - return True - - def analyze(self, video, reference_frame_idx, use_face_detector, blur_threshold, opt_video_path=None, **kwargs): - if opt_video_path is not None: - video_name = opt_video_path[0] if isinstance(opt_video_path, (list, tuple)) else opt_video_path - else: - video_name = video[0] if isinstance(video, (list, tuple)) else video + def analyze(self, video, reference_frame_idx, use_face_detector, blur_threshold, **kwargs): + video_name = video[0] if isinstance(video, (list, tuple)) else video if os.path.exists(video_name): video_path = video_name @@ -92,7 +65,7 @@ class VideoAnalyzerWithAudio: print(f"\n{'='*50}") print(f"🕵️ [DEBUG] NODO: Video Analyzer (Explorador)") - print(f" -> Archivo: {video_name}") + print(f" -> Archivo: {video_path}") # 1. Extracción de Audio Íntegro source_audio = None