ここが少しややこしいポイントですが、Stable Diffusion自体は透過画像を直接扱うことができません。
そのため、ComfyUIに透過PNG画像を読み込むと、内部で 「RGB画像」と「マスク」 の2つに分離されます。
多くのソフトでは「透明部分=黒」としてマスクが作られるため、PhotoshopやAffinity Photoなどの画像編集ソフトに慣れている人は混乱するかもしれませんが、別物と考えてください。
Join-Split_Image_with_Alpha.json
{
"id": "46eb223f-85b8-4e7c-9687-4e8c16f488b3",
"revision": 0,
"last_node_id": 11,
"last_link_id": 8,
"nodes": [
{
"id": 10,
"type": "PreviewImage",
"pos": [
1976.926513671875,
375.5755310058594
],
"size": [
321.9876403808594,
370.00927734375
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 7
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "PreviewImage"
},
"widgets_values": [],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 11,
"type": "MaskPreview",
"pos": [
1976.926513671875,
809.1090698242188
],
"size": [
321.9876403808594,
370.00927734375
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "mask",
"type": "MASK",
"link": 8
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "MaskPreview"
},
"widgets_values": [],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 8,
"type": "PreviewImage",
"pos": [
1303.7996826171875,
523.0103149414062
],
"size": [
416.71490478515625,
456.6972961425781
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 5
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "PreviewImage"
},
"widgets_values": [],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 6,
"type": "LoadImageMask",
"pos": [
754.363037109375,
834.3838500976562
],
"size": [
283.7431335449219,
391.30450439453125
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MASK",
"type": "MASK",
"links": [
4
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "LoadImageMask"
},
"widgets_values": [
"pasted/image (1).png",
"red",
"image"
]
},
{
"id": 4,
"type": "LoadImage",
"pos": [
754.363037109375,
375.5755310058594
],
"size": [
283.7431335449219,
391.30450439453125
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
3
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"pasted/image (2).png",
"image"
]
},
{
"id": 7,
"type": "JoinImageWithAlpha",
"pos": [
1110.365478515625,
375.5755310058594
],
"size": [
176.86484375,
46
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 3
},
{
"name": "alpha",
"type": "MASK",
"link": 4
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
5,
6
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "JoinImageWithAlpha"
},
"widgets_values": [],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 9,
"type": "SplitImageWithAlpha",
"pos": [
1710.207275390625,
375.5755310058594
],
"size": [
178.4166015625,
46
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 6
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
7
]
},
{
"name": "MASK",
"type": "MASK",
"links": [
8
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "SplitImageWithAlpha"
},
"widgets_values": [],
"color": "#323",
"bgcolor": "#535"
}
],
"links": [
[
3,
4,
0,
7,
0,
"IMAGE"
],
[
4,
6,
0,
7,
1,
"MASK"
],
[
5,
7,
0,
8,
0,
"IMAGE"
],
[
6,
7,
0,
9,
0,
"IMAGE"
],
[
7,
9,
0,
10,
0,
"IMAGE"
],
[
8,
9,
1,
11,
0,
"MASK"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.8264462809917354,
"offset": [
-745.2246390657504,
-245.15161535008457
]
},
"frontendVersion": "1.30.6",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}