8
n8n 中文网amn8n.com

moicarmonas/3rdmoises_generator_oldversion - 其他生成器

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 If, Set, Code, Wait, HttpRequest 等节点。 使用3rd Moises生成器和Replicate从文本提示创建图片

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "8abf3e10-c261-4f37-a468-bd6f5639f323",
    "model_name": "3rdmoises_generator_oldversion",
    "model_type": "other",
    "version_id": "214591a08f5e60ddfc97576ebe4562491b8d559920b0e17ae04caa1fc0291270",
    "model_owner": "moicarmonas",
    "generated_at": "2025-08-01T14:50:46.520555"
  },
  "name": "moicarmonas/3rdmoises_generator_oldversion - 其他生成器",
  "nodes": [
    {
      "id": "f3183bd9-f0b9-4a89-b8cd-cc6d998f8448",
      "name": "手动触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "500c5132-fc76-4cc0-8989-ac943ad0cdfb",
      "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": "1f1d4544-9969-4056-86fc-02774ba559b8",
      "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": "mask",
              "name": "mask",
              "type": "string",
              "value": "https://via.placeholder.com/512x512/000000/FFFFFF.png"
            },
            {
              "id": "seed",
              "name": "seed",
              "type": "number",
              "value": -1
            },
            {
              "id": "image",
              "name": "image",
              "type": "string",
              "value": "https://picsum.photos/512/512"
            },
            {
              "id": "model",
              "name": "model",
              "type": "string",
              "value": "dev"
            },
            {
              "id": "width",
              "name": "width",
              "type": "number",
              "value": 512
            },
            {
              "id": "height",
              "name": "height",
              "type": "number",
              "value": 512
            },
            {
              "id": "prompt",
              "name": "prompt",
              "type": "string",
              "value": "Create something amazing"
            },
            {
              "id": "go_fast",
              "name": "go_fast",
              "type": "boolean",
              "value": false
            },
            {
              "id": "extra_lora",
              "name": "extra_lora",
              "type": "string",
              "value": ""
            },
            {
              "id": "lora_scale",
              "name": "lora_scale",
              "type": "number",
              "value": 1
            },
            {
              "id": "megapixels",
              "name": "megapixels",
              "type": "string",
              "value": "1"
            },
            {
              "id": "num_outputs",
              "name": "num_outputs",
              "type": "number",
              "value": 1
            },
            {
              "id": "aspect_ratio",
              "name": "aspect_ratio",
              "type": "string",
              "value": "1:1"
            },
            {
              "id": "output_format",
              "name": "output_format",
              "type": "string",
              "value": "webp"
            },
            {
              "id": "guidance_scale",
              "name": "guidance_scale",
              "type": "number",
              "value": 3
            },
            {
              "id": "output_quality",
              "name": "output_quality",
              "type": "number",
              "value": 80
            },
            {
              "id": "prompt_strength",
              "name": "prompt_strength",
              "type": "number",
              "value": 0.8
            },
            {
              "id": "extra_lora_scale",
              "name": "extra_lora_scale",
              "type": "number",
              "value": 1
            },
            {
              "id": "replicate_weights",
              "name": "replicate_weights",
              "type": "string",
              "value": ""
            },
            {
              "id": "num_inference_steps",
              "name": "num_inference_steps",
              "type": "number",
              "value": 28
            },
            {
              "id": "disable_safety_checker",
              "name": "disable_safety_checker",
              "type": "boolean",
              "value": false
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "52006163-2c92-421a-be5e-12575ae353d6",
      "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\": \"moicarmonas/3rdmoises_generator_oldversion:214591a08f5e60ddfc97576ebe4562491b8d559920b0e17ae04caa1fc0291270\",\n  \"input\": {\n    \"mask\": \"{{ $json.mask }}\",\n    \"seed\": {{ $json.seed }},\n    \"image\": \"{{ $json.image }}\",\n    \"model\": \"{{ $json.model }}\",\n    \"width\": {{ $json.width }},\n    \"height\": {{ $json.height }},\n    \"prompt\": \"{{ $json.prompt }}\",\n    \"go_fast\": {{ $json.go_fast }},\n    \"extra_lora\": \"{{ $json.extra_lora }}\",\n    \"lora_scale\": {{ $json.lora_scale }},\n    \"megapixels\": \"{{ $json.megapixels }}\",\n    \"num_outputs\": {{ $json.num_outputs }},\n    \"aspect_ratio\": \"{{ $json.aspect_ratio }}\",\n    \"output_format\": \"{{ $json.output_format }}\",\n    \"guidance_scale\": {{ $json.guidance_scale }},\n    \"output_quality\": {{ $json.output_quality }},\n    \"prompt_strength\": {{ $json.prompt_strength }},\n    \"extra_lora_scale\": {{ $json.extra_lora_scale }},\n    \"replicate_weights\": \"{{ $json.replicate_weights }}\",\n    \"num_inference_steps\": {{ $json.num_inference_steps }},\n    \"disable_safety_checker\": {{ $json.disable_safety_checker }}\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": "39e5df20-997b-452f-9a93-5fc1fb26bac3",
      "name": "等待 5 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        160,
        -128
      ],
      "webhookId": "d2c4ca16-0eb2-45b4-8a2d-eec2f99df89c",
      "parameters": {
        "unit": "seconds",
        "amount": 5
      },
      "typeVersion": 1
    },
    {
      "id": "60f21df6-f8b8-4924-b520-e1c5472d6a8b",
      "name": "检查状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -128
      ],
      "parameters": {
        "url": "=https://api.replicate.com/v1/predictions/{{ $('Create Other 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": "e75e1dc9-bf3b-41d6-8fd2-06c73b6abaf0",
      "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": "72b22f6a-a174-485e-858a-66b040643db2",
      "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": "75af4b99-2b75-4a32-8cfd-3887cd7f0e2c",
      "name": "等待 10 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        720,
        128
      ],
      "webhookId": "51a05aef-e220-406d-8c2c-e59c82c3e26e",
      "parameters": {
        "unit": "seconds",
        "amount": 10
      },
      "typeVersion": 1
    },
    {
      "id": "ae82bc7e-4b96-49b2-a02a-342442256a3e",
      "name": "成功响应",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "success-response",
              "name": "response",
              "type": "object",
              "value": "={{ { success: true, result_url: $json.output, prediction_id: $json.id, status: $json.status, message: 'Other generated successfully' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "87fbd29f-8aa0-4198-9c76-23861ad017f2",
      "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 || 'Other generation failed', prediction_id: $json.id, status: $json.status, message: 'Failed to generate other' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "70869825-f4f7-417a-ae6f-df692619d3aa",
      "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": "22e8a915-54f8-41da-86a8-5ab03bc1cb2a",
      "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('moicarmonas/3rdmoises_generator_oldversion Request:', {\n  timestamp: new Date().toISOString(),\n  prediction_id: data.id,\n  model_type: 'other'\n});\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "6b651fed-f7d0-4050-ba53-1309830622bd",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -304
      ],
      "parameters": {
        "color": 4,
        "width": 580,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "e6009f0e-20ad-459b-80ee-fea70f5c304b",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 589,
        "height": 1958,
        "content": "## 🤖 **MOICARMONAS/3RDMOISES_GENERATOR_OLDVERSION - 其他生成工作流**"
      },
      "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 Other 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 Other Parameters": {
      "main": [
        [
          {
            "node": "Create Other Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Other Prediction": {
      "main": [
        [
          {
            "node": "Log Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 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 查看

分享此工作流