{
 "id": "8cf56c6b-51d0-4f5d-b5e4-1bd4b1b2c2ec",
 "revision": 0,
 "last_node_id": 11,
 "last_link_id": 30,
 "nodes": [
  {
   "id": 1,
   "type": "LoadImage",
   "pos": [
    100,
    130
   ],
   "size": [
    282.798828125,
    102
   ],
   "flags": {},
   "order": 0,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "image",
     "name": "image",
     "type": "COMBO",
     "widget": {
      "name": "image"
     },
     "link": null
    },
    {
     "localized_name": "choose file to upload",
     "name": "upload",
     "type": "IMAGEUPLOAD",
     "widget": {
      "name": "upload"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "IMAGE",
     "name": "IMAGE",
     "type": "IMAGE",
     "links": [
      18,
      21,
      24,
      28
     ]
    },
    {
     "localized_name": "MASK",
     "name": "MASK",
     "type": "MASK",
     "links": null
    }
   ],
   "title": "Reference picture",
   "properties": {
    "Node name for S&R": "LoadImage"
   },
   "widgets_values": [
    "reference.png",
    "image"
   ],
   "widgets_values_named": {
    "image": "reference.png",
    "upload": "image"
   }
  },
  {
   "id": 2,
   "type": "CheckpointLoaderSimple",
   "pos": [
    100,
    362
   ],
   "size": [
    270,
    98
   ],
   "flags": {},
   "order": 1,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "ckpt_name",
     "name": "ckpt_name",
     "type": "COMBO",
     "widget": {
      "name": "ckpt_name"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "MODEL",
     "name": "MODEL",
     "type": "MODEL",
     "links": [
      17
     ]
    },
    {
     "localized_name": "CLIP",
     "name": "CLIP",
     "type": "CLIP",
     "links": [
      16
     ]
    },
    {
     "localized_name": "VAE",
     "name": "VAE",
     "type": "VAE",
     "links": null
    }
   ],
   "title": "SAM 3.1",
   "properties": {
    "Node name for S&R": "CheckpointLoaderSimple"
   },
   "widgets_values": [
    "sam3.1_multiplex_fp16.safetensors"
   ],
   "widgets_values_named": {
    "ckpt_name": "sam3.1_multiplex_fp16.safetensors"
   }
  },
  {
   "id": 3,
   "type": "CLIPTextEncode",
   "pos": [
    482.798828125,
    326
   ],
   "size": [
    400,
    200
   ],
   "flags": {},
   "order": 3,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "clip",
     "name": "clip",
     "type": "CLIP",
     "link": 16
    },
    {
     "localized_name": "text",
     "name": "text",
     "type": "STRING",
     "widget": {
      "name": "text"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "CONDITIONING",
     "name": "CONDITIONING",
     "type": "CONDITIONING",
     "links": [
      19
     ]
    }
   ],
   "title": "What to cut out (one word)",
   "properties": {
    "Node name for S&R": "CLIPTextEncode"
   },
   "widgets_values": [
    "dinosaur"
   ],
   "widgets_values_named": {
    "text": "dinosaur"
   }
  },
  {
   "id": 4,
   "type": "SAM3_Detect",
   "pos": [
    982.798828125,
    390
   ],
   "size": [
    270,
    206
   ],
   "flags": {},
   "order": 5,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "model",
     "name": "model",
     "type": "MODEL",
     "link": 17
    },
    {
     "localized_name": "image",
     "name": "image",
     "type": "IMAGE",
     "link": 18
    },
    {
     "localized_name": "conditioning",
     "name": "conditioning",
     "shape": 7,
     "type": "CONDITIONING",
     "link": 19
    },
    {
     "localized_name": "bboxes",
     "name": "bboxes",
     "shape": 7,
     "type": "BOUNDING_BOX",
     "link": null
    },
    {
     "localized_name": "positive_coords",
     "name": "positive_coords",
     "shape": 7,
     "type": "STRING",
     "link": null
    },
    {
     "localized_name": "negative_coords",
     "name": "negative_coords",
     "shape": 7,
     "type": "STRING",
     "link": null
    },
    {
     "localized_name": "threshold",
     "name": "threshold",
     "type": "FLOAT",
     "widget": {
      "name": "threshold"
     },
     "link": null
    },
    {
     "localized_name": "refine_iterations",
     "name": "refine_iterations",
     "type": "INT",
     "widget": {
      "name": "refine_iterations"
     },
     "link": null
    },
    {
     "localized_name": "individual_masks",
     "name": "individual_masks",
     "type": "BOOLEAN",
     "widget": {
      "name": "individual_masks"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "masks",
     "name": "masks",
     "type": "MASK",
     "links": [
      20,
      29
     ]
    },
    {
     "localized_name": "bboxes",
     "name": "bboxes",
     "type": "BOUNDING_BOX",
     "links": null
    }
   ],
   "properties": {
    "Node name for S&R": "SAM3_Detect"
   },
   "widgets_values": [
    0.3,
    2,
    false
   ],
   "widgets_values_named": {
    "threshold": 0.3,
    "refine_iterations": 2,
    "individual_masks": false
   }
  },
  {
   "id": 5,
   "type": "InvertMask",
   "pos": [
    1352.798828125,
    130
   ],
   "size": [
    140,
    26
   ],
   "flags": {},
   "order": 6,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "mask",
     "name": "mask",
     "type": "MASK",
     "link": 20
    }
   ],
   "outputs": [
    {
     "localized_name": "MASK",
     "name": "MASK",
     "type": "MASK",
     "links": [
      22
     ]
    }
   ],
   "title": "JoinImageWithAlpha wants the inverse (ComfyUI mask convention)",
   "properties": {
    "Node name for S&R": "InvertMask"
   }
  },
  {
   "id": 6,
   "type": "JoinImageWithAlpha",
   "pos": [
    1724.444921875,
    130
   ],
   "size": [
    185.8609375,
    46
   ],
   "flags": {},
   "order": 8,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "image",
     "name": "image",
     "type": "IMAGE",
     "link": 21
    },
    {
     "localized_name": "alpha",
     "name": "alpha",
     "type": "MASK",
     "link": 22
    }
   ],
   "outputs": [
    {
     "localized_name": "IMAGE",
     "name": "IMAGE",
     "type": "IMAGE",
     "links": [
      23
     ]
    }
   ],
   "properties": {
    "Node name for S&R": "JoinImageWithAlpha"
   }
  },
  {
   "id": 7,
   "type": "SaveImage",
   "pos": [
    2094.444921875,
    130
   ],
   "size": [
    270,
    58
   ],
   "flags": {},
   "order": 10,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "images",
     "name": "images",
     "type": "IMAGE",
     "link": 23
    },
    {
     "localized_name": "filename_prefix",
     "name": "filename_prefix",
     "type": "STRING",
     "widget": {
      "name": "filename_prefix"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "images",
     "name": "images",
     "type": "IMAGE",
     "links": null
    }
   ],
   "title": "Cut-out with transparency (PNG)",
   "properties": {},
   "widgets_values": [
    "core/cutout-alpha"
   ],
   "widgets_values_named": {
    "filename_prefix": "core/cutout-alpha"
   }
  },
  {
   "id": 8,
   "type": "GetImageSize",
   "pos": [
    482.798828125,
    130
   ],
   "size": [
    140,
    66
   ],
   "flags": {},
   "order": 2,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "image",
     "name": "image",
     "type": "IMAGE",
     "link": 24
    }
   ],
   "outputs": [
    {
     "localized_name": "width",
     "name": "width",
     "type": "INT",
     "links": [
      25
     ]
    },
    {
     "localized_name": "height",
     "name": "height",
     "type": "INT",
     "links": [
      26
     ]
    },
    {
     "localized_name": "batch_size",
     "name": "batch_size",
     "type": "INT",
     "links": null
    }
   ],
   "properties": {
    "Node name for S&R": "GetImageSize"
   }
  },
  {
   "id": 9,
   "type": "EmptyImage",
   "pos": [
    982.798828125,
    130
   ],
   "size": [
    270,
    130
   ],
   "flags": {},
   "order": 4,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "width",
     "name": "width",
     "type": "INT",
     "widget": {
      "name": "width"
     },
     "link": 25
    },
    {
     "localized_name": "height",
     "name": "height",
     "type": "INT",
     "widget": {
      "name": "height"
     },
     "link": 26
    },
    {
     "localized_name": "batch_size",
     "name": "batch_size",
     "type": "INT",
     "widget": {
      "name": "batch_size"
     },
     "link": null
    },
    {
     "localized_name": "color",
     "name": "color",
     "type": "INT",
     "widget": {
      "name": "color"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "IMAGE",
     "name": "IMAGE",
     "type": "IMAGE",
     "links": [
      27
     ]
    }
   ],
   "properties": {
    "Node name for S&R": "EmptyImage"
   },
   "widgets_values": [
    512,
    512,
    1,
    8421504
   ],
   "widgets_values_named": {
    "width": 512,
    "height": 512,
    "batch_size": 1,
    "color": 8421504
   }
  },
  {
   "id": 10,
   "type": "ImageCompositeMasked",
   "pos": [
    1352.798828125,
    286
   ],
   "size": [
    271.64609375,
    146
   ],
   "flags": {},
   "order": 7,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "destination",
     "name": "destination",
     "type": "IMAGE",
     "link": 27
    },
    {
     "localized_name": "source",
     "name": "source",
     "type": "IMAGE",
     "link": 28
    },
    {
     "localized_name": "mask",
     "name": "mask",
     "shape": 7,
     "type": "MASK",
     "link": 29
    },
    {
     "localized_name": "x",
     "name": "x",
     "type": "INT",
     "widget": {
      "name": "x"
     },
     "link": null
    },
    {
     "localized_name": "y",
     "name": "y",
     "type": "INT",
     "widget": {
      "name": "y"
     },
     "link": null
    },
    {
     "localized_name": "resize_source",
     "name": "resize_source",
     "type": "BOOLEAN",
     "widget": {
      "name": "resize_source"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "IMAGE",
     "name": "IMAGE",
     "type": "IMAGE",
     "links": [
      30
     ]
    }
   ],
   "title": "On plain grey",
   "properties": {
    "Node name for S&R": "ImageCompositeMasked"
   },
   "widgets_values": [
    0,
    0,
    false
   ],
   "widgets_values_named": {
    "x": 0,
    "y": 0,
    "resize_source": false
   }
  },
  {
   "id": 11,
   "type": "SaveImage",
   "pos": [
    1724.444921875,
    306
   ],
   "size": [
    270,
    58
   ],
   "flags": {},
   "order": 9,
   "mode": 0,
   "inputs": [
    {
     "localized_name": "images",
     "name": "images",
     "type": "IMAGE",
     "link": 30
    },
    {
     "localized_name": "filename_prefix",
     "name": "filename_prefix",
     "type": "STRING",
     "widget": {
      "name": "filename_prefix"
     },
     "link": null
    }
   ],
   "outputs": [
    {
     "localized_name": "images",
     "name": "images",
     "type": "IMAGE",
     "links": null
    }
   ],
   "title": "Cut-out on grey (PNG)",
   "properties": {},
   "widgets_values": [
    "core/cutout-grey"
   ],
   "widgets_values_named": {
    "filename_prefix": "core/cutout-grey"
   }
  }
 ],
 "links": [
  [
   16,
   2,
   1,
   3,
   0,
   "CLIP"
  ],
  [
   17,
   2,
   0,
   4,
   0,
   "MODEL"
  ],
  [
   18,
   1,
   0,
   4,
   1,
   "IMAGE"
  ],
  [
   19,
   3,
   0,
   4,
   2,
   "CONDITIONING"
  ],
  [
   20,
   4,
   0,
   5,
   0,
   "MASK"
  ],
  [
   21,
   1,
   0,
   6,
   0,
   "IMAGE"
  ],
  [
   22,
   5,
   0,
   6,
   1,
   "MASK"
  ],
  [
   23,
   6,
   0,
   7,
   0,
   "IMAGE"
  ],
  [
   24,
   1,
   0,
   8,
   0,
   "IMAGE"
  ],
  [
   25,
   8,
   0,
   9,
   0,
   "INT"
  ],
  [
   26,
   8,
   1,
   9,
   1,
   "INT"
  ],
  [
   27,
   9,
   0,
   10,
   0,
   "IMAGE"
  ],
  [
   28,
   1,
   0,
   10,
   1,
   "IMAGE"
  ],
  [
   29,
   4,
   0,
   10,
   2,
   "MASK"
  ],
  [
   30,
   10,
   0,
   11,
   0,
   "IMAGE"
  ]
 ],
 "groups": [],
 "config": {},
 "extra": {
  "ds": {
   "scale": 0.9,
   "offset": [
    416,
    110
   ]
  }
 },
 "version": 0.4
}