# AI Image Generator Flow ## Setup 1. **Install Dependencies**: ```bash npm install ``` 2. **Environment Variables**: A `.env` file has been created. Ensure the following keys are correct: * `R2_ACCOUNT_ID`: Your Cloudflare Account ID. * `R2_ACCESS_KEY_ID`: Your R2 Access Key ID. * `R2_SECRET_ACCESS_KEY`: Your R2 Secret Access Key. * `R2_BUCKET_NAME`: The name of your R2 bucket (Default: `ai-flow`). * `API_KEY`: Your Wuyin Keji API Key. 3. **Run Server**: ```bash node server.js ``` Access at `http://localhost:3000`. ## Features 1. **Upload**: Uploads reference images to Cloudflare R2. 2. **Prompt Generation**: Uses LLM to generate prompts based on `prompt.md` template. 3. **Image Generation**: Uses NanoBanana to generate images from prompts. 4. **History**: Saves generated images and prompts locally. 5. **Batch Download**: Download all generated images. ## Notes * Ensure your R2 bucket allows public access or configure a custom domain in `.env` as `R2_PUBLIC_DOMAIN`. * The application saves state to browser `localStorage` to prevent data loss on refresh.