8
n8n 中文网amn8n.com

Nano Banana AI产品图像生成器(WhatsApp版)

中级

这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 11 个节点。主要使用 Code, Merge, WhatsApp, HttpRequest, ConvertToFile 等节点。 通过WhatsApp使用的Nano Banana AI产品图像生成器

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "YOUR_INSTANCE_ID",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "408c2c7c-3e0a-4a56-baae-d1334fffbb49",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -224
      ],
      "parameters": {
        "width": 3008,
        "height": 2400,
        "content": "# Nano Banana AI 产品图像创建器 via WhatsApp"
      },
      "typeVersion": 1
    },
    {
      "id": "b2b1cb54-aad2-40f2-a6d3-82a87d7977b8",
      "name": "WhatsApp Message Received",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        48,
        496
      ],
      "webhookId": "YOUR_WEBHOOK_ID",
      "parameters": {
        "options": {
          "messageStatusUpdates": []
        },
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "YOUR_WHATSAPP_TRIGGER_CRED_ID",
          "name": "WhatsApp Trigger Credentials"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "df4cedfa-4dc9-4cbf-9a57-bda2169b43c6",
      "name": "Get Media URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        288,
        496
      ],
      "webhookId": "YOUR_WEBHOOK_ID_2",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Message Received').item.json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "YOUR_WHATSAPP_API_CRED_ID",
          "name": "WhatsApp API Credentials"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "83ddeda5-6189-494c-909b-750d702dea18",
      "name": "Download Image File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        544,
        496
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_WHATSAPP_ACCESS_TOKEN"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "af69c54c-cc63-41ce-a938-a0f5a87773da",
      "name": "图像转Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        880,
        400
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "9ee51832-ec77-4887-ad02-ca6e0022a5fe",
      "name": "AI Design Analysis",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        880,
        592
      ],
      "parameters": {
        "text": "=You are a master creative director specializing in viral product advertisements. Transform the uploaded product image and caption {{ $('WhatsApp Message Received').item.json.messages[0].image.caption }} into a stunning commercial-grade advertisement that stops scrollers and drives sales.\n\nCORE RULES:\n- Keep the original product 100% unchanged - no alterations, replacements, or distortions\n- Use only user-provided text from the caption\n- Focus on premium visual enhancement and commercial appeal\n\nOUTPUT FORMAT - Return strictly as JSON:\n\n{\n  \"headline\": \"Use only user-provided text or leave empty\",\n  \"subheadline\": \"Use only user-provided text or leave empty\", \n  \"description\": \"Use only user-provided text or leave empty\",\n  \"call_to_action\": \"Use only user-provided text or leave empty\",\n  \"design_suggestions\": \"Create a detailed commercial photography concept:\n\nHERO SHOT COMPOSITION: Position the product as the absolute star using professional product photography techniques. Apply rule of thirds, golden ratio, and negative space for maximum visual impact. Create depth layers with foreground, middle ground, and background elements.\n\nPREMIUM LIGHTING SETUP: Design studio-quality lighting with key light at 45-degree angle, fill light to reduce shadows, rim light for edge definition, and background light for separation. Add subtle color temperature variations - warm highlights (3200K) and cool shadows (5600K) for dimension.\n\nLUXURY BACKGROUND: Choose from these premium options:\n- Minimalist: Clean white/gray gradient with subtle texture\n- Marble: Polished Carrara marble surface with natural veining  \n- Fabric: Flowing silk or velvet draping in complementary colors\n- Industrial: Brushed metal, concrete, or glass surfaces\n- Natural: Stone, wood grain, or organic textures\n\nCINEMATIC COLOR GRADING: Apply professional color correction with:\n- Primary colors: Enhance product's natural colors by 15-20%\n- Secondary colors: Desaturate background by 10-15% to make product pop\n- Shadows: Add subtle blue/teal tint (-5 temperature)\n- Highlights: Warm golden tone (+10 temperature)\n- Overall: Increase contrast by 20%, add film grain for premium feel\n\nVISUAL EFFECTS & POLISH: Add sophisticated finishing touches:\n- Soft focus background (f/2.8 depth of field effect)  \n- Subtle product reflections on surface\n- Elegant shadow casting with 70% opacity\n- Gentle rim lighting glow around product edges\n- Optional: Floating particles or light rays for magic\n\nADVERTISEMENT STYLE: Make it look like a premium brand campaign - think Apple product launches, luxury fashion ads, or high-end cosmetic commercials. The final image should be Instagram-worthy, Pinterest-perfect, and conversion-focused.\n\nTECHNICAL SPECS: 16:9 aspect ratio, high resolution, sharp product focus, cinematic lighting, commercial photography style, premium brand aesthetic.\n\nDescribe every visual element in detail (400+ words) to create a show-stopping advertisement that makes people want to buy immediately.\"\n}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash-preview-05-20",
          "cachedResultName": "models/gemini-2.5-flash-preview-05-20"
        },
        "options": {},
        "resource": "image",
        "inputType": "binary",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_API_CRED_ID",
          "name": "Google API Credentials"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f78cef2a-30a8-4bef-a6bd-f17a0b7543de",
      "name": "Combine Image & Analysis",
      "type": "n8n-nodes-base.merge",
      "position": [
        1200,
        496
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "e02461e3-16c5-45ab-b5fc-c8f1c8561cff",
      "name": "Prepare API Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        496
      ],
      "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": "5d14ccf3-70cc-4be6-9c28-8046207aacbf",
      "name": "Generate Enhanced Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1648,
        496
      ],
      "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  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "YOUR_GOOGLE_API_CRED_ID_2",
          "name": "Google API Credentials"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ae68ba68-2df4-4fb3-bf8f-d83c6f19e3fd",
      "name": "Convert Base64 to Image",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1872,
        496
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "candidates[0].content.parts[0].inlineData.data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "46305e1c-aac0-4722-a512-52e58c15e9b2",
      "name": "Send Image",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2080,
        496
      ],
      "webhookId": "YOUR_WEBHOOK_ID_3",
      "parameters": {
        "mediaPath": "useMedian8n",
        "operation": "send",
        "messageType": "image",
        "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
        "additionalFields": {},
        "recipientPhoneNumber": "=+{{ $('WhatsApp Message Received').first().json.contacts[0].wa_id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "YOUR_WHATSAPP_SEND_CRED_ID",
          "name": "WhatsApp Send Credentials"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Get Media URL": {
      "main": [
        [
          {
            "node": "Download Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image to Base64": {
      "main": [
        [
          {
            "node": "Combine Image & Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Design Analysis": {
      "main": [
        [
          {
            "node": "Combine Image & Analysis",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "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
          }
        ]
      ]
    },
    "Convert Base64 to Image": {
      "main": [
        [
          {
            "node": "Send Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Enhanced Image": {
      "main": [
        [
          {
            "node": "Convert Base64 to Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Image & Analysis": {
      "main": [
        [
          {
            "node": "Prepare API Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Message Received": {
      "main": [
        [
          {
            "node": "Get Media URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 杂项, 多模态 AI

需要付费吗?

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

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

适合有一定经验的用户,包含 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 查看

分享此工作流