Z-Image-SAM-ControlNet / comfy-ui-patch /z-image-control.json
neuralvfx's picture
Upload z-image-control.json
64e36d9 verified
{
"id": "dc824ad9-4bce-4551-a997-e6a87f72ec9a",
"revision": 0,
"last_node_id": 45,
"last_link_id": 77,
"nodes": [
{
"id": 11,
"type": "ZImageFunControlnet",
"pos": [
415.9837148867862,
1217.8433748087343
],
"size": [
270,
158
],
"flags": {},
"order": 17,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 8
},
{
"name": "model_patch",
"type": "MODEL_PATCH",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 24
},
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": 66
},
{
"name": "inpaint_image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "mask",
"shape": 7,
"type": "MASK",
"link": null
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
9
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "ZImageFunControlnet"
},
"widgets_values": [
1
]
},
{
"id": 19,
"type": "CLIPTextEncode",
"pos": [
565.6117354916819,
747.6673540762121
],
"size": [
384.6283512791799,
88
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 25
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
18
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"低分辨率,低画质,肢体畸形,手指畸形,画面过饱和,蜡像感,人脸无细节,过度光滑,画面具有AI感。构图混乱。文字模糊,扭曲。"
]
},
{
"id": 30,
"type": "SaveImage",
"pos": [
1792.9983147271168,
1031.4138758775948
],
"size": [
963.738329965309,
1146.7897439905723
],
"flags": {},
"order": 20,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 43
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"beach_sgmm_uniform"
]
},
{
"id": 20,
"type": "VAEDecode",
"pos": [
1543.1171210511807,
1245.8377316181443
],
"size": [
140,
46
],
"flags": {},
"order": 19,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 19
},
{
"name": "vae",
"type": "VAE",
"link": 23
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
43
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "VAEDecode"
},
"widgets_values": []
},
{
"id": 15,
"type": "LoadImage",
"pos": [
-821.0957409457342,
2280.5309684912636
],
"size": [
282.798828125,
314
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": []
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"z-image.png",
"image"
]
},
{
"id": 23,
"type": "CLIPLoader",
"pos": [
239.1186565991756,
657.1514402079171
],
"size": [
270,
106
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
25,
26
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "CLIPLoader"
},
"widgets_values": [
"qwen_3_4b.safetensors",
"stable_diffusion",
"default"
]
},
{
"id": 13,
"type": "ModelPatchLoader",
"pos": [
65.16434800585203,
1282.1995134775584
],
"size": [
270,
58
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL_PATCH",
"type": "MODEL_PATCH",
"links": [
7
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "ModelPatchLoader"
},
"widgets_values": [
"z-image-sam-controlnet.safetensors"
]
},
{
"id": 22,
"type": "VAELoader",
"pos": [
64.33552623336276,
1397.8641386088798
],
"size": [
270,
58
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
23,
24
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"ae.safetensors"
]
},
{
"id": 14,
"type": "CheckpointLoaderSimple",
"pos": [
62.28036667683965,
1120.527418531949
],
"size": [
270,
98
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
8
]
},
{
"name": "CLIP",
"type": "CLIP",
"links": []
},
{
"name": "VAE",
"type": "VAE",
"links": []
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"z_image_bf16.safetensors"
]
},
{
"id": 24,
"type": "EmptySD3LatentImage",
"pos": [
853.1171210511798,
1475.8377316181443
],
"size": [
270,
106
],
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "width",
"type": "INT",
"widget": {
"name": "width"
},
"link": 73
},
{
"name": "height",
"type": "INT",
"widget": {
"name": "height"
},
"link": 72
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
40
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "EmptySD3LatentImage"
},
"widgets_values": [
1024,
1024,
1
]
},
{
"id": 35,
"type": "ResizeAndPadImage",
"pos": [
-1238.1721546517392,
1946.865888773204
],
"size": [
270,
130
],
"flags": {},
"order": 14,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 77
},
{
"name": "target_width",
"type": "INT",
"widget": {
"name": "target_width"
},
"link": 69
},
{
"name": "target_height",
"type": "INT",
"widget": {
"name": "target_height"
},
"link": 71
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
65
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.2",
"Node name for S&R": "ResizeAndPadImage"
},
"widgets_values": [
512,
512,
"white",
"area"
]
},
{
"id": 34,
"type": "DownloadAndLoadSAM2Model",
"pos": [
-1121.7861397212728,
1149.4637473707248
],
"size": [
270,
130
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "sam2_model",
"type": "SAM2MODEL",
"links": [
46
]
}
],
"properties": {
"cnr_id": "comfyui-segment-anything-2",
"ver": "1.0.2",
"Node name for S&R": "DownloadAndLoadSAM2Model"
},
"widgets_values": [
"sam2_hiera_base_plus.safetensors",
"automaskgenerator",
"cuda",
"fp16"
]
},
{
"id": 36,
"type": "GetImageSize",
"pos": [
-1746.017145146,
1967.0669951317168
],
"size": [
140,
124.00000000000023
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 76
}
],
"outputs": [
{
"name": "width",
"type": "INT",
"links": [
68,
73
]
},
{
"name": "height",
"type": "INT",
"links": [
70,
72
]
},
{
"name": "batch_size",
"type": "INT",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.2",
"Node name for S&R": "GetImageSize"
},
"widgets_values": []
},
{
"id": 42,
"type": "ComfyMathExpression",
"pos": [
-1531.0935930361586,
1898.417099480822
],
"size": [
213.8494156578413,
128
],
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT",
"link": 68
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": [
69
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.1",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a/16*16"
]
},
{
"id": 43,
"type": "ComfyMathExpression",
"pos": [
-1532.8751424757495,
2042.2495505586323
],
"size": [
213.8494156578413,
128
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"label": "a",
"name": "values.a",
"type": "FLOAT,INT",
"link": 70
},
{
"label": "b",
"name": "values.b",
"shape": 7,
"type": "FLOAT,INT",
"link": null
}
],
"outputs": [
{
"name": "FLOAT",
"type": "FLOAT",
"links": null
},
{
"name": "INT",
"type": "INT",
"links": [
71
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.1",
"Node name for S&R": "ComfyMathExpression"
},
"widgets_values": [
"a/16*16"
]
},
{
"id": 31,
"type": "PreviewImage",
"pos": [
-99.58155915825408,
1765.1282497806278
],
"size": [
324.69567229615086,
300.83144858776404
],
"flags": {},
"order": 16,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 45
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.2",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 16,
"type": "KSampler",
"pos": [
1193.1171210511807,
1275.8377316181443
],
"size": [
270,
474
],
"flags": {},
"order": 18,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 9
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 13
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 18
},
{
"name": "latent_image",
"type": "LATENT",
"link": 40
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
19
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "KSampler"
},
"widgets_values": [
43,
"fixed",
50,
4,
"euler",
"normal",
1
]
},
{
"id": 32,
"type": "Sam2AutoSegmentation",
"pos": [
-730.1928828173537,
1316.2557006991372
],
"size": [
348.740234375,
410
],
"flags": {},
"order": 15,
"mode": 0,
"inputs": [
{
"name": "sam2_model",
"type": "SAM2MODEL",
"link": 46
},
{
"name": "image",
"type": "IMAGE",
"link": 65
}
],
"outputs": [
{
"name": "mask",
"type": "MASK",
"links": null
},
{
"name": "segmented_image",
"type": "IMAGE",
"links": [
45,
66
]
},
{
"name": "bbox",
"type": "BBOX",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-segment-anything-2",
"ver": "1.0.2",
"Node name for S&R": "Sam2AutoSegmentation"
},
"widgets_values": [
32,
64,
0.8,
0.95,
0.3,
0,
0,
0.7,
0.7,
0.34,
1,
0,
true,
true
]
},
{
"id": 45,
"type": "ImageScaleBy",
"pos": [
-1937.047795795927,
1574.8162839893137
],
"size": [
270,
82
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 75
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
76,
77
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.2",
"Node name for S&R": "ImageScaleBy"
},
"widgets_values": [
"nearest-exact",
2
]
},
{
"id": 18,
"type": "CLIPTextEncode",
"pos": [
569.9770363494711,
583.803168311876
],
"size": [
384.6283512791799,
88
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 26
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
13
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.11.0",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"a bust of a woman sitting for a portrait with black long hair, hills in the backgrounf"
]
},
{
"id": 33,
"type": "LoadImage",
"pos": [
-2693.3186628192066,
1685.4009289132941
],
"size": [
745.7598726474785,
966.0233137345678
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
75
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.18.2",
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"mona-lisa-the-joconde-leonardo-de-vinci-emotions-de0fed-640.webp",
"image"
]
}
],
"links": [
[
7,
13,
0,
11,
1,
"MODEL_PATCH"
],
[
8,
14,
0,
11,
0,
"MODEL"
],
[
9,
11,
0,
16,
0,
"MODEL"
],
[
13,
18,
0,
16,
1,
"CONDITIONING"
],
[
18,
19,
0,
16,
2,
"CONDITIONING"
],
[
19,
16,
0,
20,
0,
"LATENT"
],
[
23,
22,
0,
20,
1,
"VAE"
],
[
24,
22,
0,
11,
2,
"VAE"
],
[
25,
23,
0,
19,
0,
"CLIP"
],
[
26,
23,
0,
18,
0,
"CLIP"
],
[
40,
24,
0,
16,
3,
"LATENT"
],
[
43,
20,
0,
30,
0,
"IMAGE"
],
[
45,
32,
1,
31,
0,
"IMAGE"
],
[
46,
34,
0,
32,
0,
"SAM2MODEL"
],
[
65,
35,
0,
32,
1,
"IMAGE"
],
[
66,
32,
1,
11,
3,
"IMAGE"
],
[
68,
36,
0,
42,
0,
"INT"
],
[
69,
42,
1,
35,
1,
"INT"
],
[
70,
36,
1,
43,
0,
"INT"
],
[
71,
43,
1,
35,
2,
"INT"
],
[
72,
36,
1,
24,
1,
"INT"
],
[
73,
36,
0,
24,
0,
"INT"
],
[
75,
33,
0,
45,
0,
"IMAGE"
],
[
76,
45,
0,
36,
0,
"IMAGE"
],
[
77,
45,
0,
35,
0,
"IMAGE"
]
],
"groups": [
{
"id": 1,
"title": "Or just load a pre-segmented image ( option B )",
"bounding": [
-858.0058984152329,
2192.6872006181025,
643.4710093716204,
417.4186510216455
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 2,
"title": "Generate SAM Input From Photo ( option A )",
"bounding": [
-1233.4855158200974,
1007.0349578825226,
978.4169452831359,
741.5984721278527
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 3,
"title": "Convert To Width/Height Divisible by 16",
"bounding": [
-1756.0171451459996,
1802.5621816491716,
797.844990494262,
341.765718115396
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 4,
"title": "Load Models + ControlNet",
"bounding": [
52.28036667683968,
1046.9274185319491,
643.7033482099464,
418.9367200769311
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 5,
"title": "Prompt",
"bounding": [
224.8466693385037,
510.203168311877,
739.7587182901469,
335.464185764336
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
},
{
"id": 6,
"title": "Run ControlNet",
"bounding": [
843.1171210511798,
1172.2377316181446,
850,
587.6
],
"color": "#3f789e",
"font_size": 24,
"flags": {}
}
],
"config": {},
"extra": {
"workflowRendererVersion": "LG",
"ds": {
"scale": 0.33951172853750633,
"offset": [
2956.626911466514,
32.694051470157774
]
},
"frontendVersion": "1.41.21",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}