From bc49d060003df389b5277a048f2a8610177648ea Mon Sep 17 00:00:00 2001 From: Meisoftcoltd <38667978+Meisoftcoltd@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:08:05 +0000 Subject: [PATCH] feat: allow absolute paths in VideoAnalyzerWithAudio Update `VideoAnalyzerWithAudio` in `video.py` to support absolute paths for the `video_name` parameter. The node's `IS_CHANGED`, `VALIDATE_INPUTS`, and `analyze` methods have been modified to first check if the provided path exists directly using `os.path.exists()`. If it does, it uses the path directly, enabling the use of absolute paths. Otherwise, it falls back to the default `folder_paths.get_annotated_filepath()`. --- video.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/video.py b/video.py index 64af4bc..36c7f9a 100644 --- a/video.py +++ b/video.py @@ -46,7 +46,11 @@ class VideoAnalyzerWithAudio: def IS_CHANGED(cls, video, **kwargs): # Romper el caché si el archivo ha sido modificado en disco video_name = video[0] if isinstance(video, (list, tuple)) else video - video_path = folder_paths.get_annotated_filepath(video_name) + if os.path.exists(video_name): + video_path = video_name + else: + video_path = folder_paths.get_annotated_filepath(video_name) + if os.path.exists(video_path): return os.path.getmtime(video_path) return time.time() @@ -54,14 +58,21 @@ class VideoAnalyzerWithAudio: @classmethod def VALIDATE_INPUTS(cls, video, **kwargs): video_name = video[0] if isinstance(video, (list, tuple)) else video - video_path = folder_paths.get_annotated_filepath(video_name) + if os.path.exists(video_name): + video_path = video_name + else: + video_path = folder_paths.get_annotated_filepath(video_name) + 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, **kwargs): video_name = video[0] if isinstance(video, (list, tuple)) else video - video_path = folder_paths.get_annotated_filepath(video_name) + if os.path.exists(video_name): + video_path = video_name + else: + video_path = folder_paths.get_annotated_filepath(video_name) print(f"\n{'='*50}") print(f"🕵️ [DEBUG] NODO: Video Analyzer (Explorador)")