{
  "name": "Free AI image generator - n8n automation workflow with Gemini/ChatGPT",
  "nodes": [
    {
      "id": "d5d1fe1b-f053-4162-adf4-5b52b409942d",
      "name": "Fields - Set Values",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        100
      ]
    },
    {
      "id": "e108c56f-b7fb-4818-aed5-c55c59b81516",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        20,
        200
      ]
    },
    {
      "id": "7565ff7c-cfe7-4157-953b-74c1e66d659e",
      "name": "Code - Clean Json",
      "type": "n8n-nodes-base.code",
      "position": [
        980,
        100
      ]
    },
    {
      "id": "8e33813d-bd34-46b9-91c8-89dac7f28add",
      "name": "Code - Get Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        1160,
        100
      ]
    },
    {
      "id": "fba88baa-70e8-452c-b44e-d1685df0eb7d",
      "name": "HTTP Request - Create Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1600,
        100
      ]
    },
    {
      "id": "25617f21-8d05-4ca2-9c16-5cd97e369bdb",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        20,
        0
      ]
    },
    {
      "id": "de666684-e743-40ef-b604-1cff33b107de",
      "name": "Code - Set Filename",
      "type": "n8n-nodes-base.code",
      "position": [
        1320,
        100
      ]
    },
    {
      "id": "e04c2a46-a670-4042-88d1-79207731c864",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        540,
        300
      ]
    },
    {
      "id": "d2d0e95d-797e-473c-a70f-d8c4cccd32af",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        -760
      ],
      "parameters": {
        "width": 520,
        "height": 1480,
        "content": "## [Agent Circle's N8N Workflow] Automated AI Image Creator - Try It Out!\n\n**This n8n template demonstrates how to use AI to generate custom images from scratch - fully automated, prompt-driven, and r"
      }
    },
    {
      "id": "cb6fb57a-e3c1-45ff-9b81-4a2152f397fc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -200
      ],
      "parameters": {
        "width": 440,
        "height": 620,
        "content": "## **1. Get The Inputs**\nWe’ll take your image idea from the text you send in the chat, along with any settings like image size or style. This information is parsed and prepared for the image generati"
      }
    },
    {
      "id": "876439a4-dbfe-4394-96d7-8f6c8a63778d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -200
      ],
      "parameters": {
        "width": 420,
        "height": 620,
        "content": "## **2. Use Google Gemini's Image Model To Generate The Image**\nYour prompt and settings are sent to Google Gemini’s Image Generation Model.\nPrefer a different model? You can easily swap in alternativ"
      }
    },
    {
      "id": "ac07f44c-c881-4d80-bd65-a8aa0ce39375",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1540,
        -200
      ],
      "parameters": {
        "width": 540,
        "height": 620,
        "content": "## **4. Preview And Save The Image**\nOnce your image is ready in a downloadable format, you’ll be able to preview it. If you're happy with the result, you can save it in one of two ways by activating "
      }
    },
    {
      "id": "fdd981c2-2659-4a31-b37f-b5c4cd51ee3c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -200
      ],
      "parameters": {
        "width": 520,
        "height": 620,
        "content": "## **3. Prepare The Final Image Feasible For Preview And Saving**\nThis stage helps to clean up the raw output from the AI Agent for your image request and format it into a complete, ready-to-view and "
      }
    },
    {
      "id": "3a150703-2a7f-4255-9da0-6a15c005290c",
      "name": "AI Agent - Create Image From Prompt",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        540,
        100
      ]
    },
    {
      "id": "a3e5fa40-51c1-41fa-83cb-d6d598f1ff49",
      "name": "Telegram Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1820,
        0
      ]
    },
    {
      "id": "f7059ea5-106b-4b73-8cb3-b0e10e1c0c13",
      "name": "Save Image To Disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1820,
        200
      ]
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Fields - Set Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Clean Json": {
      "main": [
        [
          {
            "node": "Code - Get Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Get Prompt": {
      "main": [
        [
          {
            "node": "Code - Set Filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Set Filename": {
      "main": [
        [
          {
            "node": "HTTP Request - Create Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fields - Set Values": {
      "main": [
        [
          {
            "node": "AI Agent - Create Image From Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Create Image From Prompt",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Fields - Set Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request - Create Image": {
      "main": [
        [
          {
            "node": "Save Image To Disk",
            "type": "main",
            "index": 0
          },
          {
            "node": "Telegram Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Create Image From Prompt": {
      "main": [
        [
          {
            "node": "Code - Clean Json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}