{
  "name": "Vorlux AI | ComfyUI Social Images",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "social-images",
        "options": {
          "responseMode": "lastNode"
        }
      },
      "id": "webhook",
      "name": "Social Images Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const data = $input.first().json.body || $input.first().json;\nconst title = data.title || 'Content';\nconst platforms = [\n  { name: 'twitter', width: 1200, height: 675, style: 'bold text overlay, eye-catching' },\n  { name: 'instagram', width: 1080, height: 1080, style: 'square format, vibrant colors' },\n  { name: 'linkedin', width: 1200, height: 627, style: 'professional, clean design' },\n  { name: 'youtube-thumbnail', width: 1280, height: 720, style: 'dramatic, high contrast' }\n];\nconst jobs = platforms.map(p => ({\n  platform: p.name,\n  prompt: p.style + ', topic: ' + title,\n  width: p.width,\n  height: p.height\n}));\nreturn [{ json: { title, jobs, count: jobs.length } }];"
      },
      "id": "plan",
      "name": "Plan Platform Images",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:3010/api/comfyui",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ batch: $json.jobs }) }}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "generate",
      "name": "Generate via ComfyUI",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:3010/api/assets/bulk-upload",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ images: $json.results || $json.data || [], category: 'social-images', title: $('Plan Platform Images').first().json.title }) }}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "upload",
      "name": "Upload to Asset Library",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_CONTENT_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ content: '\ud83d\uddbc\ufe0f **Social Images Generated**\\nTitle: ' + $('Plan Platform Images').first().json.title + '\\nPlatforms: ' + $('Plan Platform Images').first().json.count }) }}"
      },
      "id": "notify",
      "name": "Discord Notify",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1180,
        300
      ]
    }
  ],
  "connections": {
    "Social Images Webhook": {
      "main": [
        [
          {
            "node": "Plan Platform Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Plan Platform Images": {
      "main": [
        [
          {
            "node": "Generate via ComfyUI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate via ComfyUI": {
      "main": [
        [
          {
            "node": "Upload to Asset Library",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Asset Library": {
      "main": [
        [
          {
            "node": "Discord Notify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}