Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Nano Banana / Imagen 4 images — Google Flow API batch generation (Node.js & Python)

Batch-generate images with Nano Banana 2 (nano-banana-2, Gemini 3.1 Flash Image), Nano Banana Pro (nano-banana-pro, Gemini 3 Pro Image), and Imagen 4 (imagen-4) through the Google Flow API by useapi.net.

📖 Full walkthrough: Generate AI images via curl and the Google Flow API

google-flow-images.mjs (Node.js) and google-flow-images.py (Python) are equivalent implementations — each reads prompts from prompts.json, uploads any reference images, and calls POST /images. Because that endpoint is synchronous, the script writes each result image as soon as the call returns.

Prerequisites

  • Node.js v21 or newer (no dependencies to install — uses built-in fetch), or Python 3.x (standard library only — no dependencies to install)
  • A useapi.net API token
  • A connected Google Flow account email (image generation works with free Google AI accounts)

Usage

node ./google-flow-images.mjs <API_TOKEN> <EMAIL> [PROMPTS_FILE]
python3 ./google-flow-images.py <API_TOKEN> <EMAIL> [PROMPTS_FILE]

PROMPTS_FILE defaults to prompts.json. The script looks the account up by email and checks its health field before submitting.

Prompts

prompts.json is an array of prompt objects — prompt is the only required field; everything else falls back to the API defaults (model imagen-4, four variations, 16:9). Supported models include imagen-4, nano-banana-2, and nano-banana-pro.

  • Image-to-image: pass a local file path as reference_1 (uploaded automatically). nano-banana-2 and nano-banana-pro accept up to 10 references (reference_1reference_10).

Every parameter is documented on POST /images. Local reference paths in prompts.json (e.g. ./reference_image.jpeg) are inputs you supply — they are not included in this repo.


Support: Discord · Telegram · YouTube