{ "id": "dc824ad9-4bce-4551-a997-e6a87f72ec9a", "revision": 0, "last_node_id": 38, "last_link_id": 57, "nodes": [ { "id": 11, "type": "ZImageFunControlnet", "pos": [ 415.9837148867862, 1217.8433748087343 ], "size": [ 270, 158 ], "flags": {}, "order": 16, "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": 54 }, { "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": 8, "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": 33, "type": "LoadImage", "pos": [ -1355.3384764264254, 1634.722401270745 ], "size": [ 282.798828125, 314.0000000000001 ], "flags": {}, "order": 0, "mode": 0, "inputs": [], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 47 ] }, { "name": "MASK", "type": "MASK", "links": null } ], "properties": { "cnr_id": "comfy-core", "ver": "0.18.2", "Node name for S&R": "LoadImage" }, "widgets_values": [ "young-male-posing-isolated-against-blank-studio-wall_273609-12356.avif", "image" ] }, { "id": 34, "type": "DownloadAndLoadSAM2Model", "pos": [ -1208.9003871602697, 1419.68542801308 ], "size": [ 270, 130 ], "flags": {}, "order": 1, "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": 32, "type": "Sam2AutoSegmentation", "pos": [ -937.8594354550089, 1667.6839001409319 ], "size": [ 348.740234375, 410 ], "flags": {}, "order": 7, "mode": 0, "inputs": [ { "name": "sam2_model", "type": "SAM2MODEL", "link": 46 }, { "name": "image", "type": "IMAGE", "link": 47 } ], "outputs": [ { "name": "mask", "type": "MASK", "links": null }, { "name": "segmented_image", "type": "IMAGE", "links": [ 45, 48, 49 ] }, { "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, 1, 0, 0, 0.7, 0.7, 0.34, 1, 0, false, true ] }, { "id": 36, "type": "GetImageSize", "pos": [ -107.27320618163911, 1829.9817741838676 ], "size": [ 140, 124 ], "flags": {}, "order": 11, "mode": 0, "inputs": [ { "name": "image", "type": "IMAGE", "link": 49 } ], "outputs": [ { "name": "width", "type": "INT", "links": [ 50 ] }, { "name": "height", "type": "INT", "links": [ 51 ] }, { "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": 35, "type": "ResizeAndPadImage", "pos": [ 400.5717843126228, 1809.780667825355 ], "size": [ 270, 130 ], "flags": {}, "order": 14, "mode": 0, "inputs": [ { "name": "image", "type": "IMAGE", "link": 48 }, { "name": "target_width", "type": "INT", "widget": { "name": "target_width" }, "link": 52 }, { "name": "target_height", "type": "INT", "widget": { "name": "target_height" }, "link": 53 } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 54 ] } ], "properties": { "cnr_id": "comfy-core", "ver": "0.18.2", "Node name for S&R": "ResizeAndPadImage" }, "widgets_values": [ 512, 512, "white", "area" ] }, { "id": 30, "type": "SaveImage", "pos": [ 1792.9983147271168, 1031.4138758775948 ], "size": [ 963.738329965309, 1146.7897439905723 ], "flags": {}, "order": 19, "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": 16, "type": "KSampler", "pos": [ 1200, 1090 ], "size": [ 270, 474 ], "flags": {}, "order": 17, "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": [ 45, "fixed", 50, 4, "euler", "normal", 1 ] }, { "id": 20, "type": "VAEDecode", "pos": [ 1550, 1060 ], "size": [ 140, 46 ], "flags": {}, "order": 18, "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": [ -984.5641159802153, 2265.0444908564186 ], "size": [ 282.798828125, 314 ], "flags": {}, "order": 2, "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": 31, "type": "PreviewImage", "pos": [ -165.21154651992745, 2208.8313046316466 ], "size": [ 324.69567229615086, 300.83144858776404 ], "flags": {}, "order": 10, "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": 23, "type": "CLIPLoader", "pos": [ 239.1186565991756, 657.1514402079171 ], "size": [ 270, 106 ], "flags": {}, "order": 3, "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": 4, "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": 5, "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": 6, "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": 18, "type": "CLIPTextEncode", "pos": [ 569.9770363494711, 583.803168311876 ], "size": [ 384.6283512791799, 88 ], "flags": {}, "order": 9, "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 man with frizzy hair smling" ] }, { "id": 37, "type": "ComfyMathExpression", "pos": [ 94.60175085035121, 1739.0769607013224 ], "size": [ 210, 128 ], "flags": {}, "order": 12, "mode": 0, "inputs": [ { "label": "a", "name": "values.a", "type": "FLOAT,INT", "link": 50 }, { "label": "b", "name": "values.b", "shape": 7, "type": "FLOAT,INT", "link": null } ], "outputs": [ { "name": "FLOAT", "type": "FLOAT", "links": null }, { "name": "INT", "type": "INT", "links": [ 52, 55 ] } ], "properties": { "cnr_id": "comfy-core", "ver": "0.18.2", "Node name for S&R": "ComfyMathExpression" }, "widgets_values": [ "a/16*16" ] }, { "id": 38, "type": "ComfyMathExpression", "pos": [ 95.47662250911469, 1889.2426788167184 ], "size": [ 210, 128 ], "flags": {}, "order": 13, "mode": 0, "inputs": [ { "label": "a", "name": "values.a", "type": "FLOAT,INT", "link": 51 }, { "label": "b", "name": "values.b", "shape": 7, "type": "FLOAT,INT", "link": null } ], "outputs": [ { "name": "FLOAT", "type": "FLOAT", "links": null }, { "name": "INT", "type": "INT", "links": [ 53, 57 ] } ], "properties": { "cnr_id": "comfy-core", "ver": "0.18.2", "Node name for S&R": "ComfyMathExpression" }, "widgets_values": [ "a/16*16" ] }, { "id": 24, "type": "EmptySD3LatentImage", "pos": [ 860, 1290 ], "size": [ 270, 106 ], "flags": {}, "order": 15, "mode": 0, "inputs": [ { "name": "width", "type": "INT", "widget": { "name": "width" }, "link": 55 }, { "name": "height", "type": "INT", "widget": { "name": "height" }, "link": 57 } ], "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 ] } ], "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" ], [ 47, 33, 0, 32, 1, "IMAGE" ], [ 48, 32, 1, 35, 0, "IMAGE" ], [ 49, 32, 1, 36, 0, "IMAGE" ], [ 50, 36, 0, 37, 0, "INT" ], [ 51, 36, 1, 38, 0, "INT" ], [ 52, 37, 1, 35, 1, "INT" ], [ 53, 38, 1, 35, 2, "INT" ], [ 54, 35, 0, 11, 3, "IMAGE" ], [ 55, 37, 1, 24, 0, "INT" ], [ 57, 38, 1, 24, 1, "INT" ] ], "groups": [ { "id": 1, "title": "Or just load a pre-segmented image ( option B )", "bounding": [ -1021.4742734497142, 2177.2007229832575, 643.4710093716204, 417.4186510216455 ], "color": "#3f789e", "font_size": 24, "flags": {} }, { "id": 2, "title": "Generate SAM Input From Photo ( option A )", "bounding": [ -1365.3384764264254, 1346.08542801308, 978.4169452831359, 741.5984721278527 ], "color": "#3f789e", "font_size": 24, "flags": {} }, { "id": 3, "title": "Convert To Width/Height Divisible by 16", "bounding": [ -117.27320618163911, 1665.4769607013225, 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": [ 850, 986.4, 850, 587.6 ], "color": "#3f789e", "font_size": 24, "flags": {} } ], "config": {}, "extra": { "workflowRendererVersion": "LG", "ds": { "scale": 0.21705230211937868, "offset": [ 3411.5599940756647, 562.9595312745586 ] }, "frontendVersion": "1.41.21", "VHS_latentpreview": false, "VHS_latentpreviewrate": 0, "VHS_MetadataImage": true, "VHS_KeepIntermediate": true }, "version": 0.4 }