{
  "name": "Build an image restoration service with n8n & Gemini AI image editing",
  "nodes": [
    {
      "id": "b6a5c37d-b845-4fd2-8ea3-db23aed99286",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -80,
        320
      ]
    },
    {
      "id": "1f363fc5-42cf-4e9c-ae74-496030362ed9",
      "name": "Sample Images",
      "type": "n8n-nodes-base.set",
      "position": [
        120,
        320
      ]
    },
    {
      "id": "e078aba0-2f2b-47b5-90b2-c457184e6237",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        320,
        320
      ]
    },
    {
      "id": "a0fbf72b-d079-4777-be06-531e0e131857",
      "name": "Download Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        520,
        320
      ]
    },
    {
      "id": "77f0d0c7-e6bd-4f15-beff-9cb53446fcb0",
      "name": "Gemini Image Restoration",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1100,
        320
      ]
    },
    {
      "id": "6aebcc29-a65d-4cb9-8d6a-56f24b58c7f5",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        720,
        320
      ]
    },
    {
      "id": "1c50d319-1771-408f-9015-f04bb6a3d305",
      "name": "Get Image Contents",
      "type": "n8n-nodes-base.set",
      "position": [
        1340,
        320
      ]
    },
    {
      "id": "c19074f0-45a1-42bd-b25f-966f26ef5ef5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2220,
        -200
      ],
      "parameters": {
        "width": 700,
        "height": 320,
        "content": "|Original|Restored|\n|-|-|\n|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/l8b3j1sf6ejx73z0awsh)|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_aut"
      }
    },
    {
      "id": "82e82d53-e5ff-44a2-96ca-1867058fbb65",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        80
      ],
      "parameters": {
        "width": 1060,
        "height": 460,
        "content": "## 1. Download Sample Images\n[Read more about the HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)\n\nFor this demonstration, we'll download 3 sample v"
      }
    },
    {
      "id": "eb1f70d5-2d3f-4f22-badb-d49569f565c2",
      "name": "Upload to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1960,
        320
      ]
    },
    {
      "id": "4f980d9d-a993-4ec6-80fd-1a323e40822d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        80
      ],
      "parameters": {
        "width": 620,
        "height": 460,
        "content": "## 2. Use Gemini LLM to Restore Damaged Images\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\nText-and-image-t"
      }
    },
    {
      "id": "69f7f355-5443-4265-b2a1-901711fa93dd",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1720,
        320
      ]
    },
    {
      "id": "beae9111-8186-4afd-9fa6-c732f0229854",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        80
      ],
      "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": "00aaa458-1c49-4adf-87d6-ea70309107f9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -380
      ],
      "parameters": {
        "width": 460,
        "height": 920,
        "content": "## Try It Out!\n### This n8n template demonstrates how to build a simple but effective vintage image restoration service using an AI model with image editing capabilities.\n\nWith Gemini now capable of m"
      }
    },
    {
      "id": "4e4b822b-983b-48d2-a319-68242b7af171",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        580
      ],
      "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"
      }
    },
    {
      "id": "24d74843-d9b5-4302-8136-159e0a7dd492",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2220,
        140
      ],
      "parameters": {
        "width": 400,
        "height": 440,
        "content": "|Original|Restored|\n|-|-|\n|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/htrjbmiozdrvxwdsreyt)|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_aut"
      }
    },
    {
      "id": "f77ed90e-70ca-4268-9c77-17e49f94a4bb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        140
      ],
      "parameters": {
        "width": 580,
        "height": 300,
        "content": "|Original|Restored|\n|-|-|\n|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_auto/v1/n8n-workflows/ykftgxpozp2pr4sxpuoy)|![](https://res.cloudinary.com/daglih2g8/image/upload/f_auto,q_aut"
      }
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sample Images": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Gemini Image Restoration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Contents": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Image Restoration": {
      "main": [
        [
          {
            "node": "Get Image Contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Sample Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}