Skip to content

[feat] Add ImageStitch node for concatenating images#8369

Merged
comfyanonymous merged 5 commits intomasterfrom
image-stitch-node
Jun 1, 2025
Merged

[feat] Add ImageStitch node for concatenating images#8369
comfyanonymous merged 5 commits intomasterfrom
image-stitch-node

Conversation

@christian-byrne
Copy link
Contributor

@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
Member

@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

adlerfaulkner pushed a commit to LucaLabsInc/ComfyUI that referenced this pull request Oct 16, 2025
* [feat] Add ImageStitch node for concatenating images with borders

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.

* [fix] Fix CI issues with CUDA dependencies and linting

- Mock CUDA-dependent modules in tests to avoid CI failures on CPU-only runners
- Fix ruff linting issues for code style compliance

* [fix] Improve CI compatibility by mocking nodes module import

Prevent CUDA initialization chain by mocking the nodes module at import time,
which is cleaner than deep mocking of CUDA-specific functions.

* [refactor] Clean up ImageStitch tests

- 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

* [refactor] Rename 'border' to 'spacing' for semantic accuracy

- 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
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