{
  "name": "Vorlux AI | Thumbnail Scene Grabber",
  "nodes": [
    {
      "id": "84a10051-bbab-4865-8013-42efccf499cf",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        220,
        300
      ],
      "webhookId": "89931e5d-51f0-4c2d-b5a7-bdf17da7cdfd",
      "parameters": {
        "httpMethod": "POST",
        "path": "thumb-grab",
        "options": {
          "responseMode": "lastNode"
        }
      }
    },
    {
      "id": "7a6edb33-a8a0-4029-8f42-c6ebc6afe4a7",
      "name": "Process",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const d=$input.first().json.body||$input.first().json;\nreturn [{json:{sessionId:d.sessionId||'',prompt:d.prompt||'Gaming thumbnail, bold text, neon accents, 1280x720',ts:new Date().toISOString()}}];"
      }
    },
    {
      "id": "c37fe673-f309-45b7-a6b1-85f08fa61f0a",
      "name": "ComfyUI Generate",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        200
      ],
      "notes": "Sends SDXL generation to ComfyUI with proper API format node linkages",
      "parameters": {
        "method": "POST",
        "url": "={{$env.COMFYUI_URL||\"http://100.79.221.32:8188\"}}/prompt",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"prompt\":{\"3\":{\"class_type\":\"KSampler\",\"inputs\":{\"cfg\":7,\"denoise\":1,\"model\":[\"4\",0],\"negative\":[\"7\",0],\"positive\":[\"6\",0],\"latent_image\":[\"5\",0],\"sampler_name\":\"dpmpp_2m\",\"scheduler\":\"karras\",\"seed\":{{ Math.floor(Math.random()*999999) }},\"steps\":25}},\"4\":{\"class_type\":\"CheckpointLoaderSimple\",\"inputs\":{\"ckpt_name\":\"sdXL_v10VAEFix.safetensors\"}},\"5\":{\"class_type\":\"EmptyLatentImage\",\"inputs\":{\"batch_size\":1,\"height\":720,\"width\":1280}},\"6\":{\"class_type\":\"CLIPTextEncode\",\"inputs\":{\"clip\":[\"4\",1],\"text\":\"{{ $json.prompt }}\"}},\"7\":{\"class_type\":\"CLIPTextEncode\",\"inputs\":{\"clip\":[\"4\",1],\"text\":\"blurry, low quality, watermark, deformed\"}},\"8\":{\"class_type\":\"VAEDecode\",\"inputs\":{\"samples\":[\"3\",0],\"vae\":[\"4\",2]}},\"9\":{\"class_type\":\"SaveImage\",\"inputs\":{\"filename_prefix\":\"thumb\",\"images\":[\"8\",0]}}}}",
        "options": {
          "timeout": 120000
        }
      }
    },
    {
      "id": "823fde7d-cf68-4407-aaf8-97229899191d",
      "name": "Save Ref",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/content/library",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"type\":\"thumbnail\",\"sessionId\":\"{{ $json.sessionId }}\",\"prompt\":\"{{ $json.prompt }}\"}",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "d2ba4eee-6d73-4667-a15f-a00c5cb03f69",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        940,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ok:true}) }}"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process": {
      "main": [
        [
          {
            "node": "ComfyUI Generate",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Ref",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ComfyUI Generate": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Ref": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}