Files
flow-nano-bananao/README.md

31 lines
942 B
Markdown

# 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.