ComfyUI はノードベースプログラミングと呼ばれることがありますが、基本的には、モデルやプロンプトを KSampler に入れると画像が出力されるだけの、一本道でシンプルなものです。
しかし、少し複雑なパイプラインを組みたいときもあります。
- 入力画像が小さければアップスケール処理を挟む。
- 画像を解析して、手が崩れていそうなら後処理を入れる。
- プロンプトに特定の文字が含まれていたら、別のモデルや設定に切り替える
- …
このような「条件によって処理を変える」仕組みを、プログラミングでは条件分岐と呼びますが、ComfyUI にも、この条件分岐に近いことをするための基本的なノードがあります。
条件分岐の基本

{
"id": "29ed44dd-6fe2-456a-bd1a-461f34951fde",
"revision": 0,
"last_node_id": 8,
"last_link_id": 8,
"nodes": [
{
"id": 3,
"type": "LoadImage",
"pos": [
2748.9669779761944,
1624.9274767201969
],
"size": [
226.7833983976825,
326
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
3
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"B.png",
"image"
]
},
{
"id": 2,
"type": "LoadImage",
"pos": [
2492.7754310784335,
1498.5904319414708
],
"size": [
226.7833983976825,
326
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
1
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"A.png",
"image"
]
},
{
"id": 8,
"type": "PrimitiveBoolean",
"pos": [
2748.769003945466,
2005.3149857773456
],
"size": [
230.67001742550065,
58
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
8
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveBoolean"
},
"widgets_values": [
true
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 4,
"type": "PreviewImage",
"pos": [
3344.4342364224844,
1498.5904319414708
],
"size": [
304.55743368775256,
332.8579683361372
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 4
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 1,
"type": "ComfySwitchNode",
"pos": [
3040.914082203413,
1498.5904319414708
],
"size": [
270,
78
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "on_false",
"type": "IMAGE",
"link": 1
},
{
"name": "on_true",
"type": "IMAGE",
"link": 3
},
{
"name": "switch",
"type": "BOOLEAN",
"widget": {
"name": "switch"
},
"link": 8
}
],
"outputs": [
{
"name": "output",
"type": "IMAGE",
"links": [
4
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfySwitchNode"
},
"widgets_values": [
false
],
"color": "#232",
"bgcolor": "#353"
}
],
"links": [
[
1,
2,
0,
1,
0,
"IMAGE"
],
[
3,
3,
0,
1,
1,
"IMAGE"
],
[
4,
1,
0,
4,
0,
"IMAGE"
],
[
8,
8,
0,
1,
2,
"BOOLEAN"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.9229599817706482,
"offset": [
-2156.9237407065307,
-1178.4599104270771
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
Switch で切り替える
条件分岐の基本になるのは Switch ノード です。
2 つ入力のうち、どちらを出力するかを切り替えるものです。
これを使えば、条件が合っているときは a、そうでないときは b を出力する、という使い方ができそうです。
Switch には Boolean を渡す
Switch において、2 つの入力のうち、どちらを出力するのか決めるための値が Boolean です。
Boolean は、true か false(0 or 1)のどちらかしか持たないシンプルな型で、トグルスイッチのようなものです。
もちろん手動でポチポチしても切り替えられますが、それでは面白くないですね。
プログラミング的に処理を切り替えるというのは、つまり、この Boolean をどのように作るか?という話になってきます。
Boolean を作る方法
プログラミングの世界では、Boolean を作る方法はいくらでもありますが、ここでは、ComfyUI のコアノードで扱える、汎用的なものをいくつか見てみましょう。
Math Expression
単純な計算 でも使ったものですが、このノードを使えば、数値を比べて Boolean を作ることができます。
例えば以下のように書いてみましょう。

{
"id": "ff9a0a9c-3ced-4326-962a-7af275c3f71d",
"revision": 0,
"last_node_id": 3,
"last_link_id": 2,
"nodes": [
{
"id": 3,
"type": "PreviewAny",
"pos": [
3324.4682790386732,
1536.2539712098414
],
"size": [
210,
165.81084525752772
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 2
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
]
},
{
"id": 2,
"type": "PrimitiveInt",
"pos": [
2692.0190372490806,
1536.2539712098414
],
"size": [
246.3932026778166,
82
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "INT",
"type": "INT",
"links": [
1
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveInt"
},
"widgets_values": [
20,
"fixed"
]
},
{
"id": 1,
"type": "ComfyMathExpression",
"pos": [
2981.095936608758,
1536.2539712098414
],
"size": [
300.68864574805593,
165.81084525752772
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT,BOOLEAN",
"link": 1
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT,BOOLEAN",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": null
},
{
"name": "BOOL",
"type": "BOOLEAN",
"links": [
2
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a == 20"
],
"color": "#232",
"bgcolor": "#353"
}
],
"links": [
[
1,
2,
0,
1,
0,
"INT"
],
[
2,
1,
2,
3,
0,
"BOOLEAN"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1.2284597357367328,
"offset": [
-2415.4416212964616,
-1188.9216918748982
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
a == 20
a に 18 や 20 といった数値を入力した int ノードを繋いでみましょう。
ご覧の通り、20 つまり、設定した値と同じになったときだけ、true と表示されますね。
もっとたくさんの数値、変数を使うこともできます。
0 < a <= b * 100
この式なら、a が 0 より大きく、b * 100 以下のとき true になります。
他にも以下のような比較演算子が使えますね。
a == b # 等しい
a != b # 等しくない
a > b # a が b より大きい
a >= b # a が b 以上
a < b # a が b より小さい
a <= b # a が b 以下
Compare Text
文字列から Boolean を作るには、Compare Text ノードが使えます。
機能はかなりシンプルで、2 つの string を比較し、その結果を Boolean として出力します。
たとえば、入力されたテキストが Hello と一致するか、Hello から始まっているか / 終わっているか、といった判定ができます。

{
"id": "1db6b4f2-1dca-4383-93dc-766f6750bfc2",
"revision": 0,
"last_node_id": 6,
"last_link_id": 5,
"nodes": [
{
"id": 5,
"type": "PrimitiveString",
"pos": [
2668.412239926897,
1536.2539712098414
],
"size": [
270,
58
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
3
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveString"
},
"widgets_values": [
"Hello World"
]
},
{
"id": 6,
"type": "PrimitiveString",
"pos": [
2668.412239926897,
1662.1432549853873
],
"size": [
270,
58
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
4
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveString"
},
"widgets_values": [
"Hello"
]
},
{
"id": 3,
"type": "PreviewAny",
"pos": [
3324.4682790386732,
1536.2539712098414
],
"size": [
210,
190
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 5
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
]
},
{
"id": 4,
"type": "StringCompare",
"pos": [
2986.3871153189016,
1536.2539712098414
],
"size": [
290.1062883277673,
190
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "string_a",
"type": "STRING",
"widget": {
"name": "string_a"
},
"link": 3
},
{
"name": "string_b",
"type": "STRING",
"widget": {
"name": "string_b"
},
"link": 4
}
],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
5
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "StringCompare"
},
"widgets_values": [
"",
"",
"Starts With",
true
],
"color": "#232",
"bgcolor": "#353"
}
],
"links": [
[
3,
5,
0,
4,
0,
"STRING"
],
[
4,
6,
0,
4,
1,
"STRING"
],
[
5,
4,
0,
3,
0,
"BOOLEAN"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1.2284597357367328,
"offset": [
-2371.487836752543,
-1201.4036934558803
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
string_a と string_b を比較し、条件に合っていれば true、合っていなければ false を出力します。
modeStarts With:string_aがstring_bから始まっているかEnds With:string_aがstring_bで終わっているかEqual:string_aとstring_bが同じか
case_sensitiveをtrueにすると、大文字・小文字を区別します。
MLLM
少しリッチな方法ですが、MLLM を使って、Boolean を作り出すこともできます。
Boolean というのは true / false で表現される、という話をしましたが、実はこれは数字の 1 / 0 でも良いのです。
つまり、MLLM に対して、「〇〇だったら 1、そうでないときは 0 と出力して」 といえば、それを Boolean に変換することができるんですね。

{
"id": "0bba12a8-d546-4b15-a099-13cb9870e6e3",
"revision": 0,
"last_node_id": 8,
"last_link_id": 10,
"nodes": [
{
"id": 1,
"type": "TextGenerate",
"pos": [
2903.298553740228,
1430.3770893064775
],
"size": [
400,
412
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 1
},
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": 5
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "audio",
"shape": 7,
"type": "AUDIO",
"link": null
}
],
"outputs": [
{
"name": "generated_text",
"type": "STRING",
"links": [
4,
8
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "TextGenerate"
},
"widgets_values": [
"この画像に女性が映っていれば 1 を、そうでなければ 0 を出力してください。",
256,
"on",
0.7,
64,
0.95,
0.05,
1.05,
0,
0,
false,
true
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 2,
"type": "CLIPLoader",
"pos": [
2579.1308760374027,
1430.3770893064775
],
"size": [
280.8288815898386,
106
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
1
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "CLIPLoader"
},
"widgets_values": [
"qwen3.5_4b_bf16.safetensors",
"stable_diffusion",
"default"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 5,
"type": "ComfyNumberConvert",
"pos": [
3330.6504958704527,
1430.3770893064775
],
"size": [
178.0101231973421,
46
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"label": "value",
"name": "value",
"type": "INT,FLOAT,STRING,BOOLEAN",
"link": 4
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": [
9
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyNumberConvert"
},
"widgets_values": [],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 7,
"type": "ComfyMathExpression",
"pos": [
3536.0125611980197,
1430.3770893064775
],
"size": [
235.5094643140137,
143.8565237478972
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT,BOOLEAN",
"link": 9
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT,BOOLEAN",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": null
},
{
"name": "BOOL",
"type": "BOOLEAN",
"links": [
10
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 8,
"type": "PreviewAny",
"pos": [
3798.8739676422583,
1430.3770893064775
],
"size": [
210,
112
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 10
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
]
},
{
"id": 4,
"type": "PreviewAny",
"pos": [
3330.6504958704527,
1646.5910947583602
],
"size": [
210,
112
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 8
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
]
},
{
"id": 3,
"type": "LoadImage",
"pos": [
2579.1308760374027,
1605.568342010362
],
"size": [
280.8288815898386,
403.7872325736837
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
5
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"0005_amodal_rebuild001_0005.png",
"image"
]
}
],
"links": [
[
1,
2,
0,
1,
0,
"CLIP"
],
[
4,
1,
0,
5,
0,
"STRING"
],
[
5,
3,
0,
1,
1,
"IMAGE"
],
[
8,
1,
0,
4,
0,
"STRING"
],
[
9,
5,
1,
7,
0,
"INT"
],
[
10,
7,
2,
8,
0,
"BOOLEAN"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.9229599817706495,
"offset": [
-2247.520386763948,
-1115.6613995536602
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
- ここでは
TextGenerateノードを使い、Qwen 3.5 4B を使用しています。 - 少しややこしいですが、MLLM の出力はテキスト、つまり
stringなので、それをintに変換し、それをさらにBooleanに直します。
MLLM を使うと、単なる数値やテキスト比較に比べて、遥かに柔軟で複雑なことができます。
- この画像に映っている人の人数は?
- このプロンプトに合うのはアニメ系モデル?実写系モデル?
- 出力画像の品質は良い?悪い?
複数条件を組み合わせる
「画像の高さが 1000px 以上 かつ 横幅が 500px 未満」というように、複数の条件を組み合わせたい場合があります。
そのような場面で使うのが 論理演算子 です。
AND / OR / NOT
論理演算子には AND / OR / NOT の三種類があります。
複数の Boolean 入力があったとき、その組み合わせによって true か false を出力します。

{
"id": "29b7b79f-f765-42d3-bf97-c0310f2e4ab1",
"revision": 0,
"last_node_id": 8,
"last_link_id": 8,
"nodes": [
{
"id": 1,
"type": "ComfyAndNode",
"pos": [
3243.655451593356,
1424.6992835911767
],
"size": [
180.474609375,
86
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"label": "value0",
"name": "values.value0",
"type": "*",
"link": 1
},
{
"label": "value1",
"name": "values.value1",
"shape": 7,
"type": "*",
"link": 2
},
{
"label": "value2",
"name": "values.value2",
"shape": 7,
"type": "*",
"link": null
}
],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
6
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyAndNode"
},
"widgets_values": [],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 2,
"type": "ComfyOrNode",
"pos": [
3243.655451593356,
1600.9782195634316
],
"size": [
180.474609375,
86
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"label": "value0",
"name": "values.value0",
"type": "*",
"link": 3
},
{
"label": "value1",
"name": "values.value1",
"shape": 7,
"type": "*",
"link": 4
},
{
"label": "value2",
"name": "values.value2",
"shape": 7,
"type": "*",
"link": null
}
],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
7
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyOrNode"
},
"widgets_values": [],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 3,
"type": "ComfyNotNode",
"pos": [
3243.655451593356,
1777.2571555356867
],
"size": [
180.474609375,
26
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "value",
"type": "*",
"link": 5
}
],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
8
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyNotNode"
},
"widgets_values": [],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 4,
"type": "PrimitiveBoolean",
"pos": [
2849.5866872595443,
1533.0468610425542
],
"size": [
270,
58
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
1,
3
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveBoolean"
},
"widgets_values": [
true
],
"color": "#2a363b",
"bgcolor": "#3f5159"
},
{
"id": 5,
"type": "PrimitiveBoolean",
"pos": [
2849.569497039055,
1656.9267808516133
],
"size": [
270,
58
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "BOOLEAN",
"type": "BOOLEAN",
"links": [
2,
4,
5
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveBoolean"
},
"widgets_values": [
false
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 6,
"type": "PreviewAny",
"pos": [
3480.0359374991986,
1424.6992835911767
],
"size": [
241.08104976588402,
112
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 6
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 7,
"type": "PreviewAny",
"pos": [
3480.0359374991986,
1600.9782195634316
],
"size": [
241.08104976588402,
112
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 7
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
],
"color": "#2a363b",
"bgcolor": "#3f5159"
},
{
"id": 8,
"type": "PreviewAny",
"pos": [
3480.0359374991986,
1777.2571555356867
],
"size": [
241.08104976588402,
112
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 8
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
null
],
"color": "#2a363b",
"bgcolor": "#3f5159"
}
],
"links": [
[
1,
4,
0,
1,
0,
"BOOLEAN"
],
[
2,
5,
0,
1,
1,
"BOOLEAN"
],
[
3,
4,
0,
2,
0,
"BOOLEAN"
],
[
4,
5,
0,
2,
1,
"BOOLEAN"
],
[
5,
5,
0,
3,
0,
"BOOLEAN"
],
[
6,
1,
0,
6,
0,
"BOOLEAN"
],
[
7,
2,
0,
7,
0,
"BOOLEAN"
],
[
8,
3,
0,
8,
0,
"BOOLEAN"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1.1167815779424861,
"offset": [
-2610.9052853223634,
-1235.8307818001963
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
- AND: 全てが
trueのときだけtrue - OR: どれかが
trueならtrue - NOT:
trueとfalseを反転する
もちろん、これらは組み合わせても構いません。
AND に NOT を組み合わせれば、2 つの入力が true のとき、false を出力する、なんてことができるわけですね。
難しく考える必要はありません。実際に使って動きを見てみましょう。
実践例
画像が縦長なら 90 度回転

{
"id": "b44355d7-ed6f-45da-8b10-a323c1253081",
"revision": 0,
"last_node_id": 11,
"last_link_id": 10,
"nodes": [
{
"id": 1,
"type": "LoadImage",
"pos": [
2804.885198733637,
1394.2279939324023
],
"size": [
279.21710715197923,
387.42527994692887
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
1,
7,
8
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"0054_amodal_rebuild001_0055 (1).png",
"image"
]
},
{
"id": 3,
"type": "ComfyMathExpression",
"pos": [
3358.744771432823,
1611.8942365428447
],
"size": [
293.4438010526278,
158.81020881025938
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT,BOOLEAN",
"link": 2
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT,BOOLEAN",
"link": 3
},
{
"label": "c",
"name": "values.c",
"shape": 7,
"type": "FLOAT,INT,BOOLEAN",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": null
},
{
"name": "BOOL",
"type": "BOOLEAN",
"links": [
4
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a < b"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 4,
"type": "ComfySwitchNode",
"pos": [
3673.9612274799,
1394.2279939324023
],
"size": [
230.99505860380214,
78
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "on_false",
"type": "IMAGE",
"link": 8
},
{
"name": "on_true",
"type": "IMAGE",
"link": 9
},
{
"name": "switch",
"type": "BOOLEAN",
"widget": {
"name": "switch"
},
"link": 4
}
],
"outputs": [
{
"name": "output",
"type": "IMAGE",
"links": [
10
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfySwitchNode"
},
"widgets_values": [
false
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 11,
"type": "PreviewImage",
"pos": [
3936.81673188957,
1394.2279939324023
],
"size": [
367.53720929434166,
315.2072473810899
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 10
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 2,
"type": "GetImageSize",
"pos": [
3121.0626802023608,
1609.3754605618176
],
"size": [
210,
136
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 1
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": [
2
]
},
{
"name": "height",
"type": "INT",
"links": [
3
]
},
{
"name": "batch_size",
"type": "INT",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "GetImageSize"
},
"widgets_values": [],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 10,
"type": "ImageRotate",
"pos": [
3358.744771432823,
1480.0859384220487
],
"size": [
226.0425153311071,
58
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 7
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ImageRotate"
},
"widgets_values": [
"90 degrees"
],
"color": "#323",
"bgcolor": "#535"
}
],
"links": [
[
1,
1,
0,
2,
0,
"IMAGE"
],
[
2,
2,
0,
3,
0,
"INT"
],
[
3,
2,
1,
3,
1,
"INT"
],
[
4,
3,
2,
4,
2,
"BOOLEAN"
],
[
7,
1,
0,
10,
0,
"IMAGE"
],
[
8,
1,
0,
4,
0,
"IMAGE"
],
[
9,
10,
0,
4,
1,
"IMAGE"
],
[
10,
4,
0,
11,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.7627768444385532,
"offset": [
-2311.7396288934533,
-909.3072739208028
]
},
"frontendVersion": "1.44.19"
},
"version": 0.4
}
Get Image Sizeで画像のサイズを取得- 縦長のときは、
width < heightがtrueになります trueのとき、入力画像をRotate Imageで回転させたものを出力します
女性が映っていれば男性に変える
女性が映っていれば男性に変え、それ以外の場合は人物をすべて消します。

{
"id": "e47d064a-cb92-4da7-b92b-be9f1ddd26f5",
"revision": 0,
"last_node_id": 70,
"last_link_id": 103,
"nodes": [
{
"id": 8,
"type": "VAEDecode",
"pos": [
1615.039087801503,
160.40068341159756
],
"size": [
161.111083984375,
46
],
"flags": {},
"order": 21,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 52
},
{
"name": "vae",
"type": "VAE",
"link": 62
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"slot_index": 0,
"links": [
65
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "VAEDecode"
},
"widgets_values": []
},
{
"id": 43,
"type": "VAELoader",
"pos": [
517.231573621917,
656.7863480776692
],
"size": [
269.8313103058076,
58
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
62,
76
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"flux2-vae.safetensors"
]
},
{
"id": 54,
"type": "ResizeImageMaskNode",
"pos": [
514.4495897676222,
484.74016932307575
],
"size": [
270,
106
],
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "input",
"type": "IMAGE,MASK",
"link": 82
}
],
"outputs": [
{
"name": "resized",
"type": "IMAGE",
"links": [
80
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.9.2",
"Node name for S&R": "ResizeImageMaskNode"
},
"widgets_values": [
"scale to multiple",
16,
"nearest-exact"
]
},
{
"id": 52,
"type": "VAEEncode",
"pos": [
821.9650317382822,
484.74016932307575
],
"size": [
162,
46
],
"flags": {},
"order": 15,
"mode": 0,
"inputs": [
{
"name": "pixels",
"type": "IMAGE",
"link": 80
},
{
"name": "vae",
"type": "VAE",
"link": 76
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
74,
75
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.9.2",
"Node name for S&R": "VAEEncode"
},
"widgets_values": []
},
{
"id": 33,
"type": "CLIPTextEncode",
"pos": [
558.700000000001,
387.24938745307793
],
"size": [
425.2650317382812,
122.99611236572264
],
"flags": {
"collapsed": true
},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 64
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
86
]
}
],
"title": "CLIP Text Encode (Negative Prompt)",
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 57,
"type": "CLIPLoader",
"pos": [
-1046.5432691773194,
203.48293731896845
],
"size": [
280.8288815898386,
106
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
87
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "CLIPLoader"
},
"widgets_values": [
"qwen3.5_4b_bf16.safetensors",
"stable_diffusion",
"default"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 58,
"type": "ComfyNumberConvert",
"pos": [
-295.0236493442684,
203.48293731896845
],
"size": [
178.0101231973421,
46
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"label": "value",
"name": "value",
"type": "INT,FLOAT,STRING,BOOLEAN",
"link": 89
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": [
90
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyNumberConvert"
},
"widgets_values": [],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
558.700000000001,
160.40068341159756
],
"size": [
425.2650317382812,
167.9430462646484
],
"flags": {},
"order": 17,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 63
},
{
"name": "text",
"type": "STRING",
"widget": {
"name": "text"
},
"link": 96
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
70
]
}
],
"title": "CLIP Text Encode (Positive Prompt)",
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 44,
"type": "CLIPLoader",
"pos": [
224.49879211425772,
292.66704483032197
],
"size": [
283.80000000000007,
106
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
63,
64
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.73",
"Node name for S&R": "CLIPLoader"
},
"widgets_values": [
"qwen_3_8b.safetensors",
"flux2",
"default"
]
},
{
"id": 48,
"type": "UNETLoader",
"pos": [
917.2536154382312,
19.495025634765582
],
"size": [
308.1592787377913,
82
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
69
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.9.2",
"Node name for S&R": "UNETLoader"
},
"widgets_values": [
"Flux.2/flux-2-klein-9b-fp8.safetensors",
"default"
]
},
{
"id": 56,
"type": "TextGenerate",
"pos": [
-722.3755914744937,
203.48293731896845
],
"size": [
400,
412
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 87
},
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": 102
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "audio",
"shape": 7,
"type": "AUDIO",
"link": null
}
],
"outputs": [
{
"name": "generated_text",
"type": "STRING",
"links": [
89
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "TextGenerate"
},
"widgets_values": [
"この画像に女性が映っていれば 1 を、そうでなければ 0 を出力してください。",
256,
"on",
0.7,
64,
0.95,
0.05,
1.05,
0,
0,
false,
true
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 49,
"type": "ReferenceLatent",
"pos": [
1021.2781285510225,
160.40068341159756
],
"size": [
204.134765625,
46
],
"flags": {},
"order": 19,
"mode": 0,
"inputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"link": 70
},
{
"name": "latent",
"shape": 7,
"type": "LATENT",
"link": 75
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
71
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.9.2",
"Node name for S&R": "ReferenceLatent"
},
"widgets_values": []
},
{
"id": 59,
"type": "ComfyMathExpression",
"pos": [
-89.66158401670012,
203.48293731896845
],
"size": [
235.5094643140137,
143.8565237478972
],
"flags": {},
"order": 14,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT,BOOLEAN",
"link": 90
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT,BOOLEAN",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": null
},
{
"name": "BOOL",
"type": "BOOLEAN",
"links": [
93
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 64,
"type": "PrimitiveStringMultiline",
"pos": [
-252.1066255598296,
-220.87349522456816
],
"size": [
397.5504229008086,
144.88451526818943
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
95
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveStringMultiline"
},
"widgets_values": [
"Remove all people from the image."
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 65,
"type": "PrimitiveStringMultiline",
"pos": [
-248.07279349515574,
-20.209864694091635
],
"size": [
397.5504229008086,
144.88451526818943
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
94
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PrimitiveStringMultiline"
},
"widgets_values": [
"Replace every woman in the image with a man, while keeping the same clothing, pose, position, hairstyle silhouette, lighting, camera angle, and scene composition."
],
"color": "#223",
"bgcolor": "#335"
},
{
"id": 63,
"type": "ComfySwitchNode",
"pos": [
220.08766704132302,
36.23429650683176
],
"size": [
270,
78
],
"flags": {},
"order": 16,
"mode": 0,
"inputs": [
{
"name": "on_false",
"type": "STRING",
"link": 95
},
{
"name": "on_true",
"type": "STRING",
"link": 94
},
{
"name": "switch",
"type": "BOOLEAN",
"widget": {
"name": "switch"
},
"link": 93
}
],
"outputs": [
{
"name": "output",
"type": "STRING",
"links": [
96,
98
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "ComfySwitchNode"
},
"widgets_values": [
false
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 67,
"type": "PreviewAny",
"pos": [
561.1172245661597,
-48.8577314253514
],
"size": [
320.47592717353996,
140.40191931344805
],
"flags": {},
"order": 18,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 98
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "PreviewAny"
},
"widgets_values": [
null,
null,
false
]
},
{
"id": 70,
"type": "CreateList",
"pos": [
-905.7143875874808,
484.74016932307575
],
"size": [
140,
66
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"label": "input0",
"name": "inputs.input0",
"type": "IMAGE",
"link": 100
},
{
"label": "input1",
"name": "inputs.input1",
"shape": 7,
"type": "IMAGE",
"link": 101
},
{
"label": "input2",
"name": "inputs.input2",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "list",
"shape": 6,
"type": "IMAGE",
"links": [
102,
103
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "CreateList"
}
},
{
"id": 51,
"type": "ResizeImageMaskNode",
"pos": [
209.97616959564456,
484.74016932307575
],
"size": [
270,
106
],
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "input",
"type": "IMAGE,MASK",
"link": 103
}
],
"outputs": [
{
"name": "resized",
"type": "IMAGE",
"links": [
82
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.9.2",
"Node name for S&R": "ResizeImageMaskNode"
},
"widgets_values": [
"scale total pixels",
1,
"nearest-exact"
]
},
{
"id": 68,
"type": "LoadImage",
"pos": [
-1616.6685525637188,
486.1192079256388
],
"size": [
304.14064949086014,
536.4849883179598
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
100
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"000160_00004_.png",
"image"
]
},
{
"id": 62,
"type": "LoadImage",
"pos": [
-1266.6309825671176,
565.9597542315803
],
"size": [
304.14064949086014,
536.4849883179598
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
101
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.22.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"000114_00005_.png",
"image"
]
},
{
"id": 31,
"type": "KSampler",
"pos": [
1262.7259909887628,
160.40068341159756
],
"size": [
315,
262
],
"flags": {},
"order": 20,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 69
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 71
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 86
},
{
"name": "latent_image",
"type": "LATENT",
"link": 74
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
52
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.39",
"Node name for S&R": "KSampler"
},
"widgets_values": [
12345,
"fixed",
4,
1,
"euler",
"simple",
1
]
},
{
"id": 45,
"type": "SaveImage",
"pos": [
1813.4632685986182,
160.40068341159756
],
"size": [
684.1076792845461,
555.3306746679631
],
"flags": {},
"order": 22,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 65
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.73"
},
"widgets_values": [
"ComfyUI"
]
}
],
"links": [
[
52,
31,
0,
8,
0,
"LATENT"
],
[
62,
43,
0,
8,
1,
"VAE"
],
[
63,
44,
0,
6,
0,
"CLIP"
],
[
64,
44,
0,
33,
0,
"CLIP"
],
[
65,
8,
0,
45,
0,
"IMAGE"
],
[
69,
48,
0,
31,
0,
"MODEL"
],
[
70,
6,
0,
49,
0,
"CONDITIONING"
],
[
71,
49,
0,
31,
1,
"CONDITIONING"
],
[
74,
52,
0,
31,
3,
"LATENT"
],
[
75,
52,
0,
49,
1,
"LATENT"
],
[
76,
43,
0,
52,
1,
"VAE"
],
[
80,
54,
0,
52,
0,
"IMAGE"
],
[
82,
51,
0,
54,
0,
"IMAGE"
],
[
86,
33,
0,
31,
2,
"CONDITIONING"
],
[
87,
57,
0,
56,
0,
"CLIP"
],
[
89,
56,
0,
58,
0,
"STRING"
],
[
90,
58,
1,
59,
0,
"INT"
],
[
93,
59,
2,
63,
2,
"BOOLEAN"
],
[
94,
65,
0,
63,
1,
"STRING"
],
[
95,
64,
0,
63,
0,
"STRING"
],
[
96,
63,
0,
6,
1,
"STRING"
],
[
98,
63,
0,
67,
0,
"STRING"
],
[
100,
68,
0,
70,
0,
"IMAGE"
],
[
101,
62,
0,
70,
1,
"IMAGE"
],
[
102,
70,
0,
56,
1,
"IMAGE"
],
[
103,
70,
0,
51,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.4189769069935071,
"offset": [
1847.0845643468651,
533.2709120844096
]
},
"frontendVersion": "1.44.19",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}
- MLLM に画像を見せて、女性が映っていれば
1、そうでなければ0を出力させます trueのときは、女性を男性に変えるプロンプト、falseのときは、人物を除去するプロンプトに切り替えます- 画像とプロンプトを Flux.2 Klein 9B に渡し、画像編集させます