8
n8n 中文网amn8n.com

通过Telegram使用Nano Banana和Veo 3.1的产品视频创建器

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 If, Code, Wait, Merge, Telegram 等节点。 通过Telegram使用Nano Banana和Veo 3.1的产品视频创建器

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "YOUR_N8N_INSTANCE_ID",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "9844b3ab-8ce5-49b8-b6bb-c076b62e3de1",
      "name": "图像转Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -2528,
        192
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "d91f3b12-0fea-4a24-90fc-165d2e8dc908",
      "name": "AI设计分析",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -2528,
        384
      ],
      "parameters": {
        "text": "=You are an expert product photographer and advertising creative director. Analyze the uploaded product image and its caption: {{ $('Telegram Trigger Received').item.json.message.caption }}\n\nYour task is to create a detailed image generation prompt that will transform this product photo into a premium, commercial-grade advertisement visual.\n\nANALYSIS REQUIREMENTS:\n1. **Product Identification**: Identify the product type, size, category, material, color scheme, and key features\n2. **Current State Assessment**: Note the current lighting, background, composition, and quality issues\n3. **Target Aesthetic**: Determine the ideal advertising style based on product category (luxury, tech, food, fashion, etc.)\n\nOUTPUT (Strict JSON format):\n{\n  \"product_analysis\": {\n    \"type\": \"Detailed product category and specific item\",\n    \"size\": \"Estimated dimensions or scale\",\n    \"material\": \"Primary materials and textures\",\n    \"color_palette\": \"Dominant colors in the product\",\n    \"current_issues\": \"List any quality problems in original image\"\n  },\n  \n  \"image_generation_prompt\": \"Create a hyper-detailed prompt (500+ words) for generating the perfect product advertisement:\n\nPRODUCT PLACEMENT: [Describe exact positioning - centered, rule of thirds, etc. Keep product 100% identical to original]\n\nLIGHTING SETUP: \n- Key light: [direction, intensity, color temperature]\n- Fill light: [softness, position, ratio]\n- Rim/edge lighting: [accent placement]\n- Background light: [separation and depth]\n- Overall mood: [bright/moody/dramatic with specific color temperatures]\n\nBACKGROUND & ENVIRONMENT:\n- Style: [minimalist studio/lifestyle scene/luxury setting]\n- Surface: [marble/concrete/wood/fabric texture]\n- Color scheme: [complementary or analogous to product]\n- Props: [if any, subtle and relevant]\n- Depth: [bokeh, gradient, shadows for dimension]\n\nCOMPOSITION DETAILS:\n- Framing: [16:9 landscape, tight/medium/wide shot]\n- Focal point: [product positioning for visual hierarchy]\n- Negative space: [strategic empty areas]\n- Visual flow: [leading lines, eye movement path]\n\nCOLOR GRADING & POST-PROCESSING:\n- Product color: [enhance vibrancy by X%, specific adjustments]\n- Background treatment: [saturation, tone, contrast]\n- Shadow tint: [cool/warm, specific color]\n- Highlight treatment: [golden hour glow, crisp whites]\n- Overall contrast: [percentage increase]\n- Film style: [if applicable - cinematic, clean, vintage]\n\nVISUAL EFFECTS:\n- Depth of field: [f-stop equivalent blur]\n- Reflections: [surface reflections if relevant]\n- Particles/atmosphere: [dust motes, mist, light rays]\n- Glow/halo: [subtle rim light effect]\n- Shadows: [soft/hard, direction, opacity]\n\nSTYLE REFERENCES:\n- Match the aesthetic of: [Apple, Nike, luxury cosmetics, food photography, etc.]\n- Platform optimization: [Instagram, Pinterest, e-commerce]\n- Commercial quality: [editorial, catalog, hero shot]\n\nTECHNICAL SPECIFICATIONS:\n- Aspect ratio: 16:9 horizontal\n- Resolution: High-res, sharp focus on product\n- Camera angle: [eye-level/slightly above/dramatic low angle]\n- Lens effect: [50mm equivalent, 85mm portrait, macro detail]\n\nCRITICAL RULES:\n- Keep original product EXACTLY as is - no modifications\n- Professional studio photography quality\n- Ensure product is clearly visible and hero element\n- Create scroll-stopping visual appeal\n- Balance artistry with commercial clarity\"\n}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash-lite",
          "cachedResultName": "models/gemini-2.5-flash-lite"
        },
        "options": {},
        "resource": "image",
        "inputType": "binary",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_GEMINI_CREDENTIAL_ID",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1db14467-6fc9-43ec-a347-98bfce50a3d3",
      "name": "合并图像与分析",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2208,
        288
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "3ba57f26-ceb1-4a01-bf85-b302e985c26e",
      "name": "准备API负载",
      "type": "n8n-nodes-base.code",
      "position": [
        -2000,
        288
      ],
      "parameters": {
        "jsCode": "// Collect all items from both inputs\nconst input1 = $items(\"Combine Image & Analysis\").map(i => i.json);\nconst input2 = $items(\"Combine Image & Analysis\").map(i => i.json);\n\n// Return as a single item\nreturn [\n  {\n    json: {\n      input1: input1,\n      input2: input2\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c3c77f2c-9e66-4b7b-8c42-5f00b730f852",
      "name": "生成增强图像",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1760,
        288
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"parts\": [\n        {\n          \"text\": {{ JSON.stringify($json.input1[1].content.parts[0].text) }}\n        },\n        {\n          \"inlineData\": {\n            \"mimeType\": \"image/png\",\n            \"data\": \"{{ $json.input1[0].data }}\"\n          }\n        }\n      ]\n    }\n  ],\n  \"generationConfig\": {\n    \"responseModalities\": [\"TEXT\", \"IMAGE\"],\n    \"imageConfig\": {\n      \"aspectRatio\": \"9:16\"\n    }\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_GEMINI_CREDENTIAL_ID",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "06980560-5f85-4af8-af45-0b1a74e0f791",
      "name": "Base64转图像 (仅图像)",
      "type": "n8n-nodes-base.convertToFile",
      "onError": "continueErrorOutput",
      "position": [
        -1536,
        288
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "candidates[0].content.parts[0].inlineData.data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "2f21e558-c4bf-4c89-ac40-f8194fdf239b",
      "name": "Base64转图像 (图像和文本)",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1344,
        416
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "candidates[0].content.parts[1].inlineData.data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f926cf4c-744a-48e2-88ba-3216993d23fc",
      "name": "启动veo 3.1视频生成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1136,
        272
      ],
      "parameters": {
        "url": "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR_GCP_PROJECT_ID/locations/us-central1/publishers/google/models/veo-3.1-generate-preview:predictLongRunning",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"instances\": [\n    {\n      \"prompt\": \"Create a visually appealing 8-second marketing video showcasing this product. Add dynamic motion and suitable background audio.\",\n      \"image\": {\n        \"bytesBase64Encoded\": \"{{ $('Generate Enhanced Image').item.json.candidates[0].content.parts[1].inlineData.data }}\",\n        \"mimeType\": \"{{ $json.candidates[0].content.parts[1].inlineData.mimeType }}\"\n      }\n    }\n  ],\n  \"parameters\": {\n    \"aspectRatio\": \"9:16\",\n    \"sampleCount\": 1,\n    \"durationSeconds\": \"8\",\n    \"personGeneration\": \"allow_all\",\n    \"addWatermark\": true,\n    \"includeRaiReason\": true,\n    \"generateAudio\": true,\n    \"resolution\": \"1080p\"\n  }\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleOAuth2Api"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_GEMINI_CREDENTIAL_ID",
          "name": "Google Gemini(PaLM) Api account"
        },
        "googleOAuth2Api": {
          "id": "YOUR_GOOGLE_OAUTH2_CREDENTIAL_ID",
          "name": "Google account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f261dd46-ca76-4d40-bd62-0c94eaa355c9",
      "name": "检查视频状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -912,
        272
      ],
      "parameters": {
        "url": "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR_GCP_PROJECT_ID/locations/us-central1/publishers/google/models/veo-3.1-generate-preview:fetchPredictOperation",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"operationName\": \"{{ $json.name }}\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleOAuth2Api"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_GEMINI_CREDENTIAL_ID",
          "name": "Google Gemini(PaLM) Api account"
        },
        "googleOAuth2Api": {
          "id": "YOUR_GOOGLE_OAUTH2_CREDENTIAL_ID",
          "name": "Google account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d2dd1aa3-71f0-4bd3-8379-6b61325482e9",
      "name": "视频就绪验证器",
      "type": "n8n-nodes-base.if",
      "position": [
        -704,
        272
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "547fbae3-5ef7-4d29-94c4-ad0dfbfc5547",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.response.videos[0].bytesBase64Encoded }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "9929ab38-3857-4e5d-b549-b144bc82f443",
      "name": "处理延迟 (30秒)",
      "type": "n8n-nodes-base.wait",
      "position": [
        -512,
        432
      ],
      "webhookId": "YOUR_WEBHOOK_ID_1",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "e053e479-be53-46af-90fc-f7c359937ba4",
      "name": "Base64转视频",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -432,
        256
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "response.videos[0].bytesBase64Encoded"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c56f49fb-3940-46c5-8133-1390636eef4b",
      "name": "下载图片文件",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2960,
        288
      ],
      "webhookId": "YOUR_WEBHOOK_ID_2",
      "parameters": {
        "fileId": "={{ $json.message.photo[0].file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "YOUR_TELEGRAM_CREDENTIAL_ID",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2486c478-ae50-4c42-a253-e519ee27a343",
      "name": "Telegram触发器已接收",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -3168,
        288
      ],
      "webhookId": "YOUR_WEBHOOK_ID_3",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "YOUR_TELEGRAM_CREDENTIAL_ID",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e5d85127-8a10-4c2c-8b5c-03c2cc9f1024",
      "name": "发送veo 3.1视频",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -224,
        256
      ],
      "webhookId": "YOUR_WEBHOOK_ID_4",
      "parameters": {
        "chatId": "={{ $('Telegram Trigger Received').first().json.message.from.id }}",
        "operation": "sendVideo",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "YOUR_TELEGRAM_CREDENTIAL_ID",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e1c4a302-8ece-44db-96c6-2791835e6089",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3664,
        -464
      ],
      "parameters": {
        "width": 3648,
        "height": 1776,
        "content": "# 通过Telegram使用Nano Banana和Veo 3.1的产品视频创建器"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Image to Base64": {
      "main": [
        [
          {
            "node": "Combine Image & Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Design Analysis": {
      "main": [
        [
          {
            "node": "Combine Image & Analysis",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check Video Status": {
      "main": [
        [
          {
            "node": "Video Ready Validator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image File": {
      "main": [
        [
          {
            "node": "Image to Base64",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Design Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare API Payload": {
      "main": [
        [
          {
            "node": "Generate Enhanced Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Ready Validator": {
      "main": [
        [
          {
            "node": "Convert Base64 to video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Processing Delay (30s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Processing Delay (30s)": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to video": {
      "main": [
        [
          {
            "node": "Send veo 3.1 video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Enhanced Image": {
      "main": [
        [
          {
            "node": "Convert Base64 to Image (only image)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Image & Analysis": {
      "main": [
        [
          {
            "node": "Prepare API Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger Received": {
      "main": [
        [
          {
            "node": "Download Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate veo 3.1 Video Generation": {
      "main": [
        [
          {
            "node": "Check Video Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to Image (only image)": {
      "main": [
        [
          {
            "node": "Initiate veo 3.1 Video Generation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Base64 to Image (image and text)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Base64 to Image (image and text)": {
      "main": [
        [
          {
            "node": "Initiate veo 3.1 Video Generation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类2
节点类型11
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
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 查看

分享此工作流