This commit introduces the Hybrid Identity Architecture's Dynamic Engine:
- `tools.py`: Adds new Math constraint nodes (`ResTool 8x, 16x, 32x, 64x`) to calculate safe resolutions dynamically, preventing VRAM overflow.
- `loop.py`: Replaces the legacy static mathematical state machine with a dynamic performance-based state using `global_accumulated_frames` to progress accurately based on successful generations.
- `image.py`: Overhauls `SessionImageSender` to dynamically truncate generated image tensors using OpenCV if faces are lost, saving the last valid frame, and correctly adjusting the loop progression. `SessionImageReceiver` updated to log dynamic progression.
- `video.py`: Refactors `AutoLoopCalculator` and `IncrementalVideoStitcher` to work under the new dynamic state machine logic.
- `__init__.py`: Registered new nodes, updated imports to include `tools`, and bumped version to v1.5.0.
- `README.md` & `README_EN.md`: Updated documentation to detail the new Dynamic Engine functionality and Tools suite.
- Update WanFrameValidator to dynamically calculate skip_frames based on current_loop_index.
- Update LoadVideoWithSourceAudio to extract and output the first frame safely.
- Add total_loops tracking and detailed debug logs to SequentialLoopStart.
- Add total_loops to SessionImageReceiver and SessionImageSender for progressive tracking.
- Enhance print logs with visible Spanish banners across modified nodes.
- `loop.py`: Added check for `trigger_dependency` in `SequentialLoopTrigger.trigger_next`.
- `image.py`: Added checks for `generated_images` and `current_loop_index` in `SessionImageSender.set_image`.
- `video.py`: Added list-aware checks for `trigger` and `current_loop_index` in `IncrementalVideoStitcher.stitch_incremental` due to `INPUT_IS_LIST = True`.
All validations throw a `ValueError` with clear Spanish instructions when inputs are missing to provide immediate user feedback on the ComfyUI canvas.
Replaced loop.py and image.py, and updated video.py to fix the 'reverse cache'
issue by injecting the new index directly into the ComfyUI API JSON payload.
Added large debug banners in Spanish, PNG keyframe extraction, and progressive MP4 saving.
This resolves aggressive caching bugs in newer ComfyUI versions.
Replaced float("NaN") with time.time() in image.py and loop.py
to ensure stateful memory/trigger nodes consistently fire.
Replaced the entirety of image.py with a simplified and corrected implementation. The previous cyclic dependency concept was abandoned due to ComfyUI's DAG constraints. Instead, the global RAM approach is used, heavily augmented with `.clone().cpu()` during storage to protect the tensor from ComfyUI's VRAM garbage collector destroying it between Auto Queue cycles. Extraneous technical debt within the file was completely removed.
- Delete deprecated modules: `sequence.py`, `paths.py`, `batch.py`, `debug.py`.
- Clean `image.py`, retaining only SessionImageReceiver, SessionImageSender, and auxiliary function.
- Clean `video.py`, retaining only IncrementalVideoStitcher and WanFrameValidator.
- Clean `loop.py`, retaining only SequentialLoopStart and SequentialLoopTrigger.
- Rewrite `__init__.py` mapping explicitly to the 6 core components and bump version to 1.0.0.
Modified `SessionImageReceiver` in `image.py` and `IncrementalVideoStitcher`
in `video.py` to accept the integer `current_loop_index` instead of external
boolean values. Automatic state clearing is now correctly performed when the
loop index equals 0. List unwrapping logic for inputs was implemented to
defend against ComfyUI `INPUT_IS_LIST = True` iteration behavior while
preserving the robust path resolution checks built in previous iterations.
- Added WanFrameValidator node in video.py to ensure 4k+1 frame logic.
- Registered WanFrameValidator in __init__.py with "WanFrameValidator": "🛡️ Wan Frame Validator".
- Updated both README.md and README_ES.md to document the Wan Frame Validator.
- Modified SessionImageReceiver and SessionImageSender in image.py to return a UI object mapping for Visual UI Debugging in ComfyUI frontend.
The custom `@register_node` decorator requires `RETURN_NAMES` to be explicitly defined as a tuple. `SessionImageSender` had `RETURN_TYPES = ()` but was missing `RETURN_NAMES = ()`, which caused an `AttributeError` upon importing the module, breaking the startup of ComfyUI. This patch adds the missing empty tuple.
- Added `SessionImageSender` to save the last frame of an image batch (using `.clone()` to safely decouple the tensor) into a global session variable.
- Added `SessionImageReceiver` to inject the stored image into the start of the next workflow execution cycle.
- Both nodes utilize `IS_CHANGED` returning `NaN` to force execution on every Auto Queue tick.
- Updated `__init__.py` to register the new nodes under the display names "📤 Session Image Sender" and "📥 Session Image Receiver".
- Ensures users can chain frame sequences across independent batch loops without creating cyclic dependencies in ComfyUI.