{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Generate images from text prompts with MuAPI Nano Banana 2 Pro",
  "nodes": [
    {
      "id": "896febfb-4d46-4fba-83ac-8e2846a0f9b5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        32
      ],
      "parameters": {
        "width": 480,
        "height": 720,
        "content": "## Generate images from text prompts with MuAPI Nano Banana 2 Pro\n\n### How it works\n\nThis workflow runs manually and generates an image from a text prompt using MuAPI's Nano Banana 2 Pro predictor. It first defines the prompt, sends it to the MuAPI predictor, then extracts the resulting image URL for downstream use or viewing.\n\n### Setup steps\n\n- **Requirement:** Install the `n8n-nodes-muapi` community node in your n8n instance (Settings -> Community Nodes).\n- Configure the MuAPI credentials/API key required by the MuAPI Predictor node.\n- Edit the Set Prompt node to define the text prompt and any required input fields for the model.\n- Verify the MuAPI Predictor node is set to the intended Nano Banana 2 Pro model or endpoint.\n- Run the workflow manually with Execute Workflow and inspect the extracted image URL output.\n\n### Customization\n\nChange the prompt text, model parameters, image size, style, or output field mappings to generate different images or return additional response data."
      },
      "typeVersion": 1
    },
    {
      "id": "acf0cb71-188e-475b-8cf4-7ba34eae4c34",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 336,
        "content": "## Start and prompt setup\n\nManual execution starts the workflow, then the prompt fields are prepared for the image generation request. These two nodes form the left-side input cluster."
      },
      "typeVersion": 1
    },
    {
      "id": "d1321784-c76a-4a37-b46b-ae09fa9f946e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 368,
        "content": "## Generate and extract image\n\nThe MuAPI predictor sends the prompt to the image model, and the final set node extracts the generated image URL from the response. These nodes form the right-side processing and output cluster."
      },
      "typeVersion": 1
    },
    {
      "id": "e9cbcf8a-8263-4796-bfeb-01c0c660098f",
      "name": "Manual Trigger Execution",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        100,
        240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7876a3b2-6c6a-4d7a-b9c1-7a63d76e73cb",
      "name": "Build Text Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        240
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "prompt",
              "stringValue": "A futuristic cyberpunk tiger in neon city"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "bc823f99-4a9f-431f-b5c9-9ad38374d6df",
      "name": "Predict Image with MuAPI",
      "type": "n8n-nodes-muapi.muapiPredictor",
      "position": [
        540,
        240
      ],
      "parameters": {
        "model": "nano-banana-2-pro",
        "prompt": "={{ $json.prompt }}",
        "category": "textToImage"
      },
      "credentials": {
        "muapiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5dc92ca3-fa6c-485a-8b83-a9d0a64cbde3",
      "name": "Extract Image URL Field",
      "type": "n8n-nodes-base.set",
      "position": [
        760,
        240
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "image_url",
              "stringValue": "={{ $json.outputs[0] }}"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {},
  "versionId": "b1b51e04-d4b6-455b-9d41-7e88c03cf8da",
  "connections": {
    "Build Text Prompt": {
      "main": [
        [
          {
            "node": "Predict Image with MuAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger Execution": {
      "main": [
        [
          {
            "node": "Build Text Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Predict Image with MuAPI": {
      "main": [
        [
          {
            "node": "Extract Image URL Field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}