8
n8n 中文网amn8n.com

使用 Nero AI Business API 创建图像增强 API 端点

中级

这是一个Design, AI领域的自动化工作流,包含 8 个节点。主要使用 If, Wait, Webhook, HttpRequest, RespondToWebhook 等节点,结合人工智能技术实现智能自动化。 使用 Nero AI Business API 创建图像增强 API 端点

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "a6e279c50a7024b3eb450d8593ec3a4b5453fd5a8763f02c0bc267684a7d6963"
  },
  "nodes": [
    {
      "id": "971a6566-192d-4ad8-acc1-e9e2f629151f",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -40,
        0
      ],
      "webhookId": "c9795945-7dbb-45cb-9082-d3629f15504a",
      "parameters": {
        "path": "c9795945-7dbb-45cb-9082-d3629f15504a",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "faef3c56-cfd9-407e-8118-8b41d8864c36",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1160,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "a30aaef1-8761-4b49-9b92-68922593feac",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        440,
        0
      ],
      "webhookId": "59a2e9e4-6c03-4672-815f-9c9093ce0828",
      "parameters": {
        "amount": 2
      },
      "typeVersion": 1.1
    },
    {
      "id": "63bb4342-5d24-43c3-b632-5946cdc4c64b",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        880,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e2dbf1c1-d68c-4202-acf9-dab4624281f3",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.code }}",
              "rightValue": 0
            },
            {
              "id": "bc499e4c-8eed-40d8-b09f-eb57df6d301f",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "done"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9ef7adc4-43cc-4e28-ad21-04681e5d3587",
      "name": "创建任务",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "https://ai.nero.com/biz/api/task",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n    \"type\": \"FaceDetection\",\n    \"body\": {\n        \"images\": [\n            \"https://image.url\"\n        ]\n    }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "x-neroai-api-key",
              "value": "your API key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "17fd191a-de94-42ca-9bb3-e79aeca82f03",
      "name": "查询任务状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        0
      ],
      "parameters": {
        "url": "https://ai.nero.com/biz/api/task",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "task_id",
              "value": "={{ $json.data.task_id }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-neroai-api-key",
              "value": "your API key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ddf31898-d972-41ca-a6bb-552fdb07997b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        -460
      ],
      "parameters": {
        "width": 620,
        "height": 140,
        "content": "## 创建 AI 任务 API 端点"
      },
      "typeVersion": 1
    },
    {
      "id": "08f7c363-1e06-4f4e-b1ee-60d6d43d6bf7",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        -300
      ],
      "parameters": {
        "width": 620,
        "height": 240,
        "content": "### 使用方法"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Query task status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Create task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create task": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query task status": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 设计, 人工智能

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流