字节跳动/Seedream-3 - 图像生成器

中级

这是一个Content Creation、Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 If、Set、Code、Wait、HttpRequest 等节点。 字节跳动 Seedream 3:文本到图像转换模板

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "1f5a2fec-39f4-4349-9b27-e2102cbed9ac",
    "model_name": "seedream-3",
    "model_type": "image",
    "version_id": "e97385a576173b08a6a87546457582b01f65bf29a4dc00f1191e884894e0bc73",
    "model_owner": "bytedance",
    "generated_at": "2025-08-01T14:47:17.107003"
  },
  "name": "bytedance/seedream-3 - 图像生成器",
  "nodes": [
    {
      "id": "7c70a742-ad5c-41fe-b67a-3789fa4e092f",
      "name": "手动触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "286c2748-4d2f-4302-b9d1-9351b0d770f1",
      "name": "设置 API 令牌",
      "type": "n8n-nodes-base.set",
      "position": [
        -608,
        -80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "api_token",
              "name": "api_token",
              "type": "string",
              "value": "YOUR_REPLICATE_API_TOKEN"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "65c18fb5-2bb6-41a5-85ac-f6797899ba89",
      "name": "设置图像参数",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "api_token",
              "name": "api_token",
              "type": "string",
              "value": "={{ $('Set API Token').item.json.api_token }}"
            },
            {
              "id": "seed",
              "name": "seed",
              "type": "number",
              "value": -1
            },
            {
              "id": "size",
              "name": "size",
              "type": "string",
              "value": "regular"
            },
            {
              "id": "width",
              "name": "width",
              "type": "number",
              "value": 2048
            },
            {
              "id": "height",
              "name": "height",
              "type": "number",
              "value": 2048
            },
            {
              "id": "prompt",
              "name": "prompt",
              "type": "string",
              "value": "A beautiful landscape with mountains and a lake at sunset"
            },
            {
              "id": "aspect_ratio",
              "name": "aspect_ratio",
              "type": "string",
              "value": "16:9"
            },
            {
              "id": "guidance_scale",
              "name": "guidance_scale",
              "type": "number",
              "value": 2.5
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "e4b14fdf-9aa5-4afb-8757-e7ba31de4f7a",
      "name": "创建图像预测",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -64,
        -128
      ],
      "parameters": {
        "url": "https://api.replicate.com/v1/predictions",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={\n  \"version\": \"bytedance/seedream-3:e97385a576173b08a6a87546457582b01f65bf29a4dc00f1191e884894e0bc73\",\n  \"input\": {\n    \"seed\": {{ $json.seed }},\n    \"size\": \"{{ $json.size }}\",\n    \"width\": {{ $json.width }},\n    \"height\": {{ $json.height }},\n    \"prompt\": \"{{ $json.prompt }}\",\n    \"aspect_ratio\": \"{{ $json.aspect_ratio }}\",\n    \"guidance_scale\": {{ $json.guidance_scale }}\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.api_token }}"
            },
            {
              "name": "Prefer",
              "value": "wait"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "c69c73eb-3ffc-4ff5-90b1-c1dba7973284",
      "name": "等待 5 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        160,
        -128
      ],
      "webhookId": "d2c4ca16-0eb2-45b4-8a2d-eec2f99df89c",
      "parameters": {
        "unit": "seconds",
        "amount": 5
      },
      "typeVersion": 1
    },
    {
      "id": "635fba91-6137-40bc-9673-8aab72fc69c8",
      "name": "检查状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -128
      ],
      "parameters": {
        "url": "=https://api.replicate.com/v1/predictions/{{ $('Create Image Prediction').item.json.id }}",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Set API Token').item.json.api_token }}"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "30a253aa-9d94-40ea-93e0-af414ff57c75",
      "name": "是否完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        528,
        -240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c93d7ba1-0ef9-4087-aa10-389cb2a2c6bd",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "succeeded"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ae00258b-253b-450f-b220-6c4c5ba4901b",
      "name": "是否失败?",
      "type": "n8n-nodes-base.if",
      "position": [
        848,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d1bfd044-3a07-4c18-b55f-72d192596139",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "0f401c8d-582b-444b-abe5-c9fef92c0d20",
      "name": "等待 10 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        720,
        128
      ],
      "webhookId": "51a05aef-e220-406d-8c2c-e59c82c3e26e",
      "parameters": {
        "unit": "seconds",
        "amount": 10
      },
      "typeVersion": 1
    },
    {
      "id": "07a12655-16fd-43d7-9cf7-a2f4651bd711",
      "name": "成功响应",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "success-response",
              "name": "response",
              "type": "object",
              "value": "={{ { success: true, image_url: $json.output, prediction_id: $json.id, status: $json.status, message: 'Image generated successfully' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "5762b602-866b-4d7c-8ae9-4bb51cb22f5c",
      "name": "错误响应",
      "type": "n8n-nodes-base.set",
      "position": [
        1344,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "error-response",
              "name": "response",
              "type": "object",
              "value": "={{ { success: false, error: $json.error || 'Image generation failed', prediction_id: $json.id, status: $json.status, message: 'Failed to generate image' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "156f1f5a-9bdc-4663-a9f4-4d0d473bb756",
      "name": "显示结果",
      "type": "n8n-nodes-base.set",
      "position": [
        1552,
        -144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "final-result",
              "name": "final_result",
              "type": "object",
              "value": "={{ $json.response }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "fcf1219b-7956-4afd-af9e-25051b535276",
      "name": "记录请求",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        -320
      ],
      "parameters": {
        "jsCode": "// Log generation details for monitoring\nconst data = $input.all()[0].json;\n\nconsole.log('bytedance/seedream-3 Request:', {\n  timestamp: new Date().toISOString(),\n  prediction_id: data.id,\n  model_type: 'image'\n});\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "991b2f2b-ae9d-4c33-a53a-f174826b115a",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -304
      ],
      "parameters": {
        "color": 4,
        "width": 580,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "51cf2652-514e-415c-821b-100d550dd209",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 589,
        "height": 1958,
        "content": "## 🤖 **BYTEDANCE/SEEDREAM-3 - 图像生成工作流**"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "versionId": "1",
  "connections": {
    "Wait 5s": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10s": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Failed?": {
      "main": [
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Request": {
      "main": [
        [
          {
            "node": "Wait 5s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Is Complete?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Complete?": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Has Failed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Token": {
      "main": [
        [
          {
            "node": "Set Image Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Response": {
      "main": [
        [
          {
            "node": "Display Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set API Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Response": {
      "main": [
        [
          {
            "node": "Display Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image Parameters": {
      "main": [
        [
          {
            "node": "Create Image Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Image Prediction": {
      "main": [
        [
          {
            "node": "Log Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个中级难度的工作流,适用于Content Creation、Multimodal AI等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

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

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

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

外部链接
在 n8n.io 上查看 →

分享此工作流