必须先手动从 flow-extension/ 目录以「加载已解压的扩展程序」方式安装 Chrome 扩展,否则无法保存登录会话;需另开终端常驻运行 ./bin/flow bridge,并保持 labs.google/fx/tools/flow 标签页在前台,否则报 400 或异常活动;同时只保留一个 Chrome 配置和一个 Flow 标签页,多账号并行会冲突
flow-agent
kodelyx活跃维护封装 Google Flow 的 CLI 工具,用命令行批量生成 Nano Banana Pro 图片和 Omni Flash 视频,并支持 MCP v2 与 OpenAI API 接入。
⚡ CLI toolkit for Google Flow — Nano Banana Pro images, Omni Flash videos, MCP v2 & OpenAI API.
cd flow-agent
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[test]'
./bin/flow bridgeREADME 未说明显存或 GPU 要求;需 Python 3.10+,并需在 Chrome 中安装 Flow 扩展、保持 Flow 页面在前台打开
本地 CLI 与 REST 服务,把 Google Flow 的图像视频生成能力接到脚本和 AI 助手里
封装 Google Flow 的 CLI 工具,用命令行批量生成 Nano Banana Pro 图片和 Omni Flash 视频,并支持 MCP v2 与 OpenAI API 接入。
核心能力
- 提供 CLI、REST API、MCP 三种调用方式
- 支持文生图,可选 5 种宽高比、一次最多 4 张
- 支持文生视频与图生视频,时长 4~10 秒
- 兼容 OpenAI SDK,只改 base_url 即可替换
- 多 Google 账号池化额度,生成记录存本地 SQLite
容易踩的坑
- v1.0.0⚡ Flow Agent v1.0.0 — First Stable Release最新正式版2026-09-25 · 2026-09-25 05:36 UTC
⚡ Flow Agent v1.0.0
Generate AI images and videos from Google Flow — via CLI, REST API, or your AI assistant.
🆕 What's in this release
🖼️ Image Generation
- Text-to-image with 3 models:
narwhal,harbor_seal,gem_pix_2 - Aspect ratios:
1:116:99:164:33:4squarelandscapeportrait - Up to 4 variations per generation
- Multi-account support (pool credits across Google accounts)
🎬 Video Generation
- Text-to-video:
4s6s8s10sclips at360p/720p - Image-to-video animation (animate any photo)
- Video upload to Flow project storage (with content-hash cache)
🌐 REST API Server
- Native endpoints:
POST /api/v1/image,POST /api/v1/video,GET /api/v1/balance, etc. - OpenAI-compatible:
POST /v1/images/generations,POST /v1/chat/completions(+ SSE) - Route aliases: every
/api/v1/*also reachable via/v1/* - Interactive docs at
http://127.0.0.1:8001/docs
🤖 MCP Server
- 5 tools:
flow_generate_image,flow_generate_video,flow_get_balance,flow_get_stats,flow_get_projects - Works with Claude Desktop, Cursor, AGY, and any MCP-compatible client
- Stdio and SSE transport support
🔧 Engine Binaries (Cross-platform)
Platform Binary macOS (Apple Silicon + Intel) bin/flow-macosLinux bin/flow-linuxWindows bin/flow-windows.exeAuto-detected by platform — no config needed.
📊 Data & History
- SQLite-backed generation history (
data/flow.db) - Credit tracking per account
stats,balance,projectscommands
🚀 Quick Start
# 1. Install pip install -e '.[test]' # 2. Check your setup ./bin/flow doctor # 3. Generate an image python main.py image "a glowing crystal lotus on calm water" --aspect 16:9 # 4. Or start the API server python main.py server --port 8001
✅ Quality
- 77 tests passing (CLI, REST API, MCP, SQLite, engine)
- Full input validation — invalid args rejected with clear errors
- All 5 reported defects (D1–D5) resolved
📚 Documentation
- 📘 API Reference
- ⌨️ CLI Reference
- 🤖 MCP Guide
- 🏗️ Architecture
- Text-to-image with 3 models:
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
⚡ Flow Agent
Generate AI images and videos from Google Flow — via CLI, REST API, or your AI assistant.
"a glowing crystal lotus on calm water" → 🖼️ output/acct-38e6.jpg (26 s)
"hyper-lapse sunrise over ocean horizon" → 🎬 output/acct-video.mp4 (58 s)
What does it do?
Flow Agent is a local server and CLI that connects to Google Flow to generate high-quality AI images and videos. You set it up once, and then you can use it three ways:
| How | Best For |
|---|---|
| 🖥️ Terminal (CLI) | Quick one-off generations, scripting |
| 🌐 REST API | Connecting any app — works exactly like OpenAI's API |
| 🤖 MCP Server | Letting Claude, Cursor, or AGY generate for you automatically |
Features at a Glance
- 🖼️ Text → Image — aspect ratios:
1:116:99:164:33:4, up to 4 variations at once - 🎬 Text → Video — durations:
4s6s8s10s, quality:360p/720p - 🎞️ Image → Video — animate any image into a video clip
- 👥 Multi-Account — add multiple Google accounts to pool credits
- 🔌 OpenAI Compatible — drop-in replacement: change
base_url, nothing else - 📊 History & Stats — every generation logged to local SQLite with credits tracking
- 🩺 Self-Diagnostics —
./bin/flow doctortells you exactly what to fix
Quick Start
1 — Install
cd flow-agent
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e '.[test]'
2 — Connect Your Google Account
You need the Flow Chrome Extension installed in Chrome first.
Load it from theflow-extension/folder viachrome://extensions → Load unpacked.
# Start the WebSocket bridge (keep this running in a terminal)
./bin/flow bridge
Then open https://labs.google/fx/tools/flow in Chrome while signed in to your Google account. The extension will automatically save your session to cookies/.
3 — Verify Setup
./bin/flow doctor
You should see:
ok version flow-go 0.1.0
ok database data/flow.db
ok cookies 1 account(s) loaded
ok browser extension attached
4 — Generate Your First Image
python main.py image "a glowing crystal lotus on calm water" --aspect 1:1
✓ saved output/acct-38e60406-67b.jpg (26 s)
Usage
🖼️ Images
# Basic — saves to output/
python main.py image "PROMPT"
# With options
python main.py image "PROMPT" \
--aspect 16:9 # 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | square | landscape | portrait
--count 2 # 1–4 variations
--model narwhal # narwhal | harbor_seal | gem_pix_2
# Run on all accounts at once (pools credits)
python main.py image "PROMPT" --all
🎬 Videos
# Text to video
python main.py video "PROMPT" \
--aspect landscape # landscape | portrait | 16:9 | 9:16
--duration 8s # 4s | 6s | 8s | 10s
--quality 720p # 360p | 720p
# Image to video (animate a photo)
python main.py video "camera slowly pans right" \
--start-image output/my-image.jpg
💰 Balance & Stats
python main.py balance # cached (instant)
python main.py balance --refresh # live probe from Google Flow
python main.py stats # generation history + credit usage
python main.py projects # list your Flow projects
REST API Server
python main.py server --port 8001
Interactive docs open at http://127.0.0.1:8001/docs
All Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/image | Generate image |
POST | /api/v1/video | Generate video |
GET | /api/v1/balance | Credit balance |
GET | /api/v1/stats | Generation history |
GET | /api/v1/projects | List Flow projects |
GET | /api/v1/media/{file} | Download result |
GET | /health | Server liveness |
POST | /v1/images/generations | OpenAI DALL-E compat |
POST | /v1/chat/completions | OpenAI Chat compat + SSE |
Every
/api/v1/*route also has a/v1/*alias — use whichever you prefer.
Quick API Example
curl -X POST http://127.0.0.1:8001/api/v1/image \
-H "Content-Type: application/json" \
-d '{"prompt": "neon cyber dragon over misty mountains", "aspect": "16:9"}'
{
"job_id": "ba884266-...",
"status": "succeeded",
"elapsed_seconds": 26.3,
"files": [
{ "url": "http://127.0.0.1:8001/api/v1/media/acct-38e60406-67b.jpg" }
]
}
OpenAI SDK — Drop-in Replacement
Change one line in your existing OpenAI code:
from openai import OpenAI
# ← Change only this line
client = OpenAI(base_url="http://127.0.0.1:8001/v1", api_key="not-needed")
# Everything else stays exactly the same ↓
response = client.images.generate(
prompt="a cute red origami fox sitting in autumn leaves",
size="1792x1024", # → Flow 16:9
n=1
)
print(response.data[0].url)
Supported OpenAI sizes → Flow mapping:
size | Flow aspect |
|---|---|
1024x1024 / square | 1:1 |
1792x1024 / landscape | 16:9 |
1024x1792 / portrait | 9:16 |
1365x1024 | 4:3 |
1024x1365 | 3:4 |
MCP — Use With Claude / Cursor / AGY
Flow Agent exposes 5 tools via the Model Context Protocol, so your AI assistant can generate images and videos directly for you.
Setup (Claude Desktop)
Add to claude_desktop_config.json:
{
"mcpServers": {
"flow": {
"command": "python3",
"args": ["/absolute/path/to/flow-agent/main.py", "mcp"]
}
}
}
Setup (Cursor / AGY)
{
"flow": {
"command": "python3",
"args": ["/absolute/path/to/flow-agent/main.py", "mcp"]
}
}
Available MCP Tools
| Tool | What it does |
|---|---|
flow_generate_image | Generate image from prompt |
flow_generate_video | Generate video from prompt or image |
flow_get_balance | Check credit balance |
flow_get_stats | View generation history |
flow_get_projects | List Flow projects |
Now just ask your assistant: "Generate a 16:9 image of a cyberpunk city at dawn using Flow"
Project Structure
flow-agent/
│
├── bin/
│ ├── flow → auto-selects the right binary
│ ├── flow-macos → macOS universal binary (arm64 + x86_64)
│ ├── flow-linux → Linux binary
│ └── flow-windows.exe → Windows binary
│
├── cookies/
│ └── account_<id>.json → saved Google account sessions
│
├── data/
│ └── flow.db → SQLite: generation history + credits
│
├── output/
│ └── *.jpg, *.mp4 → your generated images and videos
│
├── flow_agent/
│ ├── api.py → FastAPI REST server (Native + OpenAI routes)
│ ├── engine.py → subprocess bridge to bin/flow
│ └── mcp_server.py → MCP JSON-RPC server
│
├── docs/ → detailed reference docs
├── tests/ → 77 passing tests
├── main.py → CLI entrypoint
└── pyproject.toml
Environment Variables
| Variable | Default | Description |
|---|---|---|
IMAGE_MODEL | narwhal | Default image model (narwhal / harbor_seal / gem_pix_2) |
FLOW_COOKIES_DIR | cookies/ | Directory with account JSON files |
FLOW_OUTPUT_DIR | output/ | Where generated files are saved |
FLOW_DB_PATH | data/flow.db | SQLite history database path |
Troubleshooting
| Problem | Fix |
|---|---|
400 Bad Request / unusual activity | Browser tab at labs.google/fx/tools/flow must be open and in foreground with extension active |
0 projects in logs | The account's project_id field is empty — open Flow in Chrome to auto-populate it |
no extension attached | Install the extension, run ./bin/flow bridge, open Flow tab in Chrome |
| Two accounts conflicting | Close all extra Chrome profiles — only keep one Flow tab open at a time |
pytest fails with PermissionError | Run with --basetemp=/tmp/fa_test to use a writable temp directory |
Run Tests
python3 -m pytest -q --basetemp=/tmp/fa_test
77 passed in 0.38s
Documentation
| Doc | Description |
|---|---|
| 📘 API Reference | Every endpoint, parameter, and response schema |
| ⌨️ CLI Reference | All commands, flags, env vars, exit codes |
| 🤖 MCP Guide | Claude, Cursor, Zed, AGY setup |
| 🏗️ Architecture | How the engine, bridge, and server fit together |
| 🔌 Extension Bridge | Chrome extension + WebSocket protocol |
License
MIT — free to use, modify, and distribute.