ComfyUI/tests-unit/comfy_extras_test
Glary-Bot ae88cd1966 Cap ImageBlend channel-mismatch output at 4 channels (RGBA)
Address review feedback: the previous fix allowed ImageBlend to return
tensors with > 4 channels (e.g. blending a 3-channel and a 5-channel
image produced a 5-channel tensor). This shifted the original failure
from blend-time to save/preview-time, because SaveImage and PreviewImage
both call PIL.Image.fromarray, which only supports 1/3/4-channel arrays.

Fix:
- In Blend.execute, the alignment target is now min(max(c1, c2), 4):
  any image with more than 4 channels is truncated, any image with
  fewer is padded with 1.0s up to the (capped) target. This makes the
  RGB/RGBA case work and also makes the >4-channel case work end-to-end
  rather than just deferring its failure.
- Update the regression test that previously codified the wrong
  5-channel-output behavior to assert the correct 4-channel cap.
- Add test_output_capped_at_four_channels (both inputs > 4 channels).
- Add test_save_compatible_output_passes_through_pil that mirrors
  SaveImage's exact PIL.Image.fromarray conversion to catch regressions
  in the save/preview path.
- Add a small workflow-validation test (image_blend_workflow_test.py)
  that loads tests/inference/graphs/image_blend_channel_mismatch.json
  and verifies its node types and wiring, so the demo workflow can't
  silently bitrot.

Verified end-to-end against a local ComfyUI server: the workflow runs,
output is RGBA, downstream SaveImage succeeds.
2026-04-27 07:18:16 +00:00
..
__init__.py [feat] Add ImageStitch node for concatenating images (#8369) 2025-06-01 04:28:52 -04:00
image_blend_test.py Cap ImageBlend channel-mismatch output at 4 channels (RGBA) 2026-04-27 07:18:16 +00:00
image_blend_workflow_test.py Cap ImageBlend channel-mismatch output at 4 channels (RGBA) 2026-04-27 07:18:16 +00:00
image_stitch_test.py [V3] converted nodes_images.py to V3 schema (#11206) 2025-12-26 19:39:02 -08:00
nodes_math_test.py feat: add Math Expression node with simpleeval evaluation (#12687) 2026-03-05 18:51:28 -08:00
nodes_number_convert_test.py fix(number-convert): preserve int precision for large numbers (#13147) 2026-03-25 18:06:34 -04:00