8
n8n 中文网amn8n.com

使用Gemini AI、DeepSeek和GoAPI为电商生成产品图片和视频

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 50 个节点。主要使用 If, Set, Html, Wait, Discord 等节点。 使用Gemini AI、DeepSeek和GoAPI为电商生成产品图片和视频

前置要求
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "3226f8a40ac34f6d2796e8317019299eb4048a7044298cb648d2e5f3986b9a24",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "344d8572-1a99-46f6-bf20-9f77ee425b85",
      "name": "纳米香蕉图片",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "{\n  \"model\": \"google/gemini-2.5-flash-image-preview:free\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Generate and Image of {{ $json.chatInput.replaceAll('\"', '**') }}\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n          }\n        }\n      ]\n    }\n  ]\n}",
      "position": [
        -272,
        112
      ],
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/gemini-2.5-flash-image-preview:free\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Generate and Image of {{ $json.output.product.replaceAll('\"', '**') }},{{ $json.output.aesthetics.replaceAll('\"', '**') }},{{ $json.output.composition.replaceAll('\"', '**') }},{{ $json.output.lighting.replaceAll('\"', '**') }},{{ $json.output.scene.replaceAll('\"', '**') }},{{ $json.output.lens.replaceAll('\"', '**') }},{{ $json.output.shot_type.replaceAll('\"', '**') }},{{ $json.output.shot_type.replaceAll('\"', '**') }},{{ $json.output.camera_action.replaceAll('\"', '**') }}\"\n        }\n      ]\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openRouterApi"
      },
      "credentials": {
        "openRouterApi": {
          "id": "lUNkEH4S1HkFnkGa",
          "name": "OpenRouter - dhruv"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "31841641-bacf-4d64-a0ae-6f6d9ffab57b",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        176,
        112
      ],
      "parameters": {
        "options": {
          "fileName": "=nano-banana-{{ (Math.random() + 1).toString(36).substring(2, 7) }}.png"
        },
        "operation": "toBinary",
        "sourceProperty": "image_string"
      },
      "typeVersion": 1.1
    },
    {
      "id": "50aa2f0f-a15a-4a68-b1dc-3c0ed58a49b0",
      "name": "上传到 MediaUpload",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        400,
        112
      ],
      "parameters": {
        "url": "http://homelab-mediahosting.4m6m9w.easypanel.host/api/1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YVhVb6tEPSkUHrUI",
          "name": "Mediaupload - easypanel"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b9ee6eb3-8b4e-4922-9a6c-87b2ac18b0e6",
      "name": "提取图片 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        624,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "77e1575f-a516-4bd1-b66c-92e49c4295da",
              "name": "url",
              "type": "string",
              "value": "={{ $json.image.image.url.replaceAll('http', 'https') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ec601037-8454-48b4-83a9-34d10d63d10b",
      "name": "转换为文件1",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1984,
        112
      ],
      "parameters": {
        "options": {
          "fileName": "=nano-banana-{{ (Math.random() + 1).toString(36).substring(2, 7) }}.png"
        },
        "operation": "toBinary",
        "sourceProperty": "image_string"
      },
      "typeVersion": 1.1
    },
    {
      "id": "85d290f0-dcd5-48f7-819a-86ef2f867eea",
      "name": "上传到 MediaUpload1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2208,
        112
      ],
      "parameters": {
        "url": "http://homelab-mediahosting.4m6m9w.easypanel.host/api/1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YVhVb6tEPSkUHrUI",
          "name": "Mediaupload - easypanel"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "64939ace-0a3c-4495-8d4c-1639cba846b6",
      "name": "提取图片 URL1",
      "type": "n8n-nodes-base.set",
      "notes": "{{ $json.image.image.url.replaceAll('http', 'https') }}",
      "position": [
        2432,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "77e1575f-a516-4bd1-b66c-92e49c4295da",
              "name": "url",
              "type": "string",
              "value": "={{ $json.image.image.url.replaceAll('http', 'https') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "86602783-a84f-4ebe-9270-00ffbccc4fcf",
      "name": "生成带产品的模型",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "{\n  \"model\": \"google/gemini-2.5-flash-image-preview:free\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"{{ $json.chatInput }}\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\n          }\n        }\n      ]\n    }\n  ]\n}",
      "position": [
        1536,
        112
      ],
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/gemini-2.5-flash-image-preview:free\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Generate a high-resolution Image of {{ $json.output.prompt.replaceAll('\"', '**') }}\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"{{ $('Extract Image Url').item.json.url }}\"\n          }\n        }\n      ]\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openRouterApi"
      },
      "credentials": {
        "openRouterApi": {
          "id": "lUNkEH4S1HkFnkGa",
          "name": "OpenRouter - dhruv"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3a1bd67d-3058-412c-ac72-a9207817a248",
      "name": "获取 Base64 字符串1",
      "type": "n8n-nodes-base.set",
      "position": [
        1760,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2d314665-b130-49f5-a2c2-ec8efa920629",
              "name": "image_string",
              "type": "string",
              "value": "={{ $json.choices[0].message.images[0].image_url.url.split(',')[1] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3fea0cb9-ac35-4737-9b56-8262b66f3227",
      "name": "获取 Base64 字符串",
      "type": "n8n-nodes-base.set",
      "position": [
        -48,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2d314665-b130-49f5-a2c2-ec8efa920629",
              "name": "image_string",
              "type": "string",
              "value": "={{ $json.choices[0].message.images[0].image_url.url.split(',')[1] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "00befc5c-b289-4114-89d2-47f13785a6ec",
      "name": "错误触发器",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -608,
        704
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "941bb166-2407-4433-9592-49339eba4084",
      "name": "发送错误",
      "type": "n8n-nodes-base.discord",
      "position": [
        -384,
        704
      ],
      "webhookId": "c239c5d2-37c8-416e-8194-95e94cac05dc",
      "parameters": {
        "content": "=Error Occured - {{ $json.execution.error.message }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "aLJRNCKSN1xkf401",
          "name": "server - Nano Banana Webhook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d47d3f3c-51b4-4119-8c42-1c2f90e8e92f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        -32
      ],
      "parameters": {
        "width": 224,
        "height": 336,
        "content": "如果您没有 MediaUpload 的托管版本,请替换为此类图片上传器,如 vgy.me"
      },
      "typeVersion": 1
    },
    {
      "id": "377051b6-c42f-4d0d-a616-efe85e8e7c4c",
      "name": "Discord1",
      "type": "n8n-nodes-base.discord",
      "position": [
        2656,
        -176
      ],
      "webhookId": "c239c5d2-37c8-416e-8194-95e94cac05dc",
      "parameters": {
        "content": "=Product Image - {{ $('Extract Image Url').item.json.url }}\nFinal Image - {{ $json.url }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "aLJRNCKSN1xkf401",
          "name": "server - Nano Banana Webhook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8e896b4b-011f-4c05-8077-050abe0b12e6",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3568,
        336
      ],
      "parameters": {
        "url": "=https://api.goapi.ai/api/v1/task/{{ $json.data.task_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "bDP6r2pm1qRN1juq",
          "name": "GOAPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6b5a53af-0f0a-4919-9105-80b043758f32",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        3792,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a3588bba-66ea-4aed-9fee-66b118571a73",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "processing"
            },
            {
              "id": "97761a48-8ac3-4547-82c2-09e3d5a83c3d",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "pending"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "18b928f2-a10f-4352-a5f6-ae5a117ef68a",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        4016,
        256
      ],
      "webhookId": "cc520980-4399-45e8-90f7-9cf3fd97b9d7",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "8d8d2951-7636-4db0-833e-229ca33c7d52",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -480,
        336
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"title\": \"Generated schema for Root\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"product\": {\n      \"type\": \"string\"\n    },\n    \"aesthetics\": {\n      \"type\": \"string\"\n    },\n    \"composition\": {\n      \"type\": \"string\"\n    },\n    \"lighting\": {\n      \"type\": \"string\"\n    },\n    \"scene\": {\n      \"type\": \"string\"\n    },\n    \"text\": {\n      \"type\": \"string\"\n    },\n    \"lens\": {\n      \"type\": \"string\"\n    },\n    \"shot_type\": {\n      \"type\": \"string\"\n    },\n    \"camera_action\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"product\",\n    \"aesthetics\",\n    \"composition\",\n    \"lighting\",\n    \"scene\",\n    \"text\",\n    \"lens\",\n    \"shot_type\",\n    \"camera_action\"\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "291d383a-8de8-49b1-8673-df727ad73f57",
      "name": "产品提示代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -704,
        112
      ],
      "parameters": {
        "text": "=About Product : {{ $json.description }}\n\nText On Product: {{ $json.text }}\n\nDescription: {{ $json.productOptions }}",
        "options": {
          "systemMessage": "=You are an AI assistant persona with the role of a product designer from NIFT. Your task is to generate high-quality, aesthetic product image prompts.\n\nYou will be provided with keywords and a basic product description. Based on this input, you will create a detailed image generation prompt that specifies the following key elements:\n\n### Elements\n\n- Product: A detailed description of the product itself.\n- Aesthetics: The overall visual style and mood.\n- Composition: The arrangement of elements within the scene.\n- Lighting: The type and direction of light (e.g., natural light, studio lighting).\n- Scene: The environment or setting where the product is placed.\n- Text: Any specific text to be included on or near the product.\n- Lens: The type of camera lens to be used (e.g., wide-angle, macro).\n- Shot Type: The camera shot distance or angle (e.g., close-up, top-down).\n- Camera Action: Any camera movement or effect (e.g., motion blur, tilt-shift).\n\nYour output must be a single JSON object. Each key in the JSON should correspond to one of the elements listed above. The value for each key should be a comma-separated string of descriptive words or phrases.\n\n### Example JSON Output:\n\n{\n  \"product\": \"matte ceramic coffee mug, geometric handle\",\n  \"aesthetics\": \"sustainable, minimalist, modern design\",\n  \"composition\": \"centered, rule of thirds, clean background\",\n  \"lighting\": \"soft natural light, rim lighting\",\n  \"scene\": \"modern kitchen, wooden countertop, single potted plant\",\n  \"text\": \"subtle embossed logo on base\",\n  \"lens\": \"50mm prime lens\",\n  \"shot_type\": \"macro shot, eye-level angle\",\n  \"camera_action\": \"no motion blur, sharp focus\"\n}\n\nDo not include any additional conversational text or explanations in your final response. Your entire response should be the optimized prompt."
        },
        "promptType": "define",
        "needsFallback": true,
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "c55f8ea5-5bab-481f-b70c-5ff9f9968676",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1328,
        336
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"title\": \"Generated schema for Root\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"prompt\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"prompt\"\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "71c09fbd-8d97-4eaa-9285-793b8618d1b4",
      "name": "模型提示生成器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1104,
        112
      ],
      "parameters": {
        "text": "=Here is the Product : {{ $json.content.parts[0].text }}. Please generate an image prompt.",
        "options": {
          "systemMessage": "Generate a high-resolution editorial-style image of a young, beautiful Indian American Origin woman. If the provided product elements are wearable (such as clothing, jewelry, shoes, etc.), depict the model wearing the product. If the product is a usable object (like a spray bottle, phone, etc.), show the model holding the product. If the product is larger but not wearable, position the model standing or sitting by its side. Incorporate the provided product elements, cinematic soft area lighting, an ambient background, and raw imperfections. The final output should emphasize a polished, editorial aesthetic with natural yet dramatic lighting"
        },
        "promptType": "define",
        "needsFallback": true,
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2.2
    },
    {
      "id": "f95bbdb4-f2ad-477d-b09a-f8bd83886c8b",
      "name": "生成回复",
      "type": "n8n-nodes-base.html",
      "position": [
        2992,
        -176
      ],
      "parameters": {
        "html": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Product Image Showcase</title>\n    <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n    <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n    <link href=\"https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap\" rel=\"stylesheet\">\n    <style>\n        body {\n            font-family: 'Montserrat', sans-serif;\n            background-color: #f0f2f5;\n            color: #333;\n            margin: 0;\n            padding: 20px;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            min-height: 100vh;\n            box-sizing: border-box;\n        }\n        .container {\n            max-width: 900px;\n            width: 100%;\n            background-color: #fff;\n            padding: 30px;\n            border-radius: 10px;\n            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);\n            text-align: center;\n        }\n        h1 {\n            font-weight: 700;\n            color: #1a1a1a;\n            margin-bottom: 10px;\n        }\n        p {\n            font-weight: 400;\n            color: #666;\n            margin-bottom: 30px;\n        }\n        .image-container {\n            display: flex;\n            flex-wrap: wrap;\n            justify-content: center;\n            gap: 20px;\n        }\n        .image-card {\n            width: 100%;\n            max-width: 400px;\n            padding: 15px;\n            border: 1px solid #e0e0e0;\n            border-radius: 8px;\n            background-color: #fafafa;\n            box-sizing: border-box;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n        }\n        .image-card h2 {\n            font-size: 1.2em;\n            margin-top: 0;\n            margin-bottom: 10px;\n            color: #444;\n        }\n        .image-card img {\n            width: 100%;\n            height: auto;\n            border-radius: 6px;\n            display: block;\n            margin-bottom: 10px;\n        }\n        .download-btn {\n            background-color: #007bff;\n            color: white;\n            padding: 10px 15px;\n            text-decoration: none;\n            border-radius: 5px;\n            font-weight: 600;\n            transition: background-color 0.3s ease;\n            margin-top: 10px;\n        }\n        .download-btn:hover {\n            background-color: #0056b3;\n        }\n\n        @media (max-width: 768px) {\n            .container {\n                padding: 20px;\n                width: 50%\n            }\n            .image-container {\n                flex-direction: column;\n                align-items: center;\n            }\n        }\n    </style>\n</head>\n<body>\n    <div class=\"container\">\n        <h1>Product Image & Ad Creative</h1>\n        <p>Here are your generated product and user-generated content images.</p>\n        <div class=\"image-container\">\n            <div class=\"image-card\">\n                <h2>Product Image</h2>\n                <img src=\"{{ $('Extract Image Url').item.json.url }}\" alt=\"Product Image\">\n                <a href=\"{{ $('Extract Image Url').item.json.url }}\" download class=\"download-btn\">Download</a>\n            </div>\n            <div class=\"image-card\">\n                <h2>UGC Image</h2>\n                <img src=\"{{ $('Extract Image Url1').item.json.url }}\" alt=\"UGC Image\">\n                <a href=\"{{ $('Extract Image Url1').item.json.url }}\" download class=\"download-btn\">Download</a>\n            </div>\n        </div>\n    </div>\n</body>\n</html>\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "a61c19aa-ad35-430f-9c77-b3f2b31f0fa1",
      "name": "生成视频",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "{\n  \"model\": \"Qubico/wanx\",\n  \"task_type\": \"wan22-img2video-14b\",\n  \"input\": {\n    \"prompt\": \"{{ $json.output.video_prompt.replaceAll('\"', '**').replaceAll('\\n', '') }}\",\n    \"negative_prompt\": \"nudes, naked, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured jpeg artifacts, jpeg artifacts, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers\",\n    \"image\": \"{{ $('Extract Image Url1').item.json.url }}\",\n    \"aspect_ratio\": \"16:9\"\n  }\n}",
      "position": [
        3344,
        336
      ],
      "parameters": {
        "url": "https://api.goapi.ai/api/v1/task",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"Qubico/wanx\",\n  \"task_type\": \"wan22-img2video-14b\",\n  \"input\": {\n    \"prompt\": \"{{ $json.output.video_prompt.replaceAll('\"', '**').replaceAll('\\n', '') }}\",\n    \"negative_prompt\": \"nudes, naked, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured jpeg artifacts, jpeg artifacts, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers\",\n    \"image\": \"{{ $('Extract Image Url1').item.json.url }}\",\n    \"aspect_ratio\": \"16:9\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "bDP6r2pm1qRN1juq",
          "name": "GOAPI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a044a1d2-ca6e-4389-90c5-1782bd46ff6a",
      "name": "结构化输出解析器2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3136,
        560
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"title\": \"Generated schema for Root\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"video_prompt\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"video_prompt\"\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "c8ac4883-2108-403f-bcc8-e8985c232784",
      "name": "模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        2880,
        560
      ],
      "parameters": {
        "model": "deepseek/deepseek-chat-v3.1:free",
        "options": {
          "timeout": 360000,
          "temperature": 0.6,
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "lUNkEH4S1HkFnkGa",
          "name": "OpenRouter - dhruv"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "aac112f9-d70a-4fff-a6a3-dfceafdacea9",
      "name": "模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1072,
        336
      ],
      "parameters": {
        "model": "deepseek/deepseek-chat-v3.1:free",
        "options": {
          "timeout": 360000,
          "temperature": 0.6,
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "lUNkEH4S1HkFnkGa",
          "name": "OpenRouter - dhruv"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "626be3b5-8026-4019-9dc9-f4f590d27fe0",
      "name": "模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -736,
        336
      ],
      "parameters": {
        "model": "deepseek/deepseek-chat-v3.1:free",
        "options": {
          "timeout": 360000,
          "temperature": 0.6,
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openRouterApi": {
          "id": "lUNkEH4S1HkFnkGa",
          "name": "OpenRouter - dhruv"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "67fc170f-a071-440c-809c-4965c80697eb",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3008,
        560
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "1nAkRTi0QYuIf67i",
          "name": "Piyush's Work Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4e4d9931-9b86-4f5f-b779-e8f1e62bac38",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1200,
        336
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "1nAkRTi0QYuIf67i",
          "name": "Piyush's Work Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9000fea5-a0af-411d-8c2d-89ab77d3c50f",
      "name": "Google Gemini聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -608,
        336
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "1nAkRTi0QYuIf67i",
          "name": "Piyush's Work Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8544dda9-2b74-4e17-942e-1c6c4fe293ab",
      "name": "上传到 MediaUpload2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4368,
        448
      ],
      "parameters": {
        "url": "http://homelab-mediahosting.4m6m9w.easypanel.host/api/1/upload",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YVhVb6tEPSkUHrUI",
          "name": "Mediaupload - easypanel"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2444fc68-cada-436b-aff0-2fe3c0e1a57a",
      "name": "下载视频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4016,
        448
      ],
      "parameters": {
        "url": "={{ $json.data.output.video_url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "16b815c2-4a21-4c1e-b2d1-12f254de4de9",
      "name": "表单 1 - Alpha",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1104,
        32
      ],
      "webhookId": "c2c17f46-e7f6-43a0-8cc6-bb1bf96f1c1b",
      "parameters": {
        "options": {
          "path": "product-description",
          "buttonLabel": "Submit a Product",
          "appendAttribution": false
        },
        "formTitle": "Image Generation Form",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "A detailed description of the product.",
              "requiredField": true
            },
            {
              "fieldLabel": "Text to inlucde in Product (optional)"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "E-commerce Product Options",
              "fieldOptions": {
                "values": [
                  {
                    "option": " A Rule of Thirds composition with softbox lighting in a minimalist studio environment, captured with a standard lens as a full shot with a shallow depth of field"
                  },
                  {
                    "option": "A symmetrical composition with cinematic lighting in an urban environment, captured with a wide-angle lens as an eye-level shot with no camera action."
                  },
                  {
                    "option": "A flat lay composition with natural sunlight in a rustic outdoor scene, captured with a macro lens as a top-down shot with no camera action."
                  },
                  {
                    "option": "A centered composition with backlit lighting in an abstract setting, captured with a telephoto lens as a close-up shot with a slow shutter speed to create motion blur."
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Jewelry Product Options",
              "fieldOptions": {
                "values": [
                  {
                    "option": " A close-up shot of a single piece using the Rule of Thirds with diffused studio lighting, creating a subtle shallow depth of field to focus on the intricate details of the jewelry, with the background blurred out."
                  },
                  {
                    "option": "A centered composition with high-key lighting on a clean, white background, captured with a macro lens to highlight the shine and cut of a gemstone, with the camera remaining still."
                  },
                  {
                    "option": "An on-body shot using a symmetrical composition with natural sunlight in a natural landscape setting, captured with a standard lens at eye level to show how the jewelry looks when worn."
                  },
                  {
                    "option": "A dynamic group shot using a flat lay arrangement with backlit lighting in a styled indoor living space, captured with a macro lens at a top-down angle to capture the entire set in one frame."
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Electronics Product Options",
              "fieldOptions": {
                "values": [
                  {
                    "option": "A symmetrical composition with cinematic lighting in a sleek, futuristic studio, captured with a wide-angle lens as an eye-level shot with no camera action to present the device cleanly."
                  },
                  {
                    "option": "A Rule of Thirds shot with a telephoto lens using softbox lighting on a dark, moody background with a shallow depth of field to focus on a single feature of the electronic device."
                  },
                  {
                    "option": "A detail shot with backlit lighting to highlight the device's shape and silhouette, captured with a macro lens to focus on an intricate detail, with no camera action."
                  },
                  {
                    "option": "A lifestyle shot in an urban environment with natural sunlight, captured with a wide-angle lens as an eye-level shot, with motion blur to suggest active use of the device."
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Food Photography Options",
              "fieldOptions": {
                "values": [
                  {
                    "option": " A centered composition with backlit lighting in a rustic setting, captured with a macro lens as a close-up shot with a shallow depth of field to highlight texture and steam."
                  },
                  {
                    "option": "Rule of Thirds composition with natural sunlight on a styled dining table, captured with a standard lens as an eye-level shot to create a cozy, inviting feel."
                  },
                  {
                    "option": "A flat lay composition with natural window light on a clean, minimalist background, captured with a standard lens at a top-down angle to show the full meal arrangement."
                  },
                  {
                    "option": "A close-up composition with softbox lighting in a dark, moody environment, captured with a telephoto lens as a detail shot to focus on specific ingredients."
                  },
                  {
                    "option": "A centered composition with high-key lighting in a studio setting, captured with a standard lens as a full shot, with shallow depth of field to create a clean, elegant look."
                  }
                ]
              }
            }
          ]
        },
        "formDescription": "Form for generating a product image"
      },
      "typeVersion": 2.2
    },
    {
      "id": "98582917-7842-4825-a5aa-9c0f5b10fe81",
      "name": "获取数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -912,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b2efd2f6-03e9-438b-9772-73014b660534",
              "name": "description",
              "type": "string",
              "value": "={{ $json['A detailed description of the product.'] }}"
            },
            {
              "id": "7a24a6b0-68de-4cdd-9525-b689f21b7b6e",
              "name": "text",
              "type": "string",
              "value": "={{ $json[\"Text to inlucde in Product (optional)\"] }}"
            },
            {
              "id": "fb139442-1436-462d-aa0c-1e07bf264cc5",
              "name": "productOptions",
              "type": "string",
              "value": "={{ $json[\"E-commerce Product Options\"].toJsonString().replaceAll('\"','') }}{{ $json['Jewelry Product Options'].toJsonString().replaceAll('\"','') }}{{ $json['Electronics Product Options'].toJsonString().replaceAll('\"','') }}{{ $json['Food Photography Options'].toJsonString().replaceAll('\"','') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5bed46aa-2a24-499c-a351-2988176ad898",
      "name": "创意可视化器",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        2656,
        336
      ],
      "parameters": {
        "text": "=You are a Creative Visualiser AI. Your role is to analyze an image and produce a precise, richly detailed descriptive prompt that captures every visual element for a Creative Director agent to use in ad concept generation.\n\nInstructions for image analysis:\n\n* Identify the **main product** in the image.\n* Identify the **model (if present)** and how the product is worn, held, or displayed.\n* Describe **composition and framing**: camera angle, subject placement, focus depth.\n* Describe **visual attributes of the product**: color, texture, material, size, and any standout features.\n* Describe **the model’s appearance and interaction** with the product: pose, gesture, clothing, expression.\n* Describe **environment and background**: setting, lighting, atmosphere, colors, depth cues.\n* Describe **mood and tone** conveyed by the image.\n* Output must be a single continuous descriptive passage, written in neutral, cinematic, visually precise language.\n\nExample Output:\n“A close-up shot of a female model seated outdoors during golden hour. She is holding a cheeseburger with a sesame seed bun, thick grilled beef patty, melted yellow cheese, sliced red tomatoes, and fresh green lettuce. The burger is centered in her hands, with the blurred city skyline in the background. Warm sunlight reflects on the bun and melted cheese, emphasizing texture and juiciness. The model’s relaxed expression and the glowing ambient light create an appetizing and inviting mood.”\n\nReturn only the string.\n",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash-lite",
          "cachedResultName": "models/gemini-2.5-flash-lite"
        },
        "options": {
          "maxOutputTokens": 300
        },
        "resource": "image",
        "imageUrls": "={{ $json.url }}",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "VGump0yqWeWpqkjo",
          "name": "Google Gemini - Korex"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7e339b4b-2493-4816-b8dd-a93607c071d9",
      "name": "产品可视化器",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        848,
        112
      ],
      "parameters": {
        "text": "=Produce a concise product-only description for cataloging.\n\nA single image containing a product.\n\nOutput format: One plain text string of 80–100 words, lowercase only, using letters a to z, digits 0 to 9, and spaces. No punctuation, no quotes, no hyphens, no special characters, no emojis, no line breaks.\n\nContent to include: product category and primary function; visible materials and construction; dominant colors and finish or texture; form factor and key components; size or capacity only if visually evident; notable features integral to the product; brand name only if clearly visible.\n\nConstraints: describe only what is visible; no guesses; no marketing language; no comparative or subjective claims; ignore background, people, props, packaging, scenes, and camera details. If multiple items appear, describe the main product occupying most of the frame.\n\nReturn only the string.\n\nExample output: insulated stainless steel water bottle for daily hydration featuring double wall vacuum construction screw top lid with carry loop matte finish silver color cylindrical body narrow mouth suitable for cold and hot beverages keeps temperature stable for extended periods durable dent resistant exterior interior is food grade steel capacity approximately 1000 ml fits standard backpack side pockets minimal branding no patterns or graphics smooth texture lightweight portable design reusable eco friendly alternative to disposable plastic bottles ideal for gym travel office and outdoor activities",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash-lite",
          "cachedResultName": "models/gemini-2.5-flash-lite"
        },
        "options": {
          "maxOutputTokens": 300
        },
        "resource": "image",
        "imageUrls": "={{ $json.url }}",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "VGump0yqWeWpqkjo",
          "name": "Google Gemini - Korex"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "30dc8c50-0102-4809-9ace-14c0f5c36e0f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -32
      ],
      "parameters": {
        "width": 224,
        "height": 336,
        "content": "如果您没有 MediaUpload 的托管版本,请替换为此类图片上传器,如 vgy.me"
      },
      "typeVersion": 1
    },
    {
      "id": "5bd27858-363b-4ea6-9e91-463fe1b760f9",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -32
      ],
      "parameters": {
        "color": 6,
        "width": 640,
        "height": 544,
        "content": "## 1. 代理根据用户请求生成图片提示。"
      },
      "typeVersion": 1
    },
    {
      "id": "ce806d8a-d297-4852-b370-a698e8e5935d",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 544,
        "content": "## 2. 将 Base64 字符串转换为二进制"
      },
      "typeVersion": 1
    },
    {
      "id": "5d4da413-87d4-4687-8a6b-35e8b94bb61a",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -32
      ],
      "parameters": {
        "color": 4,
        "width": 416,
        "height": 544,
        "content": "## 3. 为产品生成模型提供图像的视觉描述。"
      },
      "typeVersion": 1
    },
    {
      "id": "4aa19058-24c9-4553-82e0-83630d8c7e67",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -32
      ],
      "parameters": {
        "color": 6,
        "width": 688,
        "height": 544,
        "content": "## 4. 使用模型创建产品图像。"
      },
      "typeVersion": 1
    },
    {
      "id": "48d3f1f4-ebd5-4c21-998c-ef40a81566ae",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 544,
        "content": "## 5. 再次将 Base64 字符串转换为二进制。"
      },
      "typeVersion": 1
    },
    {
      "id": "a234e62c-1d97-4310-8141-25788bb42ac7",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2384,
        -256
      ],
      "parameters": {
        "color": 3,
        "width": 848,
        "height": 256,
        "content": "## 将产品和模型+产品图像发送到 Discord 进行记录(可选步骤)"
      },
      "typeVersion": 1
    },
    {
      "id": "c0697c9a-9ae6-4f84-bb0f-ccf0c12e42e3",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2608,
        192
      ],
      "parameters": {
        "color": 5,
        "width": 656,
        "height": 512,
        "content": "## 6. 获取视觉描述并生成视频提示。"
      },
      "typeVersion": 1
    },
    {
      "id": "c7acddd4-6e37-4be5-8ac5-d09c2fc2e5c3",
      "name": "### 替换 Airtable 连接",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3280,
        192
      ],
      "parameters": {
        "color": 5,
        "width": 896,
        "height": 512,
        "content": "## 7. 视频生成并获取最终输出"
      },
      "typeVersion": 1
    },
    {
      "id": "d9014ac0-2a6b-456a-b2df-753565a17787",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4272,
        352
      ],
      "parameters": {
        "width": 288,
        "height": 336,
        "content": "如果您没有 MediaUpload 的托管版本,请替换为此类图片上传器,如 vgy.me"
      },
      "typeVersion": 1
    },
    {
      "id": "bd31d6b1-462a-435b-8514-e5ba2afd7fea",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        608
      ],
      "parameters": {
        "color": 3,
        "width": 624,
        "height": 288,
        "content": "在 Discord 或任何偏好的调试服务上获取错误信息。"
      },
      "typeVersion": 1
    },
    {
      "id": "5fac055a-83d5-419a-b336-fb82dd2f37b7",
      "name": "仅用于 n8n 测试",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "disabled": true,
      "position": [
        -960,
        224
      ],
      "webhookId": "74b4b451-0b35-4196-8509-29fcf70bc6ce",
      "parameters": {
        "public": true,
        "options": {
          "customCss": ":root {\n  /* Colors */\n  --chat--color-primary: #e74266;\n  --chat--color-primary-shade-50: #db4061;\n  --chat--color-primary-shade-100: #cf3c5c;\n  --chat--color-secondary: #20b69e;\n  --chat--color-secondary-shade-50: #1ca08a;\n  --chat--color-white: #ffffff;\n  --chat--color-light: #f2f4f8;\n  --chat--color-light-shade-50: #e6e9f1;\n  --chat--color-light-shade-100: #c2c5cc;\n  --chat--color-medium: #d2d4d9;\n  --chat--color-dark: #101330;\n  --chat--color-disabled: #777980;\n  --chat--color-typing: #404040;\n\n  /* Base Layout */\n  --chat--spacing: 1rem;\n  --chat--border-radius: 0.25rem;\n  --chat--transition-duration: 0.15s;\n  --chat--font-family: (\n    -apple-system,\n    BlinkMacSystemFont,\n    'Segoe UI',\n    Roboto,\n    Oxygen-Sans,\n    Ubuntu,\n    Cantarell,\n    'Helvetica Neue',\n    sans-serif\n  );\n\n  /* Window Dimensions */\n  --chat--window--width: 400px;\n  --chat--window--height: 600px;\n  --chat--window--bottom: var(--chat--spacing);\n  --chat--window--right: var(--chat--spacing);\n  --chat--window--z-index: 9999;\n  --chat--window--border: 1px solid var(--chat--color-light-shade-50);\n  --chat--window--border-radius: var(--chat--border-radius);\n  --chat--window--margin-bottom: var(--chat--spacing);\n\n  /* Header Styles */\n  --chat--header-height: auto;\n  --chat--header--padding: var(--chat--spacing);\n  --chat--header--background: var(--chat--color-dark);\n  --chat--header--color: var(--chat--color-light);\n  --chat--header--border-top: none;\n  --chat--header--border-bottom: none;\n  --chat--header--border-left: none;\n  --chat--header--border-right: none;\n  --chat--heading--font-size: 2em;\n  --chat--subtitle--font-size: inherit;\n  --chat--subtitle--line-height: 1.8;\n\n  /* Message Styles */\n  --chat--message--font-size: 1rem;\n  --chat--message--padding: var(--chat--spacing);\n  --chat--message--border-radius: var(--chat--border-radius);\n  --chat--message-line-height: 1.5;\n  --chat--message--margin-bottom: calc(var(--chat--spacing) * 1);\n  --chat--message--bot--background: var(--chat--color-white);\n  --chat--message--bot--color: var(--chat--color-dark);\n  --chat--message--bot--border: none;\n  --chat--message--user--background: var(--chat--color-secondary);\n  --chat--message--user--color: var(--chat--color-white);\n  --chat--message--user--border: none;\n  --chat--message--pre--background: rgba(0, 0, 0, 0.05);\n  --chat--messages-list--padding: var(--chat--spacing);\n\n  /* Toggle Button */\n  --chat--toggle--size: 64px;\n  --chat--toggle--width: var(--chat--toggle--size);\n  --chat--toggle--height: var(--chat--toggle--size);\n  --chat--toggle--border-radius: 50%;\n  --chat--toggle--background: var(--chat--color-primary);\n  --chat--toggle--hover--background: var(--chat--color-primary-shade-50);\n  --chat--toggle--active--background: var(--chat--color-primary-shade-100);\n  --chat--toggle--color: var(--chat--color-white);\n\n  /* Input Area */\n  --chat--textarea--height: 50px;\n  --chat--textarea--max-height: 30rem;\n  --chat--input--font-size: inherit;\n  --chat--input--border: 0;\n  --chat--input--border-radius: 0;\n  --chat--input--padding: 0.8rem;\n  --chat--input--background: var(--chat--color-white);\n  --chat--input--text-color: initial;\n  --chat--input--line-height: 1.5;\n  --chat--input--placeholder--font-size: var(--chat--input--font-size);\n  --chat--input--border-active: 0;\n  --chat--input--left--panel--width: 2rem;\n\n  /* Button Styles */\n  --chat--button--color: var(--chat--color-light);\n  --chat--button--background: var(--chat--color-primary);\n  --chat--button--padding: calc(var(--chat--spacing) * 1 / 2) var(--chat--spacing);\n  --chat--button--border-radius: var(--chat--border-radius);\n  --chat--button--hover--color: var(--chat--color-light);\n  --chat--button--hover--background: var(--chat--color-primary-shade-50);\n  --chat--close--button--color-hover: var(--chat--color-primary);\n\n  /* Send and File Buttons */\n  --chat--input--send--button--background: var(--chat--color-white);\n  --chat--input--send--button--color: var(--chat--color-light);\n  --chat--input--send--button--background-hover: var(--chat--color-primary-shade-50);\n  --chat--input--send--button--color-hover: var(--chat--color-secondary-shade-50);\n  --chat--input--file--button--background: var(--chat--color-white);\n  --chat--input--file--button--color: var(--chat--color-secondary);\n  --chat--input--file--button--background-hover: var(--chat--input--file--button--background);\n  --chat--input--file--button--color-hover: var(--chat--color-secondary-shade-50);\n  --chat--files-spacing: 0.25rem;\n\n  /* Body and Footer */\n  --chat--body--background: var(--chat--color-light);\n  --chat--footer--background: var(--chat--color-light);\n  --chat--footer--color: var(--chat--color-dark);\n}\n\n\n/* You can override any class styles, too. Right-click inspect in Chat UI to find class to override. */\n.chat-message {\n\tmax-width: 50%;\n}",
          "responseMode": "streaming"
        },
        "initialMessages": "Give me a Product Idea and I will Generate it and Add a model with it."
      },
      "typeVersion": 1.3
    },
    {
      "id": "7fd4515a-4e0f-40f0-9294-510e4617e590",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -32
      ],
      "parameters": {
        "width": 384,
        "height": 240,
        "content": "## 获取请求。"
      },
      "typeVersion": 1
    },
    {
      "id": "0cc0cd9d-f846-4acf-84e4-d17cb24c0d39",
      "name": "创意总监",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "The user wants to optimize a prompt for an AI assistant. The goal is to create a new prompt that is more clear, specific, and relevant for generating a \"video action prompt\" from an \"image prompt.\" The user has provided a prompt and an example.\n\nThe user's instructions for optimization are:\n1.  **Add specificity or context to the subject or scope.**\n2.  **Clearly define the desired structure and output format.**\n3.  **Specify style, tone, or target audience if necessary.**\n4.  **Include concrete examples to illustrate expectations, if applicable.**\n5.  **Clearly state constraints to limit the response's focus.**\n\nThe final response must be only the optimized prompt, with no additional text or explanations.\n\nApplying the optimization steps to the user's request:\n- **Step 1 (Specificity/Context):** The purpose is to convert an image generation prompt into a video generation prompt. The user wants an agent prompt that takes a descriptive image prompt as input and outputs a video prompt. The key is to translate static descriptions (lighting, composition, subject) into dynamic actions, camera movements, and scene progressions suitable for video.\n- **Step 2 (Desired Structure/Output):** The user specified a simple JSON output with a single key: `\"video_prompt\"`. This needs to be explicitly stated.\n- **Step 3 (Style/Tone):** The output video prompt should be in a detailed, descriptive style, focusing on actions, transitions, and camera work that correspond to the visual elements of the input image prompt.\n- **Step 4 (Examples):** The user provided an example. This should be incorporated into the optimized prompt to demonstrate the required input and output relationship.\n- **Step 5 (Constraints):** The prompt should only generate the JSON object. The response should be concise and focused on transforming the given input into the required output.\n\nBased on this analysis, the optimized prompt for the AI assistant will be a set of instructions that the assistant can use to perform the conversion task. It will include the purpose, input format, output format, and a clear example.\n\n**Optimized Prompt:**\n\"You are a prompt optimization agent. Your task is to transform a detailed, descriptive image generation prompt into a dynamic, action-oriented video generation prompt. The video prompt should translate the static elements of the image description (e.g., subject, lighting, setting, composition) into a series of logical camera movements, subject actions, and scene transitions suitable for a short cinematic video.\n\nThe input will be a descriptive image prompt.\n\nThe output must be a single JSON object with the key `\"video_prompt\"`. The value for this key will be the newly generated video prompt.\n\n**Example:**\n* **Input Image Prompt:** `Generate a high-resolution editorial-style image of a young, beautiful Indian American Origin woman holding a glass bottle of adivasi herbal oil with a wooden cap filled with amber liquid. The bottle features a label with a colorful tribal design showcasing elephants and peacocks, with text reading 'adivasi herbal oil natural ingredients tribal heritage'. The woman is positioned in a forest setting with sunlight filtering through the trees, standing near a surface resembling dirt or stone with scattered leaves and flowers around the bottle. Incorporate cinematic soft area lighting that creates natural yet dramatic illumination, highlighting the amber liquid in the bottle and the woman's features. Include ambient forest background elements slightly blurred to maintain focus on the product and model. Emphasize raw imperfections and natural textures while maintaining a polished, editorial aesthetic with rich colors and atmospheric lighting that evokes tribal heritage and natural wellness.`\n* **Desired JSON Output:** `{\"video_prompt\": \"A close-up shot of a glass bottle of adivasi herbal oil with amber liquid, focusing on the tribal-designed label as the camera pans slowly up. Transition to a wide shot of a young, Indian American woman in a forest, dappled sunlight filtering through the trees. The camera slowly zooms in as she gently raises the bottle, a soft smile on her face. The focus shifts to her hand as she unscrews the wooden cap, creating a soft, rustling sound. A final shot shows the woman holding the open bottle, with the ambient forest slightly blurred in the background, as the camera slowly dollies out to reveal the full scene. The entire sequence is captured with cinematic soft lighting, emphasizing the natural textures and rich colors.\"}`\n\nYour final response should be only the JSON output, based on the input prompt you are given. Do not provide any additional text, explanations, or analysis.\"",
      "position": [
        2912,
        336
      ],
      "parameters": {
        "text": "=Image Details is given Below:\n```\n{{ $json.content.parts[0].text }}\n```",
        "options": {
          "systemMessage": "=You are a Creative Director AI. Your role is to transform a detailed description of an image into a cinematic advertising concept. You will output a 4-second ad shot direction that highlights the product and the model in a visually compelling way.\n\nInstructions:\n\n* Read the image description carefully.\n* Identify the product and how it is presented (worn, held, displayed).\n* Place the product as the central focus of the scene.\n* Use the existing image context (lighting, background, mood, colors) to craft the ad direction.\n* Always specify: camera framing, model action/pose, emotional tone, environment interaction, and pacing for a 4-second shot.\n* Output must be a single, concise, production-ready shot direction.\n\nExample Input:\n\"a close up of a cheeseburger on a white plate the burger has a sesame seed bun a thick beef patty melted yellow cheese sliced red tomatoes and green lettuce the burger is centered in the frame against a blurred city skyline backdrop the lighting suggests an outdoor setting during golden hour\"\n\nExample Output:\n\"4-second golden hour shot: Camera starts tight on the juicy cheeseburger in the model’s hands, then slowly pans upward to reveal the smiling female model against the glowing city skyline. She lifts the burger slightly toward the lens, sunlight catching the melted cheese, creating an appetizing hero moment.\""
        },
        "promptType": "define",
        "needsFallback": true,
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Model": {
      "ai_languageModel": [
        [
          {
            "node": "Product Prompt Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Model Prompt Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Creative Director",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Discord1": {
      "main": [
        [
          {
            "node": "Generate Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the Data": {
      "main": [
        [
          {
            "node": "Product Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Send the Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Upload to MediaUpload2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form 1 - Alpha": {
      "main": [
        [
          {
            "node": "Get the Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Video": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload to MediaUpload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File1": {
      "main": [
        [
          {
            "node": "Upload to MediaUpload1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creative Director": {
      "main": [
        [
          {
            "node": "Generate Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image Url": {
      "main": [
        [
          {
            "node": "Product Visualiser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Response": {
      "main": [
        []
      ]
    },
    "Nano Banana Image": {
      "main": [
        [
          {
            "node": "Get the Base64 String",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Image Url1": {
      "main": [
        [
          {
            "node": "Discord1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Creative Visualiser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Visualiser": {
      "main": [
        [
          {
            "node": "Model Prompt Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creative Visualiser": {
      "main": [
        [
          {
            "node": "Creative Director",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Prompt Agent": {
      "main": [
        [
          {
            "node": "Nano Banana Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the Base64 String": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to MediaUpload": {
      "main": [
        [
          {
            "node": "Extract Image Url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the Base64 String1": {
      "main": [
        [
          {
            "node": "Convert to File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Model Prompt Generator": {
      "main": [
        [
          {
            "node": "Generate Model with Product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to MediaUpload1": {
      "main": [
        [
          {
            "node": "Extract Image Url1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only for Testing in n8n": {
      "main": [
        [
          {
            "node": "Product Prompt Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Creative Director",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Product Prompt Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Model Prompt Generator",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Product Prompt Agent",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Model Prompt Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "Creative Director",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Model with Product": {
      "main": [
        [
          {
            "node": "Get the Base64 String1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
Dhruv Dalsaniya

Dhruv Dalsaniya

@ddm21

IT Professional & Freelance Automation Consultant specializing in AI-driven automation and business process optimization

外部链接
在 n8n.io 查看

分享此工作流