8
n8n 中文网amn8n.com

moicarmonas/2ndmoises_generator - 其他生成器

中级

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

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "6af15b39-3eda-4d54-80ae-23a6ef241a94",
    "model_name": "2ndmoises_generator",
    "model_type": "other",
    "version_id": "7ae928ae3e6f1614129b139f34503ff4e91e922e7487658a47ad600bca16d5b0",
    "model_owner": "moicarmonas",
    "generated_at": "2025-08-01T14:50:46.536560"
  },
  "name": "moicarmonas/2ndmoises_generator - 其他生成器",
  "nodes": [
    {
      "id": "246e87e1-7955-4854-8664-63dcced9f6a9",
      "name": "手动触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "93d20458-db38-4ba1-b124-17d89f65aca3",
      "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": "72398a06-c5d1-46d8-acc4-0e6543702c36",
      "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": "136df8bc-30c2-40f6-a55e-dd04d206c7a5",
      "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/2ndmoises_generator:7ae928ae3e6f1614129b139f34503ff4e91e922e7487658a47ad600bca16d5b0\",\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": "c69d5d6f-d105-42cf-9abe-3fd679b93538",
      "name": "等待 5 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        160,
        -128
      ],
      "webhookId": "d2c4ca16-0eb2-45b4-8a2d-eec2f99df89c",
      "parameters": {
        "unit": "seconds",
        "amount": 5
      },
      "typeVersion": 1
    },
    {
      "id": "67fa6c33-b573-44ce-9f6f-1e142a013646",
      "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": "26dafdd3-6591-442b-841e-c424cfa26410",
      "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": "8a1e3f75-89d2-42b0-8261-dcd76c017fa1",
      "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": "785a3511-deef-49c4-9fa9-929dab665fd0",
      "name": "等待 10 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        720,
        128
      ],
      "webhookId": "51a05aef-e220-406d-8c2c-e59c82c3e26e",
      "parameters": {
        "unit": "seconds",
        "amount": 10
      },
      "typeVersion": 1
    },
    {
      "id": "874d3cc8-2785-47d0-b85e-1c4980456358",
      "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": "d070b069-974b-405c-bab8-c4f2ac375227",
      "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": "68640bde-1a28-45a4-b5fc-40f7e667a593",
      "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": "854ecedb-1c34-4724-b8f1-cc22c99115a9",
      "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/2ndmoises_generator Request:', {\n  timestamp: new Date().toISOString(),\n  prediction_id: data.id,\n  model_type: 'other'\n});\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "dea38c09-f894-4ac0-8d56-aabe6cc30465",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -304
      ],
      "parameters": {
        "color": 4,
        "width": 580,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "e3a758ba-0b53-4598-b763-ed6f25678114",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 589,
        "height": 1958,
        "content": "## 🤖 **MOICARMONAS/2NDMOISES_GENERATOR - 其他生成工作流**"
      },
      "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 查看

分享此工作流