{
  "name": "Generate AI images with the PixelFireman API (cheap image generation)",
  "nodes": [
    {
      "parameters": {
        "content": "## Generate AI images with PixelFireman\n\nA cheap image generation API: one call, an image URL back. About $6.25 per 1,000 images, prepaid credits that never expire, failed renders never billed.\n\n### Setup (1 minute)\n1. Get a free API key at **https://pixelfireman.com/account**\n2. Open the **PixelFireman API** node and replace `YOUR_PIXELFIREMAN_API_KEY` in the Authorization header with your key (`pf_live_...`).\n3. Click **Test workflow**, type a prompt, and the image URL comes back.\n\nDocs: https://pixelfireman.com/docs",
        "height": 340,
        "width": 420,
        "color": 4
      },
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, -40]
    },
    {
      "parameters": {
        "formTitle": "Generate an AI image",
        "formDescription": "Type a prompt and get an AI generated image back from the PixelFireman API.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Prompt",
              "fieldType": "text",
              "placeholder": "cozy reading nook, warm light, wide angle",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "On form submit",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [280, 0],
      "webhookId": "pixelfireman-image-form"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://pixelfireman.com/v1/images",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer YOUR_PIXELFIREMAN_API_KEY" },
            { "name": "Content-Type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"prompt\": {{ JSON.stringify($json.Prompt) }}\n}",
        "options": {}
      },
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "PixelFireman API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [560, 0]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "imageUrl", "value": "={{ $json.image }}", "type": "string" },
            { "id": "f2", "name": "creditsUsed", "value": "={{ $json.creditsUsed }}", "type": "number" },
            { "id": "f3", "name": "creditsLeft", "value": "={{ $json.usage.creditsLeft }}", "type": "number" }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0004-4000-8000-000000000004",
      "name": "Image + credits",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [840, 0]
    }
  ],
  "connections": {
    "On form submit": {
      "main": [[{ "node": "PixelFireman API", "type": "main", "index": 0 }]]
    },
    "PixelFireman API": {
      "main": [[{ "node": "Image + credits", "type": "main", "index": 0 }]]
    }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "meta": {
    "templateCredsSetupCompleted": false,
    "description": "Generate AI images from a prompt using the PixelFireman image generation API. A cheap alternative to premium image APIs: about $6.25 per 1,000 images, prepaid credits that never expire, failed renders never billed. One POST to /v1/images returns an image URL."
  }
}
