8
n8n 中文网amn8n.com

Nano Banana AI图像编辑器(Telegram版)

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 Set, Code, Telegram, HttpRequest, ConvertToFile 等节点。 通过Telegram使用的Nano Banana AI图像编辑器

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "61a48c7f-29f0-4cfe-9faf-6b8f78a79734",
      "name": "照片消息接收器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -96,
        2048
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "675d0f05-d9f6-446d-9fd1-8ad5965d1b28",
      "name": "下载 Telegram 照片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        112,
        2048
      ],
      "parameters": {
        "fileId": "={{ $('Photo Message Receiver').item.json.message.photo[0].file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "c08670f8-81f0-41b9-ac7c-bc30847e5fba",
      "name": "将照片转换为 Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        304,
        2048
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "0880f91f-0499-4ee5-a813-398156eeb3b4",
      "name": "格式化图像数据 URL",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        2048
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  const base64Url = item?.json?.data;\n  const url = `data:image/png;base64,${base64Url}`;\n  return { url };\n});\nreturn updatedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "cb1a2a0c-38d4-47e3-9463-46a1be61f28a",
      "name": "解析 AI 响应数据",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        2048
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3782b286-b6fd-4943-8530-ff922944b803",
              "name": "base",
              "type": "string",
              "value": "={{ $json.choices[0].message.images[0].image_url.url.split(',')[1] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "398dc9e7-4ff4-4fe8-bcad-aec622a9b63b",
      "name": "Base64 转二进制文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1136,
        2048
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "base"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c9cbd76a-0f2b-4d9f-aed7-0b5a0454f1fc",
      "name": "发送处理后的照片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1360,
        2048
      ],
      "parameters": {
        "chatId": "YOUR_CHAT_ID_HERE",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "408c2c7c-3e0a-4a56-baae-d1334fffbb49",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        1648
      ],
      "parameters": {
        "width": 2240,
        "height": 928,
        "content": "# 🤖 Nano Banana AI 图像编辑器"
      },
      "typeVersion": 1
    },
    {
      "id": "a04f072e-da6b-4d02-8369-556cfa728aab",
      "name": "Nano Banana 图像处理器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        2048
      ],
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/gemini-2.5-flash-image-preview:free\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"{{ $('Photo Message Receiver').item.json.message.caption }}\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"{{ $json.url }}\"\n          }\n        }\n      ]\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer $OPENROUTER_API_KEY"
            }
          ]
        },
        "nodeCredentialType": "openRouterApi"
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "Base64 to Binary File": {
      "main": [
        [
          {
            "node": "Send Processed Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Image Data URL": {
      "main": [
        [
          {
            "node": "Nano Banana Image Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response Data": {
      "main": [
        [
          {
            "node": "Base64 to Binary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Photo Message Receiver": {
      "main": [
        [
          {
            "node": "Download Telegram Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Photo to Base64": {
      "main": [
        [
          {
            "node": "Format Image Data URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Photo": {
      "main": [
        [
          {
            "node": "Convert Photo to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nano Banana Image Processor": {
      "main": [
        [
          {
            "node": "Parse AI Response Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量9
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Roshan Ramani

Roshan Ramani

@rawsun007

I love building smart n8n automations that actually work reliably. My focus is on making everyday tasks like email, social media, and CRM workflows simpler using AI. I've shared templates in the n8n community, including a WhatsApp Expense Tracker that people really enjoy. What keeps me excited is constantly trying new things - testing fresh nodes, playing with AI tools like LangChain, and discovering creative ways to connect systems!

外部链接
在 n8n.io 查看

分享此工作流