Files
flow-nano-bananao/README.md

1.1 KiB

nano-banano

To install dependencies:

bun install

Set up your environment:

cp .env.example .env

To run:

bun run src/index.ts

What it does:

  • Reads FLOW2API_BASE_URL, FLOW2API_API_KEY, and FLOW2API_MODEL from .env
  • Accepts either a root endpoint or a /v1 endpoint and normalizes root URLs to the OpenAI-compatible /v1 base URL automatically
  • Also accepts older GEMINI_MODEL and OPENAI_MODEL env names for compatibility
  • Reads batch jobs from src/jobs.ts, where each item can define name, prompt, images, and enabled
  • Treats relative images entries in each job as files under the local images/ directory
  • Sends prompt plus any local input images through AI SDK's streamText, then downloads the generated image from the streamed Markdown image link
  • Saves each generated image into output/ with a job-based timestamp filename
  • Keeps runtime code under src/ and uses the @/* TypeScript alias for internal imports

This project was created using bun init in bun v1.3.11. Bun is a fast all-in-one JavaScript runtime.