diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c14dfa4 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +FLOW2API_BASE_URL=https://flow2api.imbytecat.com/v1 +FLOW2API_API_KEY= +FLOW2API_MODEL=gemini-3.0-pro-image-landscape diff --git a/README.md b/README.md new file mode 100644 index 0000000..6aa4c17 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# nano-banano + +To install dependencies: + +```bash +bun install +``` + +Set up your environment: + +```bash +cp .env.example .env +``` + +To run: + +```bash +bun run src/index.ts "A tiny banana robot exploring a neon greenhouse" +``` + +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 +- Uses AI SDK's `streamText` for streaming text, then downloads the generated image from the streamed Markdown image link +- Saves the generated image into `images/` with a timestamp-based 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](https://bun.com) is a fast all-in-one JavaScript runtime.