{
  "name": "Vorlux AI | Content Image Gen (ComfyUI)",
  "active": false,
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "content-image-gen",
        "options": { "responseMode": "lastNode" }
      },
      "id": "webhook-trigger",
      "name": "Image Gen 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 || 'Blog Post';\nconst description = data.description || data.summary || '';\nconst style = data.style || 'modern-tech';\n\nconst stylePrompts = {\n  'modern-tech': 'sleek modern technology illustration, clean lines, gradient colors, digital art, professional',\n  'gaming': 'vibrant gaming illustration, neon colors, dynamic composition, esports style',\n  'community': 'warm community illustration, people connecting, friendly atmosphere, flat design',\n  'tutorial': 'clean educational diagram, step by step, minimal style, infographic',\n  'podcast': 'audio wave visualization, microphone, studio atmosphere, moody lighting'\n};\n\nconst prompt = `${stylePrompts[style] || stylePrompts['modern-tech']}, topic: ${title}, ${description.substring(0, 200)}`;\nreturn [{ json: { prompt, title, style, contentId: data.contentId, width: data.width || 1200, height: data.height || 630 } }];"
      },
      "id": "build-prompt",
      "name": "Build Image Prompt",
      "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({ prompt: $json.prompt, width: $json.width, height: $json.height, steps: 30, cfg: 7.5 }) }}",
        "options": { "timeout": 120000 }
      },
      "id": "generate-image",
      "name": "Generate via ComfyUI",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [700, 300]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:3010/api/assets/upload",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ imageUrl: $json.url || $json.imageUrl || $json.output, category: 'blog-images', title: $('Build Image Prompt').first().json.title + ' - Featured Image', contentId: $('Build Image Prompt').first().json.contentId }) }}",
        "options": { "timeout": 30000 }
      },
      "id": "upload-asset",
      "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: '🎨 **Image Generated**\\nTitle: ' + $('Build Image Prompt').first().json.title + '\\nStyle: ' + $('Build Image Prompt').first().json.style + '\\nSize: ' + $('Build Image Prompt').first().json.width + 'x' + $('Build Image Prompt').first().json.height }) }}"
      },
      "id": "discord-notify",
      "name": "Discord Notify",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1180, 300]
    }
  ],
  "connections": {
    "Image Gen Webhook": { "main": [[{ "node": "Build Image Prompt", "type": "main", "index": 0 }]] },
    "Build Image Prompt": { "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" }
}
