{
  "name": "Generate images with realistic inpainting using Simbrams Ri AI",
  "nodes": [
    {
      "id": "78c6eede-65a8-4f0e-86a9-a4a4faa6ade9",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -416,
        -192
      ]
    },
    {
      "id": "39899545-740f-45eb-a325-c01352512fb7",
      "name": "Set API Key",
      "type": "n8n-nodes-base.set",
      "position": [
        -208,
        -192
      ]
    },
    {
      "id": "4d417d50-2ca9-4183-8d53-f2abfc099ce6",
      "name": "Create Prediction",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        -192
      ]
    },
    {
      "id": "2a20626f-9dee-4d8c-a89d-6072cb95288d",
      "name": "Extract Prediction ID",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        -192
      ]
    },
    {
      "id": "23999701-4f37-4f44-af5e-f22930f20cea",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        464,
        -192
      ]
    },
    {
      "id": "1c024d8b-df2f-4dbf-823f-1576530b1ef2",
      "name": "Check Prediction Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        688,
        -192
      ]
    },
    {
      "id": "31b34b8e-9ff3-487f-af3c-ee55c1b10505",
      "name": "Check If Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        912,
        -192
      ]
    },
    {
      "id": "b43dccd2-aa67-46a3-a8b3-03d4564c96fe",
      "name": "Process Result",
      "type": "n8n-nodes-base.code",
      "position": [
        1168,
        -304
      ]
    },
    {
      "id": "4317bcbb-507a-4860-88e1-b84582dce079",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -736
      ],
      "parameters": {
        "width": 438,
        "height": 751,
        "content": "## 📌 Section 1: Trigger & Authentication\n\n### ⚡ On Clicking ‘Execute’ (Manual Trigger)\n\n* **Purpose**: Starts the workflow manually.\n* **Benefit**: Useful for testing and running on demand.\n\n### 🔑 Set"
      }
    },
    {
      "id": "9bbe9a46-4abb-4b4c-a6e2-ac9d39d199b2",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        -928
      ],
      "parameters": {
        "width": 1300,
        "height": 320,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tip"
      }
    },
    {
      "id": "acc9ee21-e337-4d97-84ca-766367765af0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        -592
      ],
      "parameters": {
        "width": 1289,
        "height": 2590,
        "content": "# Generate Images with Realistic Inpainting using Simbrams Ri AI\n\nThis n8n workflow integrates with **Replicate’s `simbrams/ri` model** to generate images. It takes an input image and mask, applies tr"
      }
    },
    {
      "id": "aec13325-a44c-4237-8847-ac5f72c05dca",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -912
      ],
      "parameters": {
        "width": 422,
        "height": 927,
        "content": "## 📌 Section 2: Sending the Image Generation Request\n\n### 🖼️ Create Prediction (HTTP Request Node)\n\n* **Purpose**: Sends a POST request to Replicate’s API to start generating an image.\n* **Input Param"
      }
    },
    {
      "id": "f9fbe6b7-da48-41c7-9a4b-9453f0fca6b7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        -816
      ],
      "parameters": {
        "width": 598,
        "height": 831,
        "content": "## 📌 Section 3: Polling & Waiting\n\n### ⏳ Wait (Wait Node)\n\n* **Purpose**: Pauses the workflow for 2 seconds before rechecking.\n* **Benefit**: Prevents hitting Replicate’s API too quickly.\n\n### 🔄 Check"
      }
    },
    {
      "id": "96b87521-c75e-44b4-a7a9-048762dd27af",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -848
      ],
      "parameters": {
        "width": 326,
        "height": 863,
        "content": "## 📌 Section 4: Processing the Result\n\n### 📦 Process Result (Code Node)\n\n* **Purpose**: Cleans up the completed API response and extracts:\n\n  * Status\n  * Output (final generated image)\n  * Metrics\n  "
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Check Prediction Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Key": {
      "main": [
        [
          {
            "node": "Create Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Complete": {
      "main": [
        [
          {
            "node": "Process Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Prediction": {
      "main": [
        [
          {
            "node": "Extract Prediction ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Prediction ID": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Set API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Prediction Status": {
      "main": [
        [
          {
            "node": "Check If Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}