Files
Meisoftcoltd-comfyui-sequen…/update_video.py
T
Meisoftcoltd 5983ff65b4 feat: rename video analyzer to face detector, add global cache, and introduce scene detector node
- Renamed `VideoAnalyzerWithAudio` to `VideoAnalyzerFaceDetector`.
- Introduced `VIDEO_ANALYSIS_CACHE` and `current_loop_index` for cycle caching.
- Created `VideoAnalyzerSceneDetector` to detect scene changes via pixel difference.
- Added dynamic reference frame preview functionality outside the caching logic.
- Registered nodes with proper display names in `__init__.py`.
2026-04-24 21:29:55 +00:00

28 lines
744 B
Python

import sys
def modify_video_py():
with open('video.py', 'r') as f:
lines = f.readlines()
# Find the imports section
import_uuid_idx = -1
for i, line in enumerate(lines):
if line.startswith('import time'):
import_uuid_idx = i + 1
break
if import_uuid_idx != -1:
lines.insert(import_uuid_idx, 'import uuid\n')
# Add cache after imports
for i, line in enumerate(lines):
if line.startswith('try:'):
lines.insert(i, '\n# Caché persistente para evitar re-escaneos pesados de vídeo\nVIDEO_ANALYSIS_CACHE = {}\n\n')
break
with open('video.py', 'w') as f:
f.writelines(lines)
if __name__ == '__main__':
modify_video_py()