{
  "name": "Comify AI \u2013 IDM-VTON Try-On & Size Recommendation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "comify-tryon",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-tryon",
      "name": "Try-On Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        220,
        200
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "comify-size",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-size",
      "name": "Size Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        220,
        600
      ]
    },
    {
      "parameters": {
        "httpMethod": "GET",
        "path": "comify-health",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-health",
      "name": "Health Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        220,
        900
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://host.docker.internal:8001/api/generate-tryon-b64",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ person_image: $json.body.person_image, garment_image: $json.body.garment_image, category: $json.body.category || 'tops' }) }}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "call-fastapi-tryon",
      "name": "FastAPI Try-On (HF IDM-VTON)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "http://host.docker.internal:8001/api/size-recommendation-b64",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ person_image: $json.body.person_image }) }}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "call-fastapi-size",
      "name": "FastAPI Size (MediaPipe)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        600
      ]
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems"
      },
      "id": "respond-tryon",
      "name": "Respond Try-On",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        820,
        200
      ]
    },
    {
      "parameters": {
        "respondWith": "allIncomingItems"
      },
      "id": "respond-size",
      "name": "Respond Size",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        820,
        600
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{\"status\":\"ok\",\"orchestrator\":\"n8n\",\"model\":\"IDM-VTON (HF Space)\",\"services\":{\"fastapi\":true,\"hf_space\":true}}"
      },
      "id": "respond-health",
      "name": "Respond Health",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        520,
        900
      ]
    }
  ],
  "connections": {
    "Try-On Webhook": {
      "main": [
        [
          {
            "node": "FastAPI Try-On (HF IDM-VTON)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FastAPI Try-On (HF IDM-VTON)": {
      "main": [
        [
          {
            "node": "Respond Try-On",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Size Webhook": {
      "main": [
        [
          {
            "node": "FastAPI Size (MediaPipe)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FastAPI Size (MediaPipe)": {
      "main": [
        [
          {
            "node": "Respond Size",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Health Webhook": {
      "main": [
        [
          {
            "node": "Respond Health",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true
  },
  "tags": [
    {
      "name": "comify-ai"
    },
    {
      "name": "idm-vton"
    },
    {
      "name": "virtual-tryon"
    }
  ]
}