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).
This commit is contained in:
Glary-Bot 2026-04-27 07:08:14 +00:00
parent c390b88d8c
commit 2b731a99fd

View File

@ -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)"
}
}
}