mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-21 08:47:07 +08:00
Adds a self-contained API workflow at
tests/inference/graphs/image_blend_channel_mismatch.json that exercises
the previously-broken RGB + RGBA blend case end-to-end:
EmptyImage (RGB, red) -> image1
EmptyImage (RGB, blue)
+ SolidMask (0.5) -> JoinImageWithAlpha (RGBA) -> image2
-> ImageBlend (3ch + 4ch)
-> SaveImage
The workflow uses no model checkpoints and runs in seconds on CPU. With
the fix it produces a 4-channel RGBA output (alpha preserved); the
previous behavior would have silently dropped the alpha channel via
node_helpers.image_alpha_fix.
Verified end-to-end against a local ComfyUI instance: workflow executes
successfully, output PNG is RGBA, center pixel is (127, 0, 127, 191) -
red and blue blended at 0.5 with alpha 0.5*1.5=0.75 (191/255).
Automated Testing
Running tests locally
Additional requirements for running tests:
pip install pytest
pip install websocket-client==1.6.1
opencv-python==4.6.0.66
scikit-image==0.21.0
Run inference tests:
pytest tests/inference
Quality regression test
Compares images in 2 directories to ensure they are the same
- Run an inference test to save a directory of "ground truth" images
pytest tests/inference --output_dir tests/inference/baseline
-
Make code edits
-
Run inference and quality comparison tests
pytest