8
n8n 中文网amn8n.com

UGC Nano Banana

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 Set, SplitOut, GoogleDrive, HttpRequest, SplitInBatches 等节点。 使用Nano Banana创建高质量UGC图片(更便宜、更快速)

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移

无法加载工作流预览

导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "",
  "meta": {
    "instanceId": "",
    "templateCredsSetupCompleted": true
  },
  "name": "UGC Nano Banana",
  "tags": [],
  "nodes": [
    {
      "id": "",
      "name": "Mistral Cloud 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        -192,
        192
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "生成图片",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        496,
        128
      ],
      "parameters": {
        "url": "https://fal.run/fal-ai/gemini-25-flash-image/edit",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prompt\": \"{{ $json.prompt }}\",\n  \"image_urls\": [\n\"https://drive.google.com/uc?export=view&id={{ $('Google Drive Trigger').first().json.id }}\"\n  ],\n  \"num_images\": 1,\n  \"output_format\": \"jpeg\",\n  \"sync_mode\": false\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Key {{ $('Setup').first().json.FalAPIKey }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "retryOnFail": false,
      "typeVersion": 4.2
    },
    {
      "id": "",
      "name": "Google Drive 触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -592,
        -16
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://drive.google.com/drive/folders/",
          "cachedResultName": "UGC"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        352,
        -16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "",
      "name": "上传文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        864,
        128
      ],
      "parameters": {
        "name": "={{ $('Google Drive Trigger').first().json.name.match(/^[^.]+/)[0].concat($('Loop Over Items').item.json.prompt_number) }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://drive.google.com/drive/folders/",
          "cachedResultName": "UGC"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -16,
        192
      ],
      "parameters": {
        "jsonSchemaExample": "{\n      \"ugc_prompts\": [\n        {\n          \"prompt_number\": \"integer\",\n          \"prompt\": \"string\"\n        }\n      ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        560,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "检索图像",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        128
      ],
      "parameters": {
        "url": "={{ $json.images[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "",
      "name": "设置",
      "type": "n8n-nodes-base.set",
      "position": [
        -384,
        -16
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "",
              "name": "FalAPIKey",
              "type": "string",
              "value": "[YOUR_API_KEY]"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "",
      "name": "生成提示",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -176,
        -16
      ],
      "parameters": {
        "text": "You are an expert content creator specializing in UGC (User-Generated Content) style marketing images. ",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=The product the Promote is a {{ $('Google Drive Trigger').item.json.name.match(/^[^.]+/)[0] }}\n\nYour task is to generate 50 creative, diverse, and realistic situations prompts for an image-to-image generation model. Each prompt should describe a different situation or scenario where the product is being used. \n\nRequirements for each prompt:\n1. Specify the environment or setting (e.g., home, office, kitchen).  \n2. Include a human or realistic context interacting with the product (e.g., holding it, using it, displaying it).  \n3. Highlight at least one functionality or feature of the product in the scene.  \n4. Keep the prompts concise (1–2 sentences), vivid, and visually descriptive.  \n5. Maintain diversity: do not repeat the same type of scene. Include different times of day, moods, activities, or locations.\n\nOutput format (JSON array):\n{\n      \"ugc_prompts\": [\n              {\"prompt\": \"First prompt here...\"},\n              {\"prompt\": \"Second prompt here...\"},\n              ...\n              {\"prompt\": \"Fiftieth prompt here...\"}\n                      ]\n}\n\nExample input:  \nProduct: \"Smart Water Bottle\"  \n\nExample output:\n{\n      \"ugc_prompts\": [\n                {\"prompt\": \"A young woman jogging in a park, drinking from the Smart Water Bottle, enjoying cold water on a sunny morning.\"},\n                {\"prompt\": \"A man sitting at his office desk, checking water intake on his Smart Water Bottle synced with his phone.\"},\n                {\"prompt\": \"A family hiking on a trail, each carrying a Smart Water Bottle to stay hydrated.\"},...\n                     ]\n}\n\nDON'T RETURN ANYTHING ELSE THAN THE JSON!"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        144,
        -16
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output.ugc_prompts"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -608
      ],
      "parameters": {
        "width": 700,
        "height": 512,
        "content": "## 如何设置?"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -608
      ],
      "parameters": {
        "width": 516,
        "height": 512,
        "content": "## 工作原理?"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 908,
        "height": 432,
        "content": "## **提示生成**"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 432,
        "content": "## **UGC 生产**"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -608
      ],
      "parameters": {
        "width": 204,
        "height": 512,
        "content": "## 基础图像"
      },
      "typeVersion": 1
    },
    {
      "id": "",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -608
      ],
      "parameters": {
        "width": 244,
        "height": 512,
        "content": "## 适合谁?"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Setup": {
      "main": [
        [
          {
            "node": "Generate Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image": {
      "main": [
        [
          {
            "node": "Retrieve Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Image": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Prompts": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Prompts",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Prompts",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Nasser

Nasser

@nasser

Data Engineer, now automating processes mostly with n8n, Make and code

外部链接
在 n8n.io 查看

分享此工作流