Usar BananaAPI y el motor Nano Banana para generar imágenes de IA mediante indicaciones de texto

Avanzado

Este es unContent Creation, Miscellaneous, Multimodal AIflujo de automatización del dominio deautomatización que contiene 16 nodos.Utiliza principalmente nodos como If, Set, Wait, FormTrigger, HttpRequest. Generar imágenes de AI a partir de indicaciones de texto usando BananaAPI y el motor Nano Banana

Requisitos previos
  • Pueden requerirse credenciales de autenticación para la API de destino
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "ae35fcac1ced05e71449f098fbec8ecb6349893e0c2112cc033acbf2f682aad4"
  },
  "nodes": [
    {
      "id": "c77e4131-abb7-4f10-bac4-809dc2467d42",
      "name": "Formulario — Obtener Prompt",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        560,
        1136
      ],
      "webhookId": "9f404ff0-1029-4086-b044-43cbbd9d1039",
      "parameters": {
        "options": {},
        "formTitle": "Banana API — Image Generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "api_token",
              "placeholder": "Bearer xxxxxxx...",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "prompt",
              "placeholder": "Ví dụ: a neon cyberpunk cat, detailed, 4k",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Output Format [optional]",
              "fieldOptions": {
                "values": [
                  {
                    "option": "png"
                  },
                  {
                    "option": "jpeg"
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Image Size [optional]",
              "fieldOptions": {
                "values": [
                  {
                    "option": "16:9"
                  },
                  {
                    "option": "9:16"
                  },
                  {
                    "option": "1:1"
                  },
                  {
                    "option": "3:4"
                  },
                  {
                    "option": "4:3"
                  }
                ]
              }
            },
            {
              "fieldLabel": "image_url_1 [optional]",
              "placeholder": "https://example.com/input.jpg"
            },
            {
              "fieldLabel": "image_url_2 [optional]"
            },
            {
              "fieldLabel": "image_url_3 [optional]"
            },
            {
              "fieldLabel": "image_url_4 [optional]"
            },
            {
              "fieldLabel": "image_url_5 [optional]"
            }
          ]
        },
        "formDescription": "Enter the prompt and (optionally) the original image link for the Banana API to generate a new image."
      },
      "typeVersion": 2.2
    },
    {
      "id": "aa769a6a-0170-4851-82b8-0169eca8ec4a",
      "name": "Enviar — Banana API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        1136
      ],
      "parameters": {
        "url": "https://bananaapi.com/api/n8n/generate/",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"input\": {\n    \"prompt\": \"{{ $json.prompt }}\",\n    \"image_size\": \"{{ $json['Image Size [optional]'] }}\",\n    \"output_format\": \"{{ $json['Output Format [optional]'] }}\",\n    \"image_urls\": [\"{{ $json['image_url_1 [optional]'] }}\",\"{{ $json['image_url_2 [optional]'] }}\",\"{{ $json['image_url_3 [optional]'] }}\",\"{{ $json['image_url_4 [optional]'] }}\",\"{{ $json['image_url_5 [optional]'] }}\"]\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.api_token }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c3522fe8-9442-4fcc-a2d2-cd90ac3fef15",
      "name": "Esperar 5s",
      "type": "n8n-nodes-base.wait",
      "position": [
        1472,
        1136
      ],
      "webhookId": "72d55c47-b651-4121-b59f-dab21489cb35",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "037eee00-f9da-41bc-b508-6bb3fa87c68a",
      "name": "Verificar Estado",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1632,
        1136
      ],
      "parameters": {
        "url": "=https://bananaapi.com/api/n8n/image-status/{{$('Submit — Banana API').item.json.taskId}}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "749b2fd0-650c-4b31-9527-c7b84a2c7357",
      "name": "Esperar 5s (bucle)",
      "type": "n8n-nodes-base.wait",
      "position": [
        2048,
        1088
      ],
      "webhookId": "b347eefb-f36a-4072-9135-fb4ad8abed5d",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "3d5b6f8d-364b-4a48-82cb-fc5409502788",
      "name": "Devolver Enlaces",
      "type": "n8n-nodes-base.set",
      "position": [
        2528,
        1056
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "80fd7573-3eac-4fc4-aced-b122e5eac718",
              "name": "image_url",
              "type": "string",
              "value": "={{$json.imageUrl}}"
            },
            {
              "id": "26339522-2fe9-48f6-aafd-e1aa9ed89327",
              "name": "task_id",
              "type": "string",
              "value": "={{$('Submit — Banana API').item.json.taskId}}"
            },
            {
              "id": "3e26803c-640d-463d-b857-a3bd29ea2358",
              "name": "status",
              "type": "string",
              "value": "={{$json.status}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "01a74ecd-93e3-4eb3-ab72-3ab82a008294",
      "name": "Condicional (If)",
      "type": "n8n-nodes-base.if",
      "position": [
        1808,
        1072
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4e3a3b7c-61e8-49c4-abf7-5eb3db4a3eef",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Check Status').item.json.status }}",
              "rightValue": "=completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0f715abf-ae0a-42d5-8647-5e9488cd3f9d",
      "name": "NOTA — Descripción General",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        448
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 336,
        "content": "## Overview\nThis workflow integrates **BananaAPI.com** with the **Google Nano Banana** image generation engine. Users can submit prompts and optional reference images via a form, then the workflow calls BananaAPI.com, checks the task status in a loop, and finally returns the generated image link.\n\n**Why use it?**\n- Cost effective: only **$0.025 per image**\n- **Pay-as-you-go**: pay only for what you use\n- **Credits never expire**: no monthly subscription pressure\n\nIdeal for creators, marketers, and developers who want affordable and automated image generation."
      },
      "typeVersion": 1
    },
    {
      "id": "71c558a9-d4e5-4ba2-8dc1-170e8a4ba0db",
      "name": "NOTA — Requisitos Previos",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        448
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 336,
        "content": "## Prerequisites\n- **BananaAPI.com account + API key (Bearer)** — create your key at https://bananaapi.com/api\n- An **n8n instance** (Cloud or self-hosted)\n- Basic knowledge of AI prompts to get the best quality images\n\n⚠️ Never commit or share your API key publicly. Use **n8n Credentials** for production setups."
      },
      "typeVersion": 1
    },
    {
      "id": "77a8c9f2-61af-4e2e-9ba4-6c3ca1494567",
      "name": "NOTA — Paso 1 (Entrada de Formulario)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        800
      ],
      "parameters": {
        "width": 464,
        "height": 496,
        "content": "## Step 1 — User Form Input\nThe **Form Trigger** asks the user to provide:\n- `api_token` (required) — Banana API Bearer token\n- `prompt` (required) — image description (e.g. *“a neon cyberpunk cat, detailed, 4k”*)\n- `Output Format [optional]` — choose PNG or JPEG\n- `Image Size [optional]` — 16:9, 9:16, 1:1, 3:4, 4:3\n- `image_url_1 ... image_url_5 [optional]` — reference images for editing or transformation"
      },
      "typeVersion": 1
    },
    {
      "id": "5ae4ce78-4f6c-4148-8485-a90d21ba32dd",
      "name": "NOTA — Paso 2 (Solicitud POST)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        800
      ],
      "parameters": {
        "width": 464,
        "height": 496,
        "content": "## Step 2 — Submit to Banana API\nThe **HTTP POST** node sends the request:\n- URL: `https://bananaapi.com/api/n8n/generate/`\n- Headers:\n  - `Content-Type: application/json`\n  - `Authorization: Bearer {{ $json.api_token }}`\n- JSON Body includes:\n  - `prompt`\n  - `image_size`\n  - `output_format`\n  - `image_urls` (array of up to 5)\n\nBananaAPI will return a `taskId` to track progress."
      },
      "typeVersion": 1
    },
    {
      "id": "3c7bfc47-5d0f-45fb-a53f-25c24d2ed1f5",
      "name": "NOTA — Paso 3 (Procesamiento)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        800
      ],
      "parameters": {
        "width": 912,
        "height": 496,
        "content": "## Step 3 — Processing\nBananaAPI forwards the request to the **Nano Banana** engine, which generates or edits the image based on the prompt and optional input images.\n\n⏱ Average generation time: a few seconds to ~1 minute, depending on complexity and server load.\n- After 5s wait, the workflow calls:\n  `GET https://bananaapi.com/api/n8n/image-status/{{ taskId }}`\n- If `status != completed`, the loop waits 5s and retries\n- When `status = completed`, the workflow continues"
      },
      "typeVersion": 1
    },
    {
      "id": "583222b7-f53c-4376-8958-4c544c4ace60",
      "name": "NOTA — Paso 5 (Salida)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2336,
        800
      ],
      "parameters": {
        "width": 464,
        "height": 496,
        "content": "## Step 4 — Return Output\nWhen completed, the **Set node** outputs:\n- `image_url` — the final generated image link\n- `task_id` — the task reference ID\n- `status` — task completion state\n\n💡 Tip: Add a **Webhook Response** node to return a clean JSON payload for frontend apps."
      },
      "typeVersion": 1
    },
    {
      "id": "abfd4d9f-d7be-4a74-87ae-8618a6ff826a",
      "name": "NOTA — Referencia API",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2320,
        448
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 336,
        "content": "## API Reference\n- **POST** `https://bananaapi.com/api/n8n/generate/`\n- **GET** `https://bananaapi.com/api/n8n/image-status/{taskId}`\n\nDocs: https://bananaapi.com/api\n\n✅ Always include `Authorization: Bearer <token>` in headers."
      },
      "typeVersion": 1
    },
    {
      "id": "5074a457-5ec7-4a5c-81bc-54c120818b08",
      "name": "NOTA — Ventajas de Precio",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        448
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 336,
        "content": "## Pricing Advantages\n- **Only $0.025 per image** — very cost-effective\n- **Pay-as-you-go**: no monthly subscription\n- **Credits never expire** — use anytime, no rush\n\nPerfect for scaling automation workflows or experimenting without wasted costs."
      },
      "typeVersion": 1
    },
    {
      "id": "1d11806a-56e9-4e02-9aeb-5dfef750b1ae",
      "name": "NOTA — Solución de Problemas",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        448
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 336,
        "content": "## Troubleshooting\n- **401/403 Unauthorized** → Check Authorization header (`Bearer token`)\n- **Invalid JSON** → Ensure POST body is valid JSON (double quotes, no trailing commas)\n- **No imageUrl returned** → Task still pending; wait longer or re-check taskId\n- **Slow performance** → Increase wait interval from 5s to 8–10s"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "01a74ecd-93e3-4eb3-ab72-3ab82a008294": {
      "main": [
        [
          {
            "node": "3d5b6f8d-364b-4a48-82cb-fc5409502788",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "749b2fd0-650c-4b31-9527-c7b84a2c7357",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c3522fe8-9442-4fcc-a2d2-cd90ac3fef15": {
      "main": [
        [
          {
            "node": "037eee00-f9da-41bc-b508-6bb3fa87c68a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "037eee00-f9da-41bc-b508-6bb3fa87c68a": {
      "main": [
        [
          {
            "node": "01a74ecd-93e3-4eb3-ab72-3ab82a008294",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "749b2fd0-650c-4b31-9527-c7b84a2c7357": {
      "main": [
        [
          {
            "node": "037eee00-f9da-41bc-b508-6bb3fa87c68a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c77e4131-abb7-4f10-bac4-809dc2467d42": {
      "main": [
        [
          {
            "node": "aa769a6a-0170-4851-82b8-0169eca8ec4a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aa769a6a-0170-4851-82b8-0169eca8ec4a": {
      "main": [
        [
          {
            "node": "c3522fe8-9442-4fcc-a2d2-cd90ac3fef15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Creación de contenido, Varios, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos16
Categoría3
Tipos de nodos6
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34