{
  "config": {},
  "definitions": {
    "subgraphs": [
      {
        "config": {},
        "extra": {
          "workflowRendererVersion": "LG"
        },
        "groups": [],
        "id": "94a7e2c4-f61f-4641-a52c-758479d9b975",
        "inputNode": {
          "bounding": [
            -1880,
            -140,
            120,
            80
          ],
          "id": -10
        },
        "inputs": [
          {
            "id": "68bb369f-8785-4b9f-b018-65e10a96e046",
            "linkIds": [
              16,
              22
            ],
            "localized_name": "image1",
            "name": "image1",
            "pos": [
              -1780,
              -120
            ],
            "type": "IMAGE"
          },
          {
            "id": "29c264c0-fb68-474c-8fda-ca049dd15e77",
            "linkIds": [
              17
            ],
            "localized_name": "image",
            "name": "image",
            "pos": [
              -1780,
              -100
            ],
            "type": "IMAGE"
          }
        ],
        "links": [
          {
            "id": 4,
            "origin_id": 5,
            "origin_slot": 0,
            "target_id": 6,
            "target_slot": 1,
            "type": "INT"
          },
          {
            "id": 5,
            "origin_id": 5,
            "origin_slot": 1,
            "target_id": 6,
            "target_slot": 2,
            "type": "INT"
          },
          {
            "id": 16,
            "origin_id": -10,
            "origin_slot": 0,
            "target_id": 5,
            "target_slot": 0,
            "type": "IMAGE"
          },
          {
            "id": 17,
            "origin_id": -10,
            "origin_slot": 1,
            "target_id": 6,
            "target_slot": 0,
            "type": "IMAGE"
          },
          {
            "id": 21,
            "origin_id": 15,
            "origin_slot": 0,
            "target_id": -20,
            "target_slot": 0,
            "type": "IMAGE"
          },
          {
            "id": 22,
            "origin_id": -10,
            "origin_slot": 0,
            "target_id": 15,
            "target_slot": 0,
            "type": "IMAGE"
          },
          {
            "id": 23,
            "origin_id": 6,
            "origin_slot": 0,
            "target_id": 15,
            "target_slot": 1,
            "type": "IMAGE"
          }
        ],
        "name": "Batch Images",
        "nodes": [
          {
            "flags": {},
            "id": 15,
            "inputs": [
              {
                "label": "image0",
                "link": 22,
                "localized_name": "images.image0",
                "name": "images.image0",
                "type": "IMAGE"
              },
              {
                "label": "image1",
                "link": 23,
                "localized_name": "images.image1",
                "name": "images.image1",
                "type": "IMAGE"
              },
              {
                "label": "image2",
                "link": null,
                "localized_name": "images.image2",
                "name": "images.image2",
                "shape": 7,
                "type": "IMAGE"
              }
            ],
            "mode": 0,
            "order": 2,
            "outputs": [
              {
                "links": [
                  21
                ],
                "localized_name": "IMAGE",
                "name": "IMAGE",
                "type": "IMAGE"
              }
            ],
            "pos": [
              -1420,
              -170
            ],
            "properties": {
              "Node name for S&R": "BatchImagesNode"
            },
            "size": [
              169.23046875,
              66
            ],
            "type": "BatchImagesNode"
          },
          {
            "flags": {
              "collapsed": false
            },
            "id": 5,
            "inputs": [
              {
                "link": 16,
                "localized_name": "image",
                "name": "image",
                "type": "IMAGE"
              }
            ],
            "mode": 0,
            "order": 0,
            "outputs": [
              {
                "links": [
                  4
                ],
                "localized_name": "width",
                "name": "width",
                "type": "INT"
              },
              {
                "links": [
                  5
                ],
                "localized_name": "height",
                "name": "height",
                "type": "INT"
              },
              {
                "links": null,
                "localized_name": "batch_size",
                "name": "batch_size",
                "type": "INT"
              }
            ],
            "pos": [
              -1710,
              -30
            ],
            "properties": {
              "Node name for S&R": "GetImageSize"
            },
            "size": [
              210,
              136
            ],
            "type": "GetImageSize",
            "widgets_values": []
          },
          {
            "flags": {
              "collapsed": false
            },
            "id": 6,
            "inputs": [
              {
                "link": 17,
                "localized_name": "image",
                "name": "image",
                "type": "IMAGE"
              },
              {
                "link": 4,
                "localized_name": "target_width",
                "name": "target_width",
                "type": "INT",
                "widget": {
                  "name": "target_width"
                }
              },
              {
                "link": 5,
                "localized_name": "target_height",
                "name": "target_height",
                "type": "INT",
                "widget": {
                  "name": "target_height"
                }
              }
            ],
            "mode": 0,
            "order": 1,
            "outputs": [
              {
                "links": [
                  23
                ],
                "localized_name": "IMAGE",
                "name": "IMAGE",
                "type": "IMAGE"
              }
            ],
            "pos": [
              -1450,
              -30
            ],
            "properties": {
              "Node name for S&R": "ResizeAndPadImage"
            },
            "size": [
              210,
              130
            ],
            "type": "ResizeAndPadImage",
            "widgets_values": [
              512,
              512,
              "white",
              "area"
            ]
          }
        ],
        "outputNode": {
          "bounding": [
            -1080,
            -160,
            120,
            60
          ],
          "id": -20
        },
        "outputs": [
          {
            "id": "506e4ff4-c6f3-4bf1-9492-f4298a32939f",
            "linkIds": [
              21
            ],
            "localized_name": "IMAGE",
            "name": "IMAGE",
            "pos": [
              -1060,
              -140
            ],
            "type": "IMAGE"
          }
        ],
        "revision": 0,
        "state": {
          "lastGroupId": 0,
          "lastLinkId": 23,
          "lastNodeId": 15,
          "lastRerouteId": 0
        },
        "version": 1,
        "widgets": []
      }
    ]
  },
  "extra": {
    "VHS_KeepIntermediate": true,
    "VHS_MetadataImage": true,
    "VHS_latentpreview": false,
    "VHS_latentpreviewrate": 0,
    "ds": {
      "offset": [
        1902.121132651144,
        351.9877945599146
      ],
      "scale": 1.3940068280855902
    },
    "frontendVersion": "1.37.6",
    "workflowRendererVersion": "LG"
  },
  "groups": [],
  "id": "8ead682f-1c65-4c02-baf3-4e1f9537c836",
  "last_link_id": 44,
  "last_node_id": 29,
  "links": [
    [
      18,
      12,
      0,
      13,
      0,
      "STRING"
    ],
    [
      19,
      14,
      0,
      13,
      1,
      "STRING"
    ],
    [
      21,
      2,
      0,
      15,
      0,
      "IMAGE"
    ],
    [
      22,
      1,
      0,
      15,
      1,
      "IMAGE"
    ],
    [
      33,
      15,
      0,
      22,
      0,
      "IMAGE"
    ],
    [
      34,
      13,
      0,
      22,
      1,
      "STRING"
    ],
    [
      35,
      22,
      0,
      23,
      0,
      "IMAGE"
    ]
  ],
  "nodes": [
    {
      "bgcolor": "#353",
      "color": "#232",
      "flags": {},
      "id": 14,
      "inputs": [],
      "mode": 0,
      "order": 0,
      "outputs": [
        {
          "links": [
            19
          ],
          "name": "STRING",
          "type": "STRING"
        }
      ],
      "pos": [
        -1570,
        60
      ],
      "properties": {
        "Node name for S&R": "PrimitiveStringMultiline"
      },
      "size": [
        270,
        200
      ],
      "title": "Describe the Product",
      "type": "PrimitiveStringMultiline",
      "widgets_values": [
        "A dispenser bottle filled with viscuous clear liquid, with a metallic top, \"C\" logo and a clear glass body"
      ]
    },
    {
      "bgcolor": "#353",
      "color": "#232",
      "flags": {},
      "id": 1,
      "inputs": [],
      "mode": 0,
      "order": 1,
      "outputs": [
        {
          "links": [
            22
          ],
          "name": "IMAGE",
          "type": "IMAGE"
        },
        {
          "links": [],
          "name": "MASK",
          "type": "MASK"
        }
      ],
      "pos": [
        -1960,
        340
      ],
      "properties": {
        "Node name for S&R": "LoadImage"
      },
      "size": [
        340,
        420
      ],
      "title": "Load Product Image",
      "type": "LoadImage",
      "widgets_values": [
        "comfy_shampoo.png",
        "image"
      ]
    },
    {
      "bgcolor": "#353",
      "color": "#232",
      "flags": {
        "collapsed": false
      },
      "id": 2,
      "inputs": [],
      "mode": 0,
      "order": 2,
      "outputs": [
        {
          "links": [
            21
          ],
          "name": "IMAGE",
          "type": "IMAGE"
        },
        {
          "links": null,
          "name": "MASK",
          "type": "MASK"
        }
      ],
      "pos": [
        -1960,
        -170
      ],
      "properties": {
        "Node name for S&R": "LoadImage"
      },
      "size": [
        340,
        420
      ],
      "title": "Load Background Image",
      "type": "LoadImage",
      "widgets_values": [
        "flower_sea.png",
        "image"
      ]
    },
    {
      "flags": {},
      "id": 23,
      "inputs": [
        {
          "link": 35,
          "name": "images",
          "type": "IMAGE"
        }
      ],
      "mode": 0,
      "order": 7,
      "outputs": [],
      "pos": [
        -610,
        -170
      ],
      "properties": {},
      "size": [
        760,
        930
      ],
      "type": "SaveImage",
      "widgets_values": [
        "ComfyUI"
      ]
    },
    {
      "bgcolor": "#653",
      "color": "#432",
      "flags": {},
      "id": 22,
      "inputs": [
        {
          "link": 33,
          "name": "image",
          "shape": 7,
          "type": "IMAGE"
        },
        {
          "link": 34,
          "name": "prompt",
          "type": "STRING",
          "widget": {
            "name": "prompt"
          }
        }
      ],
      "mode": 0,
      "order": 6,
      "outputs": [
        {
          "links": [
            35
          ],
          "name": "IMAGE",
          "type": "IMAGE"
        }
      ],
      "pos": [
        -1050,
        -170
      ],
      "properties": {
        "Node name for S&R": "ByteDanceSeedreamNode"
      },
      "size": [
        400,
        374
      ],
      "type": "ByteDanceSeedreamNode",
      "widgets_values": [
        "seedream-4-5-251128",
        "",
        "2048x2048 (1:1)",
        2048,
        2048,
        "disabled",
        1,
        406946789,
        "randomize",
        false,
        true
      ]
    },
    {
      "flags": {
        "collapsed": true
      },
      "id": 13,
      "inputs": [
        {
          "link": 18,
          "name": "string",
          "type": "STRING",
          "widget": {
            "name": "string"
          }
        },
        {
          "link": 19,
          "name": "replace",
          "type": "STRING",
          "widget": {
            "name": "replace"
          }
        }
      ],
      "mode": 0,
      "order": 5,
      "outputs": [
        {
          "links": [
            34
          ],
          "name": "STRING",
          "type": "STRING"
        }
      ],
      "pos": [
        -1280,
        60
      ],
      "properties": {
        "Node name for S&R": "RegexReplace"
      },
      "size": [
        210,
        292
      ],
      "type": "RegexReplace",
      "widgets_values": [
        "",
        "{product_description}",
        "",
        true,
        false,
        false,
        0
      ]
    },
    {
      "flags": {
        "collapsed": true
      },
      "id": 12,
      "inputs": [],
      "mode": 0,
      "order": 3,
      "outputs": [
        {
          "links": [
            18
          ],
          "name": "STRING",
          "type": "STRING"
        }
      ],
      "pos": [
        -1570,
        310
      ],
      "properties": {
        "Node name for S&R": "PrimitiveStringMultiline"
      },
      "size": [
        390,
        770
      ],
      "title": "Prompt Template",
      "type": "PrimitiveStringMultiline",
      "widgets_values": [
        "Task: Realistic Product Compositing with Material Preservation Goal: Insert the product from Input 2 into Input 1, ensuring placement is logical and lighting interacts accurately with the product's specific material properties.\n\nInput Image(s):\n\nInput 1 (Scene)\nInput 2 (Product): {product_description}\n\nManual Material Breakdown (Critical): To ensure correct light interaction, treat the product as having the following physical properties:\n\nPrimary Material: [e.g., Matte Plastic / Brushed Aluminum / Clear Glass]\n\nReflectivity: [e.g., Low (dull reflections) / High (mirror-like)]\n\nTexture: [e.g., Smooth / Grainy / Porous]\n\nReaction to Light: [e.g., \"Should absorb light with soft highlights, no sharp glares\"]\n\nSecondary Material (if any): [e.g., Gold Foil Label / Glossy Cap]\n\nReaction to Light: [e.g., \"Should catch sharp, bright specular highlights from the environment\"]\n\nProcess:\nScene Analysis: Identify the logical ground plane/surface in Input 1.\n\nPlacement: Scale Input 2 uniformly (maintain aspect ratio) and place it on the surface.\n\nMaterial-Based Relighting:\n\nDo not simply overlay the scene colors onto the product.\nInstead, map the environment light from Input 1 onto the contours of Input 2 based on the material definitions above.\n\nExample: If the material is Matte, only the edge lighting and general ambient tone should change; do not add sharp reflections.\n\nExample: If the material is Glossy, reflect the scene's details on the surface.\n\nShadows: Generate contact shadows that match the hardness/softness of shadows in the rest of the scene.\n\nTechnical Requirements:\nAlbedo Preservation: The intrinsic color of the product (e.g., \"Brand Red\") must not be washed out by the scene's lighting color.\n\nTexture Fidelity: Do not smooth out surface details (grain, bumps) during the blending process.\n\nScaling: No non-uniform stretching.\n\nOutput: A composite where the lighting confirms the materiality of the product (e.g., makes the plastic look like plastic, not metal)."
      ]
    },
    {
      "flags": {
        "collapsed": false
      },
      "id": 15,
      "inputs": [
        {
          "link": 21,
          "name": "image1",
          "type": "IMAGE"
        },
        {
          "link": 22,
          "name": "image",
          "type": "IMAGE"
        }
      ],
      "mode": 0,
      "order": 4,
      "outputs": [
        {
          "links": [
            33
          ],
          "name": "IMAGE",
          "type": "IMAGE"
        }
      ],
      "pos": [
        -1430,
        -140
      ],
      "properties": {
        "proxyWidgets": []
      },
      "size": [
        170,
        46
      ],
      "type": "94a7e2c4-f61f-4641-a52c-758479d9b975",
      "widgets_values": []
    }
  ],
  "revision": 0,
  "version": 0.4
}