8
n8n 한국어amn8n.com

APImage를 사용하여 AI 이미지 생성 및 Google Drive에 업로드

고급

이것은Content Creation, Multimodal AI분야의자동화 워크플로우로, 22개의 노드를 포함합니다.주로 If, Set, Telegram, Aggregate, AimlApi 등의 노드를 사용하며. Telegram에서 GPT-4o를 사용하여 Flux Pro와 함께 AI 이미지 강화 생성

사전 요구사항
  • Telegram Bot Token
  • 대상 API의 인증 정보가 필요할 수 있음
  • Google Sheets API 인증 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "29cf227651b207fca8739269056bd8f95a432c5e246ffae4aaf9220581f6fe53",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "339179e6-1f09-435f-9b5e-c85dc3d9ed98",
      "name": "📩 Telegram 메시지 수신",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -208,
        0
      ],
      "webhookId": "3ceea664-fd53-4141-8bc6-4fdaca0a661d",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "QcfQneMUvIojzFQz",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "38840cb5-dd2d-4e2c-87c0-e57b6064294c",
      "name": "📊 사용 로그 조회",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        16,
        0
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": false
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.message.from.id }}",
              "lookupColumn": "user_id"
            },
            {
              "lookupValue": "={{ new Date().toISOString().slice(0,10) }}",
              "lookupColumn": "date"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2060422727,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg/edit#gid=2060422727",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg/edit?usp=drivesdk",
          "cachedResultName": "Image bot usage statistic"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "FAqNqtaHmPjIXEtc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "31ef4475-8a58-4dd8-850c-cfe2bbfc3ad7",
      "name": "📈 오늘 요청 수 계산",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        240,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "67f85ddc-9bcf-4c35-81a1-5a0e1f5d30a6",
      "name": "🔢 일일 제한 설정",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1514c5a1-1bd4-4ba2-8bb9-30c679ae4f8e",
              "name": "daily_limit",
              "type": "number",
              "value": 5
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "19a8f732-f6e0-4134-84fc-dfd7e14c7812",
      "name": "🚦 제한 초과 확인?",
      "type": "n8n-nodes-base.if",
      "position": [
        688,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "08e8aac4-9f6a-4fc0-b1ad-7d8493ff74bf",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{$('📈 Count Today’s Requests').item.json.data.length }}",
              "rightValue": "={{ $json.daily_limit }}"
            }
          ]
        }
      },
      "executeOnce": false,
      "typeVersion": 2.2
    },
    {
      "id": "47ff6a8c-8a13-41f1-8847-7bb50c63014e",
      "name": "🚫 알림: 제한 초과",
      "type": "n8n-nodes-base.telegram",
      "position": [
        912,
        112
      ],
      "webhookId": "bb58ce7a-45e5-42d1-a780-7cc47f7402b1",
      "parameters": {
        "text": "=Sorry! Your *daily limit of {{ $('🔢 Set Daily Limit').item.json.daily_limit }} generations* is exceeded!",
        "chatId": "={{ $('📩 Receive Telegram Message').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "QcfQneMUvIojzFQz",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "900536f7-d366-45a9-bafb-2fae6c1c0065",
      "name": "📝 성공적 생성 기록",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1808,
        -96
      ],
      "parameters": {
        "columns": {
          "value": {
            "date": "={{ new Date().toISOString().slice(0,10) }}",
            "query": "={{ $('📩 Receive Telegram Message').item.json.message.text }}",
            "user_id": "={{ $('📩 Receive Telegram Message').item.json.message.from.id }}",
            "result_url": "={{ $('🎨 Generate Image (AI/ML API | flux-pro)').item.json.images[0].url }}"
          },
          "schema": [
            {
              "id": "user_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "user_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "query",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "result_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "result_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "user_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 2060422727,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg/edit#gid=2060422727",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RHgZNdT0whop0JY3vrj83yLtmVluG73NIfLBBa8ckPg/edit?usp=drivesdk",
          "cachedResultName": "Image bot usage statistic"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "FAqNqtaHmPjIXEtc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "70630f26-3817-41f6-94ee-4f479ad15afe",
      "name": "🎨 이미지 생성 (AI/ML API | flux-pro)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1136,
        -96
      ],
      "parameters": {
        "url": "https://api.aimlapi.com/v1/images/generations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "flux-pro"
            },
            {
              "name": "prompt",
              "value": "={{ $json.content }}"
            },
            {
              "name": "n",
              "value": "1"
            },
            {
              "name": "size",
              "value": "1024x1024"
            },
            {
              "name": "response_formats",
              "value": "=1"
            }
          ]
        },
        "nodeCredentialType": "aimlApi"
      },
      "credentials": {
        "aimlApi": {
          "id": "fzkUXwSArkMtWVYd",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a47d6a9b-9ca6-4716-9083-d43b666da2e0",
      "name": "🧠 프롬프트 향상 (AI/ML API | GPT-4o)",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        912,
        -96
      ],
      "parameters": {
        "model": "openai/gpt-4o",
        "prompt": "=You are a prompt enhancer for AI image generation. Your task is to take the user's input and return only an improved version of the prompt. Do not include any explanations, introductions, or formatting. Output only the final prompt, nothing else.\n\n🧠 The user’s message is taken as the foundation for visual content generation. This input is then carefully analyzed, enriched, and transformed into a more expressive, structured, and detailed prompt. The purpose of this enhancement is to guide the AI model more effectively, resulting in an image that better matches the user's intent and imagination.\n\n✏️ Original user input:\n{{ $('📩 Receive Telegram Message').item.json.message.text }}",
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "aimlApi": {
          "id": "fzkUXwSArkMtWVYd",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dcffa91d-a4c7-4851-9bdb-85552f4420e5",
      "name": "🖋 이미지 설명 작성 (AI/ML API | GPT-4o)",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        1360,
        -96
      ],
      "parameters": {
        "model": "openai/gpt-4o",
        "prompt": "=Write a vivid and visually rich description for an AI-generated image, starting with the phrase: \"Here’s your image:\". The description should reflect the result of the prompt below, as if the image already exists.\n\nPrompt:\n\"{{ $json.prompt }}\"\n\nAvoid repeating the prompt verbatim. Use expressive language and sensory detail. Keep it to 1–2 elegant sentences.\n",
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "aimlApi": {
          "id": "fzkUXwSArkMtWVYd",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "560a50a5-a96a-48b2-ab1e-1f6f0bcf2a15",
      "name": "📤 사용자에게 이미지 전송",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1584,
        -96
      ],
      "webhookId": "4a46da0a-9a91-4f31-802a-f0ce89516aa7",
      "parameters": {
        "file": "={{ $('🎨 Generate Image (AI/ML API | flux-pro)').item.json.images[0].url }}",
        "chatId": "={{ $('📩 Receive Telegram Message').item.json.message.chat.id }}",
        "operation": "sendPhoto",
        "additionalFields": {
          "caption": "={{ $json.content }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "QcfQneMUvIojzFQz",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1fed89b3-457f-457e-ba5d-13f209a63cd4",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 224,
        "height": 336,
        "content": "## Incoming Message\n### Handle incoming user messages from Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "3623d8a3-1933-4809-ab5b-ed54f039f116",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -160
      ],
      "parameters": {
        "width": 864,
        "height": 336,
        "content": "##  Usage Limit Check\n### Check how many times the user has generated today and enforce the daily limit.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a34ed607-47b0-4966-a11f-7298c41b4223",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -256
      ],
      "parameters": {
        "color": 6,
        "width": 208,
        "height": 336,
        "content": "##  Prompt Enhancement\n### Use LLM to rewrite the user's input into a rich and detailed prompt.\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "02a9f22d-a4d4-4deb-8ed1-4818a9ddf198",
      "name": "스티키 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -256
      ],
      "parameters": {
        "color": 6,
        "width": 208,
        "height": 336,
        "content": "##  Image Generation\n### Generate an image using the enhanced prompt via AIMLAPI.\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "31f52e39-80dc-45d5-9ef8-7c96d55b81a0",
      "name": "스티키 노트4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -256
      ],
      "parameters": {
        "color": 6,
        "width": 208,
        "height": 336,
        "content": "##  Image Description\n### Create a vivid description of the generated image using LLM.\n\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d923875c-b2d0-4804-8050-5b8daa2aaad8",
      "name": "스티키 노트5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        -256
      ],
      "parameters": {
        "color": 4,
        "width": 416,
        "height": 336,
        "content": "## Delivery & Logging\n### Send the final image and caption to the user, and log the result to Google Sheets.\n\n\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "46afbb51-ec45-49b2-b6b1-c3333328edf1",
      "name": "스티키 노트6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        96
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 352,
        "content": "\n\n---\n\n\n---\n\n\n---\n\n\n---\n\n\n---\n\n\n##  Notify: Limit Exceeded\n### Notify the user that the daily generation limit has been reached\n\n\n \n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "53ac8095-8518-465d-bc4c-965a7110bd78",
      "name": "스티키 노트8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -1904
      ],
      "parameters": {
        "color": 5,
        "width": 560,
        "height": 608,
        "content": "# 🧠 AI Image Generator Bot — Telegram + AIMLAPI (via n8n)\n\nThis workflow lets users generate AI images by messaging a Telegram bot. Each user has a **daily limit**, tracked using **Google Sheets**. Prompts are enhanced and images are generated using **AIMLAPI**.\n\n---\n\n## 🚀 Features\n\n* Text-to-image generation via `flux-pro` model\n* Prompt enhancement with GPT-4o\n* Descriptive captions for each image\n* Telegram delivery\n* Daily usage tracking and limiting\n* Logging all activity in Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "56bb2e61-b024-4e87-9471-7f379e9ee6b9",
      "name": "스티키 노트9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -1280
      ],
      "parameters": {
        "color": 5,
        "width": 560,
        "height": 736,
        "content": "## ⚙️ Customization\n\n* `Set Daily Limit` node controls the number of free generations\n* You can add:\n\n  * NSFW filtering\n  * Dynamic model selection\n  * `/help` or `/history` commands\n\n---\n\n## 💡 Example User Flow\n\n1. User sends:\n\n   ```\n   a dragon flying above New York at night\n   ```\n\n2. Bot replies:\n\n   > **Here’s your image:**\n   > A crimson dragon soars through moonlit clouds over Manhattan, its wings glowing against the skyline.\n\n> 3. Image is generated and sent\n"
      },
      "typeVersion": 1
    },
    {
      "id": "352ebd4e-5f9e-44b7-8802-2fcf323ca0ad",
      "name": "스티키 노트10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -1808
      ],
      "parameters": {
        "color": 5,
        "width": 560,
        "height": 912,
        "content": "\n# 🛠 Setup Guide\n\n### 1. 📲 Create a Telegram Bot\n\n* Go to [@BotFather](https://t.me/BotFather)\n* Use `/newbot`, set a name and username\n* Save the **API token**\n\n---\n\n### 2. 🔐 Connect Telegram API in n8n\n\n* Go to `Credentials > Telegram API`\n* Create new credentials using the token from BotFather\n\n---\n\n### 3. 📗 Create a Google Sheet\n\n* Add a sheet named `Sheet1`\n\n* Use these columns as headers:\n\n  ```\n  user_id | date | query | result_url\n  ```\n\n* Share it with your Google service account or OAuth user\n  (depends on how you authenticate Google Sheets in n8n)\n\n---\n\n### 4. 🔌 Set Up Credentials in n8n\n\n* **Google Sheets:** OAuth2 or service account\n* **AIMLAPI:** Use your API key in `AI/ML API` credentials\n\n  * Base URL: `https://api.aimlapi.com/v1`\n  * Docs: [docs.aimlapi.com](https://docs.aimlapi.com)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "63074211-fe01-4947-9ffd-f45baab48fbd",
      "name": "스티키 노트11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -880
      ],
      "parameters": {
        "color": 5,
        "width": 560,
        "height": 336,
        "content": "## 📁 Data Logged\n\nEach generation is saved to Google Sheets:\n\n` | user_id | date | query | result_url | `\n` | ------- | ---- | ----- | ---------- | `\n\n\n## 🧪 Testing Tips\n\n* Use a test Telegram chat\n* Add `Console` or `Set` nodes to inspect payloads\n* Test the workflow using `/execute` from Telegram, **not \"Execute Node\"**, if you're using static data\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "67f85ddc-9bcf-4c35-81a1-5a0e1f5d30a6": {
      "main": [
        [
          {
            "node": "19a8f732-f6e0-4134-84fc-dfd7e14c7812",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "38840cb5-dd2d-4e2c-87c0-e57b6064294c": {
      "main": [
        [
          {
            "node": "31ef4475-8a58-4dd8-850c-cfe2bbfc3ad7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "560a50a5-a96a-48b2-ab1e-1f6f0bcf2a15": {
      "main": [
        [
          {
            "node": "900536f7-d366-45a9-bafb-2fae6c1c0065",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "19a8f732-f6e0-4134-84fc-dfd7e14c7812": {
      "main": [
        [
          {
            "node": "a47d6a9b-9ca6-4716-9083-d43b666da2e0",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "47ff6a8c-8a13-41f1-8847-7bb50c63014e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "31ef4475-8a58-4dd8-850c-cfe2bbfc3ad7": {
      "main": [
        [
          {
            "node": "67f85ddc-9bcf-4c35-81a1-5a0e1f5d30a6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "339179e6-1f09-435f-9b5e-c85dc3d9ed98": {
      "main": [
        [
          {
            "node": "38840cb5-dd2d-4e2c-87c0-e57b6064294c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "900536f7-d366-45a9-bafb-2fae6c1c0065": {
      "main": [
        []
      ]
    },
    "dcffa91d-a4c7-4851-9bdb-85552f4420e5": {
      "main": [
        [
          {
            "node": "560a50a5-a96a-48b2-ab1e-1f6f0bcf2a15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a47d6a9b-9ca6-4716-9083-d43b666da2e0": {
      "main": [
        [
          {
            "node": "70630f26-3817-41f6-94ee-4f479ad15afe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "70630f26-3817-41f6-94ee-4f479ad15afe": {
      "main": [
        [
          {
            "node": "dcffa91d-a4c7-4851-9bdb-85552f4420e5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 콘텐츠 제작, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수22
카테고리2
노드 유형9
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34