8
n8n 中文网amn8n.com

电商网站虚拟试衣表单

高级

这是一个AI领域的自动化工作流,包含 16 个节点。主要使用 If, Ftp, Form, Wait, FormTrigger 等节点,结合人工智能技术实现智能自动化。 基于WooCommerce、Shopify、Prestashop的AI驱动一键虚拟试衣间

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "bnkWL5ReJLmi9DKA",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "电商网站虚拟试衣表单",
  "tags": [],
  "nodes": [
    {
      "id": "ec6c9aa4-aa67-4f76-bda5-2d8368995993",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -680,
        200
      ],
      "webhookId": "ca1c314d-46c6-4eeb-b6a5-359de7601906",
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Virtual Try On",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Nome",
              "placeholder": "Nome",
              "requiredField": true
            },
            {
              "fieldName": "Product",
              "fieldType": "hiddenField"
            },
            {
              "fieldType": "file",
              "fieldLabel": "Me",
              "requiredField": true,
              "acceptFileTypes": ".jpg,.png"
            }
          ]
        },
        "formDescription": "Upload your image and virtually try on the dress"
      },
      "typeVersion": 2.2
    },
    {
      "id": "12941dfe-2c91-4270-87a4-510f83c7aa65",
      "name": "FTP",
      "type": "n8n-nodes-base.ftp",
      "position": [
        -420,
        200
      ],
      "parameters": {
        "path": "=/eolianpenthouse.dev.eureweb.it/test/{{$now.format('yyyyyyLLddHHii')}}-{{ $json.Me[0].filename }}",
        "operation": "upload",
        "binaryPropertyName": "Me"
      },
      "credentials": {
        "ftp": {
          "id": "VRMB0CWVo86cIM26",
          "name": "FTP account (Eolian DEV)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d5524925-4d2d-4c95-9efc-c877004e65b0",
      "name": "获取图片URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -680,
        460
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/kling/requests/{{ $json.request_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "daOZafXpRXLtoLUV",
          "name": "Fal.run API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "87300ee2-366e-469b-85bf-9dbd1d5de850",
      "name": "获取状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        200
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/kling/requests/{{ $('Create Image').item.json.request_id }}/status ",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "daOZafXpRXLtoLUV",
          "name": "Fal.run API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8db4508e-b82a-4134-85c7-44b2162d5da6",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -980
      ],
      "parameters": {
        "color": 6,
        "width": 340,
        "height": 540,
        "content": "## 模特"
      },
      "typeVersion": 1
    },
    {
      "id": "f4765a45-0ad4-49d6-8227-9cc3e050b429",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -980
      ],
      "parameters": {
        "color": 6,
        "width": 360,
        "height": 540,
        "content": "## 商品"
      },
      "typeVersion": 1
    },
    {
      "id": "79a6158d-fb3c-4293-82cc-e344aa21db37",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -980
      ],
      "parameters": {
        "color": 4,
        "width": 340,
        "height": 540,
        "content": "## 结果"
      },
      "typeVersion": 1
    },
    {
      "id": "032557a3-1ced-47d3-8e72-b1e3057d9e46",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -1260
      ],
      "parameters": {
        "color": 3,
        "width": 740,
        "height": 240,
        "content": "# 功能特性"
      },
      "typeVersion": 1
    },
    {
      "id": "6a740b21-b95f-4c8e-bb92-c205e52e3925",
      "name": "已完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        420,
        200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "383d112e-2cc6-4dd4-8985-f09ce0bd1781",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f33040d8-cbac-4c21-845b-10397c5210cc",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -80
      ],
      "parameters": {
        "width": 740,
        "height": 180,
        "content": "## 步骤3 - 电商平台"
      },
      "typeVersion": 1
    },
    {
      "id": "0799d997-c38e-4c84-8096-0f2ef04b0223",
      "name": "创建图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -180,
        200
      ],
      "parameters": {
        "url": "https://queue.fal.run/fal-ai/kling/v1-5/kolors-virtual-try-on",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"human_image_url\": \"https://eolianpenthouse.dev.eureweb.it/test/{{$now.format('yyyyyyLLddHHii')}}-{{ $json.Me[0].filename }}\",\n  \"garment_image_url\": \"{{ $('On form submission').item.json.Product }}\"\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "daOZafXpRXLtoLUV",
          "name": "Fal.run API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "63e29ad5-5965-4a2c-98f5-bc89124a6b21",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -400
      ],
      "parameters": {
        "width": 740,
        "height": 140,
        "content": "## 步骤1 - 获取API密钥(YOURAPIKEY)"
      },
      "typeVersion": 1
    },
    {
      "id": "67188445-73c4-4070-b1f8-6e21beb3e1fa",
      "name": "表单",
      "type": "n8n-nodes-base.form",
      "position": [
        -240,
        460
      ],
      "webhookId": "69559b3a-3175-4864-8e41-2892eaa80d8e",
      "parameters": {
        "operation": "completion",
        "redirectUrl": "={{ $json.image.url }}",
        "respondWith": "redirect"
      },
      "typeVersion": 1
    },
    {
      "id": "1a65532e-abb9-4c3f-99c3-ddf35e7ed5e4",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -220
      ],
      "parameters": {
        "width": 740,
        "height": 100,
        "content": "## 步骤2 - FTP"
      },
      "typeVersion": 1
    },
    {
      "id": "cf2e4f76-e658-4aa3-a6c0-9a85bb1749e6",
      "name": "获取图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -460,
        460
      ],
      "parameters": {
        "url": "={{ $json.image.url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "04573589-8467-4768-9451-177aa2d19f57",
      "name": "等待10秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        60,
        200
      ],
      "webhookId": "351bd496-a9cc-445c-86f6-a56189df0028",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c42ea134-5e24-4e45-9a6b-0f0765c4c13c",
  "connections": {
    "FTP": {
      "main": [
        [
          {
            "node": "Create Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form": {
      "main": [
        []
      ]
    },
    "Get image": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Completed?": {
      "main": [
        [
          {
            "node": "Get Url image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10 sec.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get status": {
      "main": [
        [
          {
            "node": "Completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Image": {
      "main": [
        [
          {
            "node": "Wait 10 sec.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10 sec.": {
      "main": [
        [
          {
            "node": "Get status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Url image": {
      "main": [
        [
          {
            "node": "Get image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "FTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人工智能

需要付费吗?

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

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

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

作者

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza

外部链接
在 n8n.io 查看

分享此工作流