用 n8n 从参考图自动生成产品照片与营销视频
用户提交产品图与描述 → GPT-4.1 改写提示词 → OpenAI 生成新图 → RunwayML 生成视频 → Gmail 自动发送结果
- 给谁
- 电商运营、内容创作者、营销团队
- 你会得到
- 提交一张参考产品图后,自动获得 AI 生成的新产品图与 5 秒营销视频
- 你需要
- n8n · google-drive · gmail · runwayml · imgbb
硬约束
需要 n8n 实例;需配置 OpenAI(HTTP Header Auth)、Google Drive(OAuth2)、ImgBB(Query Auth)、RunwayML(HTTP Header Auth)、Gmail(OAuth2)五类凭证。OpenAI 账户须开通 gpt-image-1 图像生成权限。RunwayML 节点 X-Runway-Version 头必须为 2024-11-06。
他们做了什么
作者 jasonstelo 在 n8n 创建了一个工作流模板:通过 n8n 表单触发器收集用户的产品参考图、文件名、AI 视觉描述和邮箱;将原图备份到 Google Drive;用 GPT-4.1 把用户描述改写为专业图像生成提示词;调用 OpenAI 的 gpt-image-1 图像编辑接口,结合原图和提示词生成新产品图;将新图上传到 ImgBB 获取公开 URL;再提交给 RunwayML 的 gen4_turbo 模型生成 5 秒营销视频;通过 30 秒轮询等待视频完成;最后用 Gmail 把图片链接和视频链接发给用户。
效果如何
来源报告该模板为自动化方案,用户提交表单后即可无人值守获得产品图与视频(author_report)。本站未实测运行成功率和各 API 稳定性。
值得知道
1) RunwayML 节点使用 api.dev.runwayml.com 域名,需确认该端点对终端用户的可用性与稳定性;2) X-Runway-Version 头必须为 2024-11-06,更改会导致 API 失败;3) gpt-image-1 需要 OpenAI 账户开通图像生成权限;4) ImgBB 免费账户有速率和容量限制,高并发场景需评估;5) 视频生成轮询间隔 30 秒,长时间未完成的订单可能消耗较多执行时长;6) workflow.json 中 RunwayML 和 ImgBB 等外部服务可能变更接口,搭建前建议核对官方文档。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- Create Video 节点:绑定HTTP Header Auth 凭证。
- 将 __UKH_SECRET_14__ 替换为实际密钥/令牌(原路径 /nodes/14/parameters/content;possible secret)。
需要替换的配置
- 源模板来自 n8n 公开库 #14201(约 18 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。 另将 1 处字面量密钥替换为 __UKH_…__ 占位符。
模板获取日期: 2026-10-24
步骤
配置表单触发器
在 n8n 中添加「A.I Stunning Generator Interface」表单触发节点(Form Trigger)。设置表单标题为「Stelo Link Studio」,添加四个必填字段:Image File(文件,接受 .jpeg/.jpg/.png/.webm)、Product Image Name(文本,占位符「Name of New Image」)、Prompt A.I(多行文本,占位符「Explain your Vision. Think [Background, Content and Styles]」)、Email(邮箱,占位符「[email protected]」)。工作流激活后 n8n 自动生成公开表单 URL,可直接分享给提交者。
备份原图到 Google Drive
表单提交后,先将原图上传至 Google Drive 备份。添加「Upload to Google Drive」节点,使用 Google Drive OAuth2 凭证;文件名字段设为「={{ $json['Product Image Name'] }} (original)」;folderId 替换为你自己的 Google Drive 文件夹 ID(从文件夹 URL 中复制);inputDataFieldName 设为「Image_File」。随后用「Download from Google Drive」节点按上传返回的 id 下载该文件,供后续步骤使用。
AI 改写提示词并生成新图
添加「AI Agent」节点,连接「Chat GPT 4.1」语言模型(模型选 gpt-4.1)。AI Agent 的输入文本设为:「=Product : {{ $('A.I Stunning Generator Interface').item.json['Product Image Name'] }}\nDescription : {{ $('A.I Stunning Generator Interface').item.json['Prompt A.I'] }}」。在 AI Agent 的 System Message 中粘贴以下提示词(来源 workflow.json 节点原文),使 GPT-4.1 将用户描述改写为专业图像生成提示词。随后添加「OpenAi Create Image」节点,调用 https://api.openai.com/v1/images/edits,使用 HTTP Header Auth(Bearer YOUR_OPENAI_API_KEY),multipart/form-data 格式提交:image 字段接前一步下载的文件 data,prompt 字段接 AI Agent 输出「={{ $('AI Agent').item.json.output }}」,model 设为 gpt-image-1。最后用「Convert to File」节点将返回的 data[0].b64_json 转为二进制文件。
运行提示词 · 来源原文。AI Agent 节点的 System Message 字段
=# Overview You are a world-class marketing strategist and an expert text-to-image prompt engineer specializing in creating hyper-realistic, high-quality product photography prompts for AI image generation models. ## Your Objective: When given a product description, your task is to craft a detailed, professional prompt that results in a hyper-realistic, clean, and visually stunning product image suitable for marketing material, advertising campaigns, or e-commerce platforms. ## Key Requirements: - Focus on hyper-realistic, professional studio photography. - Maintain a clean, minimalistic, and elegant visual style. - Highlight the product as the main subject with sharp detail and perfect lighting. - Use backgrounds that complement but do not overpower the product (e.g., soft gradient, light-colored, or pure white). - Include professional lighting details such as "softbox lighting" , "studio lights" , or "natural soft shadows" . - Emphasize realism, texture, and color accuracy. - Maintain a high-end, premium look and feel. - If applicable, suggest a subtle setting that enhances the product's story (e.g., a luxury kitchen counter for a high-end blender). ## Output Format: - Write a single text-to-image prompt optimized for a professional AI image model. - Be direct and descriptive without using excessive words. - Avoid unnecessary repetition or adjectives that do not enhance the image quality. - Ensure the prompt is complete and ready for direct input into an AI model. ## Tone: Professional, precise, clean, and optimized for maximum realism and marketing impact. # Example Input: "A premium wireless Bluetooth speaker in matte black, cylindrical shape, modern design. " # Example Output: "Hyper-realistic product photo of a premium matte black wireless Bluetooth speaker with a cylindrical modern design, centered on a clean white studio background, softbox lighting with natural shadows, sharp focus on texture and material, minimalistic, professional advertising shot. "
上传图像获取公开 URL
添加「Get URL」节点,调用 ImgBB 上传 API(https://api.imgbb.com/1/upload),使用 HTTP Query Auth(参数名 key,值 YOUR_IMGBB_API_KEY)。请求类型 multipart/form-data,body 参数 image 设为 formBinaryData,inputDataFieldName 为「data」(接前一步 Convert to File 的输出)。上传成功后,ImgBB 返回的 data.url 将用于下一步视频生成。
提交视频生成并轮询结果
添加「Create Video」节点,向 https://api.dev.runwayml.com/v1/image_to_video 发送 POST 请求,HTTP Header Auth(Bearer YOUR_RUNWAYML_API_KEY)。Header 必须包含 X-Runway-Version: 2024-11-06(不可更改)。Body 参数:promptImage 为前一步 ImgBB 的 data.url,model 为 gen4_turbo,promptText 为固定视频描述(见下方提示词),duration 为 5,ratio 为 720:1280。随后添加「60 Seconds」等待节点(60 秒),再添加「HTTP Request」轮询节点,URL 为「=https://api.dev.runwayml.com/v1/tasks/{{ $('Create Video').item.json.id }}」,同样带 X-Runway-Version: 2024-11-06 头。接着用「If」节点判断返回 status 是否为「SUCCEEDED」或「RUNNING」:若为 SUCCEEDED 则进入发送邮件步骤;否则进入「Wait」节点等待 30 秒后再次轮询(Wait 节点接回 HTTP Request 形成循环)。
运行提示词 · 来源原文。Create Video 节点的 bodyParameters.promptText 字段
=Create a highly professional marketing video from the provided product photo. Simulate a smooth 360 rotation, realistic 3D turntable rotation around the product, as if the product is slowly rotating in place. The movement should be continuous, slow, and elegant — no sudden pans, jerks, or camera cuts. Always keep the entire product fully in frame, centered, and clearly visible at all times. Avoid zooming in or cropping. Focus on a premium, clean, and modern aesthetic that feels suitable for commercial marketing materials. No flashy effects, transitions, or overlays — only a subtle, realistic 3D rotation that highlights the product in the most polished way possible.
发送结果邮件
添加「Send a message」Gmail 节点,使用 Gmail OAuth2 凭证(发送账户即授权账户)。收件人设为「={{ $('A.I Stunning Generator Interface').item.json.Email }}」,主题设为「=Marketing Material : {{ $('A.I Stunning Generator Interface').item.json['Product Image Name'] }}」,邮件类型 text,内容如下(来源 workflow.json 节点原文)。关闭 appendAttribution。
运行提示词 · 来源原文。Send a message 节点的 message 字段
=Hey! Here is your photo: {{ $('Get URL').item.json.data.url_viewer }} and your video: {{ $json.output[0] }} Cheers Thank you for choosing Stelo Link配置凭证与权限
按来源说明配置以下五类凭证,全部在 n8n 的 Credentials 页面完成:1) OpenAI — HTTP Header Auth,Header name: Authorization,Value: Bearer YOUR_OPENAI_API_KEY,连接到 Chat GPT 4.1 和 OpenAi Create Image 节点;2) Google Drive — Google Drive OAuth2,按 OAuth 流程授权,然后在 Upload to Google Drive 节点更新 Folder ID;3) ImgBB — HTTP Query Auth,Parameter name: key,Value: YOUR_IMGBB_API_KEY,免费注册于 imgbb.com,连接到 Get URL 节点;4) RunwayML — HTTP Header Auth,Header name: Authorization,Value: Bearer YOUR_RUNWAYML_API_KEY,连接到 Create Video 和 HTTP Request 轮询节点;5) Gmail — Gmail OAuth2,按 OAuth 流程授权,连接到 Send a Message 节点。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你正在搭建一个 n8n 工作流:用户提交产品参考图与描述,系统自动生成 AI 产品图和营销视频并邮件发送。请先确认你已准备好 n8n 实例、OpenAI API Key(开通 gpt-image-1 权限)、Google Drive 文件夹、ImgBB Key、RunwayML Key 和 Gmail OAuth 账户,然后按步骤导入 workflow.json 或手动重建节点。
搭建前请检查 OpenAI 账户是否已启用图像生成权限(platform.openai.com),并确认 RunwayML 的 X-Runway-Version 头不可更改。
来源
Generate product photos and videos from a reference image with OpenAI and RunwayML · jasonstelo · n8n.io · 2026-03-20
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。