テキストプロンプトを使用して BananaAPI と Nano Banana エンジンで AI 画像を生成

上級

これはContent Creation, Miscellaneous, Multimodal AI分野の自動化ワークフローで、16個のノードを含みます。主にIf, Set, Wait, FormTrigger, HttpRequestなどのノードを使用。 BananaAPI と Nano Banana エンジンを使用してテキスト プロンプトから AI 画像を生成

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "ae35fcac1ced05e71449f098fbec8ecb6349893e0c2112cc033acbf2f682aad4"
  },
  "nodes": [
    {
      "id": "c77e4131-abb7-4f10-bac4-809dc2467d42",
      "name": "フォーム — プロンプト取得",
      "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": "送信 — 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": "5秒待機",
      "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": "ステータス確認",
      "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": "5秒待機(ループ)",
      "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": "リンク返却",
      "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": "条件分岐",
      "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": "注記 — 概要",
      "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": "注記 — 前提条件",
      "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": "注記 — ステップ1(フォーム入力)",
      "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": "注記 — ステップ2(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": "注記 — ステップ3(処理中)",
      "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": "注記 — ステップ5(出力)",
      "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": "注記 — 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": "注記 — 料金メリット",
      "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": "注記 — トラブルシューティング",
      "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
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - コンテンツ作成, その他, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数16
カテゴリー3
ノードタイプ6
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34