{
  "name": "Create character-consistent images with FLUX Kontext & post to social via upload post",
  "nodes": [
    {
      "id": "ed7d240f-9181-4f23-9e3a-24e7886c7e31",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -180,
        0
      ]
    },
    {
      "id": "4656ae65-d58b-4126-ada3-eda97fde5c4e",
      "name": "Is Ready?",
      "type": "n8n-nodes-base.if",
      "position": [
        500,
        400
      ]
    },
    {
      "id": "f8dbc367-1052-4548-b3b8-33f6ede4d0ba",
      "name": "Check FLUX status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        340,
        400
      ]
    },
    {
      "id": "9624cdc6-1f7b-459f-b16a-eab69d23b45c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        320
      ],
      "parameters": {
        "width": 862,
        "height": 282,
        "content": "# Image processing part"
      }
    },
    {
      "id": "c6393bc7-6b7a-4a25-a524-8a7bd6b2c781",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -380,
        400
      ]
    },
    {
      "id": "4f3717a6-2580-4664-8182-efa1c8652589",
      "name": "FLUX Kontext",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        400
      ]
    },
    {
      "id": "2a48ecd4-07bc-4202-abe3-3bc0bfbfed6d",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        420,
        0
      ]
    },
    {
      "id": "cc5f96a9-ed87-4526-85c2-074dc5c8e166",
      "name": "Wait 2 sec",
      "type": "n8n-nodes-base.wait",
      "position": [
        180,
        400
      ]
    },
    {
      "id": "54cf0d0d-c3a0-4243-b425-ba8cdfaf1063",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -240
      ],
      "parameters": {
        "width": 380,
        "height": 260,
        "content": "## Define prompts here\nPrepare an array of prompts that will be used one by one on the next steps. Update limit in the `Number of Steps` node if you need more than 5 iterations."
      }
    },
    {
      "id": "add02353-b31e-4990-83ad-2d936343ab7f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        60
      ],
      "parameters": {
        "width": 380,
        "height": 220,
        "content": "## Load the initial image"
      }
    },
    {
      "id": "8367ef9f-cf00-4987-91ec-09fe3ec6918d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -420
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Initial example\n![](https://raw.githubusercontent.com/teds-tech-talks/n8n-community-leaderboard/main/_creators/eduard/mascot.png)"
      }
    },
    {
      "id": "c4a52815-ba73-4f9c-8c44-fca40cab6440",
      "name": "Get File from GitHub",
      "type": "n8n-nodes-base.github",
      "position": [
        20,
        120
      ]
    },
    {
      "id": "bb48cde8-fc79-407e-8daa-4322398d8385",
      "name": "Download Initial Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        120
      ]
    },
    {
      "id": "ffc484fe-c183-4858-8303-8733596e2afc",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        680,
        0
      ]
    },
    {
      "id": "6fbd6310-7596-4460-8a85-3cc0b1253509",
      "name": "Number of Steps",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        -120
      ]
    },
    {
      "id": "6bacc1b2-7154-428c-ab0f-76f356c59e35",
      "name": "All Prompts",
      "type": "n8n-nodes-base.set",
      "position": [
        20,
        -120
      ]
    },
    {
      "id": "913b8c79-e9ed-4221-853a-2ea6071f8c5a",
      "name": "Run FLUX",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1120,
        -100
      ]
    },
    {
      "id": "8c7089e9-45ea-4626-9c7d-01dc9df2137e",
      "name": "Current Step",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        0
      ]
    },
    {
      "id": "8eb4790f-ecf9-4136-813a-a87bd1d40edd",
      "name": "Merge3",
      "type": "n8n-nodes-base.merge",
      "position": [
        1320,
        -20
      ]
    },
    {
      "id": "49eb0be4-4ebc-48bd-a77d-20fb02779ad1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -200
      ],
      "parameters": {
        "width": 860,
        "height": 380,
        "content": "## Iterate over prompts\n- On each step a next prompt it taken from the original array\n- Outputs from the previous FLUX Kontext request are moved forward to the subsequent generation"
      }
    },
    {
      "id": "361cd8ac-29be-40a9-a5f8-d12656373c96",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        220
      ],
      "parameters": {
        "width": 260,
        "height": 280,
        "content": "## [Post several images via Upload Post](https://www.upload-post.com/?linkId=lp_144414&sourceId=post-now&tenantId=upload-post-app)\n[Click to create your own account](https://www.upload-post.com/?linkI"
      }
    },
    {
      "id": "af34e5a7-d1cc-446f-a210-5aa96c271640",
      "name": "Upload Post",
      "type": "n8n-nodes-upload-post.uploadPost",
      "position": [
        1120,
        340
      ]
    },
    {
      "id": "32836601-6a7d-4e1a-9fc4-74d6f5f78187",
      "name": "Image to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -200,
        400
      ]
    },
    {
      "id": "d40118c7-0ab6-4276-b733-22419e5521d6",
      "name": "Get Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        400
      ]
    },
    {
      "id": "e35f7544-b687-4ee5-a59f-3f98d26b1d12",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -620
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Step 1\n![](https://pbs.twimg.com/media/Gs7SwU_XYAASZBn?format=jpg&name=medium)"
      }
    },
    {
      "id": "230498f5-69f5-4282-bb25-854720b1d536",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        -620
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Step 2\n![](https://pbs.twimg.com/media/Gs7SwovWQAAncQT?format=jpg&name=medium)"
      }
    },
    {
      "id": "425c3696-4532-401e-8131-78553358c8c8",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        -620
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Step 3\n![](https://pbs.twimg.com/media/Gs7SxHsXYAAkhPF?format=jpg&name=medium)"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Current Step",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge3": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run FLUX": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Ready?": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 2 sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 sec": {
      "main": [
        [
          {
            "node": "Check FLUX status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "All Prompts": {
      "main": [
        [
          {
            "node": "Number of Steps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Current Step": {
      "main": [
        [
          {
            "node": "Run FLUX",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge3",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "FLUX Kontext": {
      "main": [
        [
          {
            "node": "Wait 2 sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image to Base64": {
      "main": [
        [
          {
            "node": "FLUX Kontext",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Number of Steps": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check FLUX status": {
      "main": [
        [
          {
            "node": "Is Ready?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File from GitHub": {
      "main": [
        [
          {
            "node": "Download Initial Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Initial Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Image to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get File from GitHub",
            "type": "main",
            "index": 0
          },
          {
            "node": "All Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}