{
  "name": "Compose/Stitch separate images together using n8n & Gemini AI image editing",
  "nodes": [
    {
      "id": "bd94ff7b-0f66-45f7-bbab-bb2be0406532",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -540,
        320
      ]
    },
    {
      "id": "fdd66c07-8168-4f94-8ff5-ba4ceed476a9",
      "name": "Get Image Contents",
      "type": "n8n-nodes-base.set",
      "position": [
        1400,
        320
      ]
    },
    {
      "id": "e23db650-d0fa-4d87-87ea-3ab2e78292d8",
      "name": "Upload to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2020,
        320
      ]
    },
    {
      "id": "0a8bd3f0-a6e9-4862-942c-20ce336ab24e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1020,
        60
      ],
      "parameters": {
        "width": 640,
        "height": 460,
        "content": "## 2. Use Gemini LLM to Compose Images Together\n[Read more about Gemini's Text and Image to Image Editing](https://ai.google.dev/gemini-api/docs/image-generation#gemini-image-editing)\n\nComposing or \"S"
      }
    },
    {
      "id": "8a87bcea-7b60-46d8-9070-380397d9d0d8",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1820,
        320
      ]
    },
    {
      "id": "0ea0a3bf-e4fb-4beb-8a02-405602e17558",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        60
      ],
      "parameters": {
        "width": 560,
        "height": 460,
        "content": "## 3. Upload to Google Drive\n[Read more about Google Drive node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledrive)\n\nGemini outputs the image data as a base64 string so con"
      }
    },
    {
      "id": "f6f9410f-f3ef-4b7b-88fe-774c30fe4e29",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        600,
        320
      ]
    },
    {
      "id": "c41e5653-bd37-4b17-9226-e9edf3d58899",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        380,
        320
      ]
    },
    {
      "id": "0fe5cc27-e378-4a62-8477-1b666c4dcbe6",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        820,
        320
      ]
    },
    {
      "id": "cd489b5f-0447-4d3e-84d1-a22142d02708",
      "name": "Character",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -300,
        120
      ]
    },
    {
      "id": "74e05106-26c0-4d59-adf9-274f2a1ddd7b",
      "name": "Dalmation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -180,
        320
      ]
    },
    {
      "id": "2bd84982-3984-4c22-a3de-0c871f5bc2ea",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2300,
        60
      ],
      "parameters": {
        "width": 480,
        "height": 540,
        "content": "## Final Output\n![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/rrezma7shzwffosy5apn#full-width)"
      }
    },
    {
      "id": "4e3155bf-983b-46b4-b6cb-38278edc34fb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -180
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "## Character\n![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/qwitjyhejockuxfvkk5g#full-width)"
      }
    },
    {
      "id": "01486147-0ddf-4055-9ebf-5bc6a884852c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        120
      ],
      "parameters": {
        "width": null,
        "height": 300,
        "content": "## Dalmation\n![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/gxcc0xnghpbthwt8fpec#full-width)"
      }
    },
    {
      "id": "e2153852-33b3-41dc-adcf-122027ada5a6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        520
      ],
      "parameters": {
        "width": null,
        "height": 300,
        "content": "## Sofa\n![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/nyghscauxtcfl4dve6of#full-width)"
      }
    },
    {
      "id": "510619c4-1e9c-4466-95f1-5eaa72d6ecc5",
      "name": "Sofa",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        100,
        520
      ]
    },
    {
      "id": "522cdb05-558c-4bd4-a4af-1a400bc641f9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        60
      ],
      "parameters": {
        "width": 680,
        "height": 460,
        "content": "## 1. Convert Separate Images to Base64 Strings\n[Read more about the Extract from File node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile)\n\nTo use our images in t"
      }
    },
    {
      "id": "ce28bdf0-a03e-486c-9dd4-2aeb0896519e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        -220
      ],
      "parameters": {
        "width": 460,
        "height": 960,
        "content": "## Try It Out!\n### This n8n template demonstrates how to use AI to compose or \"stitch\" separate images together to generate a new image which retains the source assets and consistent style.\n\nUse cases"
      }
    },
    {
      "id": "086cae2e-3b21-4262-917d-9d9f261d20d6",
      "name": "Gemini Image Compose",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        320
      ]
    },
    {
      "id": "48127e5f-441a-4c46-9c96-3953e26ae092",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1080,
        760
      ],
      "parameters": {
        "width": 460,
        "height": 140,
        "content": "### Geo Restrictions!\nPlease note at time of writing, the Gemini Image Generation model is restricted to certain countries and regions. If you're getting model not found errors, it's possible the mode"
      }
    }
  ],
  "connections": {
    "Sofa": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dalmation": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Gemini Image Compose",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Contents": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Image Compose": {
      "main": [
        [
          {
            "node": "Get Image Contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Dalmation",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sofa",
            "type": "main",
            "index": 0
          },
          {
            "node": "Character",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}