{
  "last_node_id": 8,
  "last_link_id": 9,
  "nodes": [
    {
      "id": 1,
      "type": "CheckpointLoaderSimple",
      "pos": [
        50,
        100
      ],
      "size": [
        315,
        98
      ],
      "properties": {
        "Node name for S&R": "CheckpointLoaderSimple"
      },
      "widgets_values": [
        "sd_xl_turbo_1.0_fp16.safetensors"
      ]
    },
    {
      "id": 2,
      "type": "CLIPTextEncode",
      "pos": [
        450,
        50
      ],
      "size": [
        450,
        200
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "API_POSITIVE_PROMPT_PLACEHOLDER"
      ]
    },
    {
      "id": 3,
      "type": "CLIPTextEncode",
      "pos": [
        450,
        300
      ],
      "size": [
        450,
        150
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "API_NEGATIVE_PROMPT_PLACEHOLDER"
      ]
    },
    {
      "id": 4,
      "type": "EmptyLatentImage",
      "pos": [
        450,
        500
      ],
      "size": [
        315,
        106
      ],
      "properties": {
        "Node name for S&R": "EmptyLatentImage"
      },
      "widgets_values": [
        1024,
        1024,
        1
      ]
    },
    {
      "id": 5,
      "type": "KSampler",
      "pos": [
        950,
        100
      ],
      "size": [
        315,
        262
      ],
      "properties": {
        "Node name for S&R": "KSampler"
      },
      "widgets_values": [
        42,
        "randomize",
        1,
        1.0,
        "euler_ancestral",
        "normal",
        1.0
      ]
    },
    {
      "id": 6,
      "type": "VAEDecode",
      "pos": [
        1350,
        100
      ],
      "size": [
        210,
        46
      ],
      "properties": {
        "Node name for S&R": "VAEDecode"
      }
    },
    {
      "id": 7,
      "type": "SaveImage",
      "pos": [
        1600,
        100
      ],
      "size": [
        315,
        270
      ],
      "properties": {
        "Node name for S&R": "SaveImage"
      },
      "widgets_values": [
        "api_output"
      ]
    }
  ],
  "links": [
    [
      1,
      1,
      0,
      5,
      0,
      "MODEL"
    ],
    [
      2,
      1,
      1,
      2,
      0,
      "CLIP"
    ],
    [
      3,
      1,
      1,
      3,
      0,
      "CLIP"
    ],
    [
      4,
      2,
      0,
      5,
      1,
      "CONDITIONING"
    ],
    [
      5,
      3,
      0,
      5,
      2,
      "CONDITIONING"
    ],
    [
      6,
      4,
      0,
      5,
      3,
      "LATENT"
    ],
    [
      7,
      5,
      0,
      6,
      0,
      "LATENT"
    ],
    [
      8,
      1,
      2,
      6,
      1,
      "VAE"
    ],
    [
      9,
      6,
      0,
      7,
      0,
      "IMAGE"
    ]
  ],
  "config": {},
  "extra": {
    "workflow_description": "API-ready workflow for n8n/external integration. Replace PLACEHOLDER values via API calls.",
    "workflow_category": "api-integration",
    "workflow_tags": [
      "api",
      "n8n",
      "automation",
      "integration"
    ],
    "api_usage": {
      "endpoint": "POST http://localhost:8188/prompt",
      "content_type": "application/json",
      "body_format": {
        "prompt": "<this workflow JSON with node IDs as keys>",
        "client_id": "<unique client id>"
      },
      "n8n_integration_notes": [
        "1. Use HTTP Request node in n8n to POST to ComfyUI API",
        "2. Convert this workflow to API format (use 'Save (API Format)' in ComfyUI)",
        "3. Replace prompt text in the JSON body dynamically from n8n",
        "4. Poll GET /history/{prompt_id} for completion",
        "5. Retrieve output images from GET /view?filename=<name>&subfolder=<folder>&type=output"
      ],
      "example_curl": "curl -X POST http://localhost:8188/prompt -H 'Content-Type: application/json' -d '{\"prompt\": {<api_format_workflow>}}'"
    }
  },
  "version": 0.4
}