From 2b731a99fd373b8178de0ddbb3745f26943da56d Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Mon, 27 Apr 2026 07:08:14 +0000 Subject: [PATCH] Add API workflow JSON demonstrating ImageBlend channel-count fix 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). --- .../graphs/image_blend_channel_mismatch.json | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 tests/inference/graphs/image_blend_channel_mismatch.json diff --git a/tests/inference/graphs/image_blend_channel_mismatch.json b/tests/inference/graphs/image_blend_channel_mismatch.json new file mode 100644 index 000000000..6e003a616 --- /dev/null +++ b/tests/inference/graphs/image_blend_channel_mismatch.json @@ -0,0 +1,69 @@ +{ + "1": { + "inputs": { + "width": 256, + "height": 256, + "batch_size": 1, + "color": 16711680 + }, + "class_type": "EmptyImage", + "_meta": { + "title": "RGB image (3 channels, red)" + } + }, + "2": { + "inputs": { + "width": 256, + "height": 256, + "batch_size": 1, + "color": 255 + }, + "class_type": "EmptyImage", + "_meta": { + "title": "Base image for RGBA (blue)" + } + }, + "3": { + "inputs": { + "value": 0.5, + "width": 256, + "height": 256 + }, + "class_type": "SolidMask", + "_meta": { + "title": "Alpha mask (0.5)" + } + }, + "4": { + "inputs": { + "image": ["2", 0], + "alpha": ["3", 0] + }, + "class_type": "JoinImageWithAlpha", + "_meta": { + "title": "RGBA image (4 channels)" + } + }, + "5": { + "inputs": { + "image1": ["1", 0], + "image2": ["4", 0], + "blend_factor": 0.5, + "blend_mode": "normal" + }, + "class_type": "ImageBlend", + "_meta": { + "title": "Blend RGB (3ch) + RGBA (4ch) - exercises CORE-103 fix" + } + }, + "6": { + "inputs": { + "filename_prefix": "image_blend_channel_test", + "images": ["5", 0] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save blended output (will be RGBA)" + } + } +}