{
  "name": "Edit photos with Nano Banana in n8n (PixelFireman API)",
  "nodes": [
    {
      "parameters": {
        "content": "## Nano Banana image editing with PixelFireman\n\nSend a photo + an instruction, get the edited image back. Nano Banana is Google's Gemini 2.5 Flash Image. About $0.07 per edit, prepaid credits that never expire.\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` with your key (`pf_live_...`).\n3. Run it, paste an image URL + a change to make, and the edited image URL comes back.\n\nDocs: https://pixelfireman.com/docs",
        "height": 360,
        "width": 420,
        "color": 4
      },
      "id": "b1b2c3d4-0001-4000-8000-000000000001",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, -40]
    },
    {
      "parameters": {
        "formTitle": "Edit a photo with Nano Banana",
        "formDescription": "Give an image URL and an instruction, get the edited image back from the PixelFireman API.",
        "formFields": {
          "values": [
            { "fieldLabel": "Image URL", "fieldType": "text", "placeholder": "https://.../photo.jpg", "requiredField": true },
            { "fieldLabel": "Instruction", "fieldType": "text", "placeholder": "change the jacket to bright red, keep the face", "requiredField": true }
          ]
        },
        "options": {}
      },
      "id": "b1b2c3d4-0002-4000-8000-000000000002",
      "name": "On form submit",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [280, 0],
      "webhookId": "pixelfireman-nano-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  \"image\": {{ JSON.stringify($json['Image URL']) }},\n  \"prompt\": {{ JSON.stringify($json.Instruction) }}\n}",
        "options": {}
      },
      "id": "b1b2c3d4-0003-4000-8000-000000000003",
      "name": "PixelFireman API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [560, 0]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "editedImageUrl", "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": "b1b2c3d4-0004-4000-8000-000000000004",
      "name": "Edited 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": "Edited image + credits", "type": "main", "index": 0 }]] }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "meta": {
    "templateCredsSetupCompleted": false,
    "description": "Edit a photo from a text instruction using Nano Banana (Google Gemini 2.5 Flash Image) via the PixelFireman API. Swap outfits, change backgrounds, edit products while keeping the subject consistent. About $0.07 per edit, prepaid credits that never expire. One POST to /v1/images with an image and a prompt."
  }
}
