Mistral创意写作AI 评分 · 待评分AI 辅助编辑·未发现明显提示词注入风险n8n.io

使用 Nano Banana 批量生成高质量 UGC 产品图

上传产品图到 Google Drive → Mistral 生成 50 条场景提示词 → Fal.ai Nano Banana 图生图 → 自动回存 Google Drive

有一点经验步骤流程提示词贴士
给谁
内容创作者、电商运营、营销团队
你会得到
自动产出 50 张 UGC 风格产品图并回存同一文件夹
你需要
n8n · fal-ai · google-drive

硬约束

前置条件:n8n 实例;Fal.ai API key;Google Drive OAuth2 凭证(Client ID/Secret)。产品基础图建议白底,Google Drive 目标文件夹及其文件需设为公开访问。

他们做了什么

模板作者 nasser 在 n8n 中构建了一个自动化工作流:用户将带白底的产品图上传到指定 Google Drive 文件夹后,工作流自动触发,先由 Mistral 大模型生成 50 条不同的场景提示词,再通过 Fal.ai 的 Nano Banana 模型逐条执行图生图,最后将 50 张 UGC 风格图片回存到同一文件夹。

效果如何

作者报告该流程单次生成成本约为 $0.039/张(来源:description.md 中的 Cost 标注)。此为作者自述,未经本站实测验证。

值得知道

1. Google Drive 文件夹及其文件必须设为公开,否则 Fal.ai 无法读取原图。2. 产品基础图建议白底以获得更好效果。3. 可通过修改 Generate Prompts 节点的 message 调整提示词数量与风格;通过 Generate Image 的 JSON body 调整 num_images 和 image_urls 数量。4. 实际成本与生成质量可能因 Fal.ai 模型更新而变化,建议先用少量提示词测试。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • Mistral Cloud Chat Model 节点:绑定mistralCloudApi 凭证。
  • Google Drive Trigger 节点:绑定Google Drive OAuth2 凭证。
  • Upload file 节点:绑定Google Drive OAuth2 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #8644(约 17 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 配置凭证与初始节点

    在 n8n 的 Credentials 中连接 Google Drive(OAuth2,需 Client ID / Secret)。打开工作流中的 Setup 节点(Edit Fields),将 FalAPIKey 的值从 [YOUR_API_KEY] 替换为你的 Fal.ai API key。

  2. 设置 Google Drive 触发器

    配置 Google Drive Trigger 节点:选择 specificFolder 模式,指定要监听的文件夹(如 UGC)。触发事件选 fileCreated。该文件夹及其内文件需公开可访问。

  3. 配置提示词生成节点

    Generate Prompts 节点使用 Mistral Cloud Chat Model + Structured Output Parser。system 提示词设定角色为 UGC 营销图专家;user message 以 n8n expression 引用上传文件名提取产品名,要求生成 50 条场景提示词。

    运行提示词 · 来源原文。Generate Prompts 节点的 System / Text 字段

    You are an expert content creator specializing in UGC (User-Generated Content) style marketing images.

    运行提示词 · 来源原文。Generate Prompts 节点的 Messages → messageValues[0] → message 字段(n8n expression,以 = 开头)

    =The product the Promote is a {{ $('Google Drive Trigger').item.json.name.match(/^[^.]+/)[0] }}
    
    Your 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. 
    
    Requirements for each prompt:
    1. Specify the environment or setting (e.g., home, office, kitchen).  
    2. Include a human or realistic context interacting with the product (e.g., holding it, using it, displaying it).  
    3. Highlight at least one functionality or feature of the product in the scene.  
    4. Keep the prompts concise (1–2 sentences), vivid, and visually descriptive.  
    5. Maintain diversity: do not repeat the same type of scene. Include different times of day, moods, activities, or locations.
    
    Output format (JSON array):
    {
          "ugc_prompts": [
                  {"prompt": "First prompt here..."},
                  {"prompt": "Second prompt here..."},
                  ...
                  {"prompt": "Fiftieth prompt here..."}
                          ]
    }
    
    Example input:  
    Product: "Smart Water Bottle"  
    
    Example output:
    {
          "ugc_prompts": [
                    {"prompt": "A young woman jogging in a park, drinking from the Smart Water Bottle, enjoying cold water on a sunny morning."},
                    {"prompt": "A man sitting at his office desk, checking water intake on his Smart Water Bottle synced with his phone."},
                    {"prompt": "A family hiking on a trail, each carrying a Smart Water Bottle to stay hydrated."},...
                         ]
    }
    
    DON'T RETURN ANYTHING ELSE THAN THE JSON!
  4. 执行批量图生图

    Split Out 节点将 50 条提示词拆分为独立项;Loop Over Items 逐条循环。每次循环中,Generate Image 节点向 Fal.ai (gemini-25-flash-image/edit) 发送 POST 请求,携带提示词与产品图 URL;Retrieve Image 节点下载生成结果。

    运行提示词 · 来源原文。Generate Image 节点的 JSON Body 字段

    ={
      "prompt": "{{ $json.prompt }}",
      "image_urls": [
    "https://drive.google.com/uc?export=view&id={{ $('Google Drive Trigger').first().json.id }}"
      ],
      "num_images": 1,
      "output_format": "jpeg",
      "sync_mode": false
    }

    运行提示词 · 来源原文。Generate Image 节点 Header Parameters → Authorization 值

    =Key {{ $('Setup').first().json.FalAPIKey }}

    运行提示词 · 来源原文。Retrieve Image 节点的 URL 字段

    ={{ $json.images[0].url }}
  5. 回传结果到 Google Drive

    Upload file 节点将生成的图片上传回同一 Google Drive 文件夹。文件名使用原产品名 + 提示词编号组合。

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限

这一段是提示词,页面不会在这里插入广告。

你正在搭建一个 n8n 工作流:上传产品图后,通过 Mistral + Fal.ai Nano Banana 自动生成 50 张 UGC 风格图片并回存 Google Drive。请先确认你已准备好 Fal.ai API key 和 Google Drive OAuth2 凭证,再按步骤配置节点。

替换 [YOUR_API_KEY] 为真实 Fal.ai key;Google Drive 文件夹需公开

来源

Create high quality UGC images with Nano Banana (Cheaper & Faster) · nasser · n8n.io · 2025-09-16

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例