* Update dims getting logic in IterativeLatentUpscale to assume that
height and width are at the end of the latent's dimensions.
* Update dims getting logic in IterativeLatentUpscale to assume that
height and width are at the end of the latent's dimensions.
* re-order args
Fix Reactor Masking Helper tensor concatenation issues
- Ensure all tensors are on the same device before concatenation.
- Add batch dimension to single images to support batched concatenation.
- Enforce height and width matching via upscaling to prevent dim mismatch.
- Handle channel mismatches by truncating to the minimum channel count.
- Remove unsafe tensor repetition to avoid excessive RAM usage.
- Prevent RuntimeErrors when concatenating images of varying sizes or devices.
* Optimize MaskListToMaskBatch
The complexity of the original implementation is O(n^2). Optimize it to O(n).
* Update util_nodes.py
robust mask upscale
---------
Co-authored-by: Dr.Lt.Data <128333288+ltdrdata@users.noreply.github.com>
* Optimized SEGSPaste to reduce memory usage
* Optimized SEGSPaste to reduce memory usage
* Changed behavior of SAM2VideoDetectorSEGS when BBOX doesn't return any segs
* changed behavior of SegsVideoDetector again. It will now try to detect bboxes on the reversed video if no bboxes are found. It will only give up once even the reversed run doesn't yield any bboxes
* changed Videodetector behavior to predict reverse when not finding any bboxes
* Update segs_nodes.py
---------
Co-authored-by: Kaski <23-23enterprise@gmx.de>
Co-authored-by: Dr.Lt.Data <128333288+ltdrdata@users.noreply.github.com>
* fix: Handle clipspace files in PreviewBridge mask editor and restore fresh image behavior
- Fix KeyError when using mask editor multiple times
- Add register_clipspace_image() method to detect and register clipspace files
- Resolve timing issue between frontend JS conversion and backend processing
- Restore original "fresh start" behavior for new image generations
- Clear mask cache when images/latents change to ensure clean slate for new content
- Maintain backwards compatibility with existing preview bridge functionality
- Add dual registration for clipspace paths and preview IDs
Fixes issue where second+ mask saves would fail with:
KeyError: 'clipspace/clipspace-mask-XXXXX.png [input]'
Also fixed regression where new images would retain previous masks instead of starting fresh.
* Fix restore_mask 'always' and 'if_same_size' modes in PreviewBridge
- Fixed 'always' mode to properly preserve masks when changing input images/latents
- Fixed 'if_same_size' mode to preserve masks when switching between same-sized images
- Modified cache clearing logic to preserve cache for both 'always' and 'if_same_size' modes
- Updated restoration logic to handle size comparison correctly for 'if_same_size'
This addresses the issue where masks were being cleared even when restore_mask was set to 'always' or when switching between same-sized images with 'if_same_size'.
Fixes the issue discussed in PR #1009