1 Commits

Author SHA1 Message Date
Copilot
4579b7d607 Fix Image Overlay crash on batch image inputs (#365)
* Initial plan

* Fix Image Overlay node batch processing by extracting first image

Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>

* Add .gitignore and remove pycache files

Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>

* Add warning when multiple overlay images are detected

Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>
2026-03-31 19:46:59 -04:00
2 changed files with 43 additions and 0 deletions

37
.gitignore vendored Normal file
View File

@@ -0,0 +1,37 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Virtual environments
venv/
ENV/
env/
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db

View File

@@ -3957,6 +3957,12 @@ class TSC_ImageOverlay:
samples = overlay_image.movedim(-1, 1) samples = overlay_image.movedim(-1, 1)
overlay_image = comfy.utils.common_upscale(samples, overlay_image_size[0], overlay_image_size[1], resize_method, False) overlay_image = comfy.utils.common_upscale(samples, overlay_image_size[0], overlay_image_size[1], resize_method, False)
overlay_image = overlay_image.movedim(1, -1) overlay_image = overlay_image.movedim(1, -1)
# Handle batch dimension - use first image if overlay_image is a batch
if len(overlay_image.shape) == 4:
if overlay_image.shape[0] > 1:
print(f"{warning('Image Overlay Warning:')} Multiple overlay images detected ({overlay_image.shape[0]}), using only the first image.")
overlay_image = overlay_image[0]
overlay_image = tensor2pil(overlay_image) overlay_image = tensor2pil(overlay_image)