8
n8n 中文网amn8n.com

使用Gemini AI和Telegram Bot进行文本提示图像编辑

中级

这是一个自动化工作流,包含 10 个节点。主要使用 Filter, Telegram, TelegramTrigger, GoogleGemini 等节点。 使用Gemini AI和Telegram Bot进行文本提示图像编辑

前置要求
  • Telegram Bot Token

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "3d7eb9567ae690bf8c9bba1cb43396e6e40c18e15eb5889cf9673ed1713da6db",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "5dbb5361-0f1a-403a-a6d2-f8aaeebcd2c4",
      "name": "Telegram 触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1136,
        832
      ],
      "webhookId": "6c7d3559-595b-4ed7-8697-774bf86a798b",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "download": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "Elo6BLaLpBDVgeLW",
          "name": "LinkedIn Post"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "113490e2-abd8-4aa6-8b3e-58030c4d731a",
      "name": "过滤器:有标题和文件",
      "type": "n8n-nodes-base.filter",
      "position": [
        1328,
        832
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1cb10407-8c50-4e81-ac9b-72c03cab65d6",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Telegram Trigger').item.json.message.caption }}",
              "rightValue": ""
            },
            {
              "id": "cbf13e8f-7620-4db5-ba40-ecbb248c05b4",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.document.file_id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ffe1e575-905b-406b-8617-2a7a69632285",
      "name": "注释:过滤器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        624
      ],
      "parameters": {
        "color": 3,
        "width": 396,
        "height": 192,
        "content": "## 🔍 过滤器:有标题和文件"
      },
      "typeVersion": 1
    },
    {
      "id": "c12c8013-87db-412b-aca1-5e14867a46b3",
      "name": "下载图片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1520,
        832
      ],
      "webhookId": "bdfeb7a3-2126-4606-8ab0-8303cb33bda5",
      "parameters": {
        "fileId": "={{ $json.message.document.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Elo6BLaLpBDVgeLW",
          "name": "LinkedIn Post"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2995feff-c0a7-49d3-b85b-da18e37ba341",
      "name": "注释:下载图片",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        1040
      ],
      "parameters": {
        "color": 6,
        "width": 332,
        "height": 192,
        "content": "## 📥 下载图片"
      },
      "typeVersion": 1
    },
    {
      "id": "01d5b33c-5a08-4df9-9eee-293a336535d2",
      "name": "使用 AI 编辑图片",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1728,
        832
      ],
      "parameters": {
        "images": {
          "values": [
            {}
          ]
        },
        "prompt": "={{ $('Telegram Trigger').item.json.message.caption }}",
        "options": {
          "binaryPropertyOutput": "data"
        },
        "resource": "image",
        "operation": "edit"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "7v8o9EaQkl33woxm",
          "name": "v9"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b8993e29-7dd8-4cf8-9789-7bd2a3e7bf6b",
      "name": "注释:编辑 AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        592
      ],
      "parameters": {
        "color": 5,
        "width": 396,
        "height": 192,
        "content": "## 🖼️ 使用 AI 编辑图片"
      },
      "typeVersion": 1
    },
    {
      "id": "e33f9709-25b0-4a37-8aea-dd64f7fe8489",
      "name": "发送编辑后的图片",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1952,
        832
      ],
      "webhookId": "9c82fd88-d7f7-4808-aad8-21e818eb3f86",
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Elo6BLaLpBDVgeLW",
          "name": "LinkedIn Post"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c6cc872e-2396-4450-acfa-17c08ca67ec5",
      "name": "概览注释4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        432
      ],
      "parameters": {
        "color": 4,
        "width": 632,
        "height": 1176,
        "content": "# 🤖 使用 Nano-Banana Telegram 机器人的 AI 图片编辑器"
      },
      "typeVersion": 1
    },
    {
      "id": "bdce77c5-a7f3-480d-95e8-1a183eedf038",
      "name": "注释:触发器1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        1024
      ],
      "parameters": {
        "color": 6,
        "width": 332,
        "height": 192,
        "content": "## 📥 Telegram 触发器"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Download Image": {
      "main": [
        [
          {
            "node": "Edit Image with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Filter: Has Caption and File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image with AI": {
      "main": [
        [
          {
            "node": "Send Edited Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: Has Caption and File": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级

需要付费吗?

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

工作流信息
难度等级
中级
节点数量10
分类-
节点类型5
难度说明

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

作者
Daniel Nkencho

Daniel Nkencho

@daniel-automates

AI Automation Consultant | Helping Business Owners Implement AI Systems for Growth and Lead Gen

外部链接
在 n8n.io 查看

分享此工作流