Skip to content

[feat] Add ImageStitch node for concatenating images #8369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 1, 2025

Conversation

christian-byrne
Copy link
Collaborator

@christian-byrne christian-byrne commented Jun 1, 2025

Adds ImageStitch node for concatenating images in four directions with optional borders, size matching, and intelligent dimension handling. Supports optional second image input with passthrough when None, configurable borders with color selection, and automatic batch/channel alignment.

Selection_1458

Upstreamed from https://github.com/kijai/ComfyUI-KJNodes with additional options for image border specification/control added.

Add ImageStitch node that concatenates images in four directions with optional borders and intelligent size handling. Features include optional second image input, configurable borders with color selection, automatic batch size matching, and dimension alignment via padding or resizing.

Upstreamed from https://github.com/kijai/ComfyUI-KJNodes with enhancements for better error handling and comprehensive test coverage.
- Mock CUDA-dependent modules in tests to avoid CI failures on CPU-only runners
- Fix ruff linting issues for code style compliance
Prevent CUDA initialization chain by mocking the nodes module at import time,
which is cleaner than deep mocking of CUDA-specific functions.
- Remove unnecessary sys.path manipulation (pythonpath set in pytest.ini)
- Remove metadata tests that test framework internals rather than functionality
- Rename complex scenario test to be more descriptive of what it tests
@Kosinkadink Kosinkadink added Core-Important Core Core team dependency labels Jun 1, 2025
- Change border_width/border_color to spacing_width/spacing_color in API
- Update all tests to use spacing terminology
- Update comments and variable names throughout
- More accurately describes the gap/separator between images
Copy link
Collaborator

@Kosinkadink Kosinkadink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after the naming + default value changes, tested and works as expected.

@comfyanonymous comfyanonymous merged commit d062fcc into master Jun 1, 2025
6 checks passed
@comfyanonymous comfyanonymous deleted the image-stitch-node branch June 1, 2025 08:28
@MavenDE
Copy link

MavenDE commented Jun 8, 2025

Great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Core team dependency Core-Important
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants