๐ฑ Vietnam MoMo ยท VietQR ยท napas247 ๐ฐ Binance Pay Crypto / cross-border
๊ฐ์
๐ฑ Vietnam MoMo ยท VietQR ยท napas247 ๐ฐ Binance Pay Crypto / cross-border
README
โ Sponsor this project
๐ International (card):
(yes โ I moved this up here on purpose. Was afraid nobody scrolls past the badges ๐ )
FLOW KIT
Standalone system to generate AI videos via Google Flow API. Uses a Chrome extension as browser bridge for authentication, reCAPTCHA solving, and API proxying.
Showcase
All outputs below were generated end-to-end by this system โ from story concept to final YouTube-ready video with thumbnails, narration, and branding.
Generated YouTube Thumbnails
Visual Consistency Across Scenes
The reference image system keeps characters consistent across an entire video. Each character is generated once as a reference, then the AI uses that reference in every scene โ maintaining the same face, clothing, and features.
Doctor character โ same face, glasses, white coat across 4 different scenes:
Defector character โ same face across ICU, hospital, interview, and Seoul streets:
All frames from a single 50-scene project. Both characters maintain consistent appearance across completely different settings and lighting conditions โ powered by the reference image system.
F-15E Rescue โ Full Story Arc (25 scenes)
Strategic briefing โ pilot departure โ formation flight โ aircraft hit โ CSAR alert โ pilot survival.
Hormuz Strait โ Naval Scenes
What the Pipeline Produces
Each project goes through: story โ entities โ reference images โ scene images โ 8s video clips โ narration (TTS) โ concat โ thumbnails โ YouTube upload โ all orchestrated via API or AI agent skills.
| Output | Description |
|---|---|
| Reference images | One per character/location/prop โ maintains visual consistency |
| Scene images | Composed using all referenced entities |
| 8-second video clips | Generated from scene images with camera motion + sound effects |
| 4K upscale | Optional upscale to 4K resolution |
| Narrator TTS | Voice-cloned narration per scene |
| Final video | All clips concatenated, trimmed to narrator timing |
| Thumbnails | YouTube-optimized with text overlays + branding |
| YouTube metadata | SEO-optimized title, description, tags, hashtags |
Chrome Extension โ Live Dashboard
The Chrome extension runs alongside Google Flow โ showing real-time request log (614 total, 328 success), video generation progress, and token status. The Python agent communicates with the extension via WebSocket to automate all API calls.
Web Dashboard โ Ops Console
A local React dashboard (dashboard/) for monitoring and driving the pipeline โ real-time KPIs, per-video stage progress, a scene-level pipeline view with AI review, and a setup guide, all backed by the same FastAPI agent. Supports English, Vietnamese, Hindi, Indonesian, Chinese, Korean, and Japanese.
Architecture
โโโโโโโโโโโโโโโโโโโโ WebSocket โโโโโโโโโโโโโโโโโโโโโโโโ
โ Python Agent โโโโโโโโโโโโโโโโโโโโโบโ Chrome Extension โ
โ (FastAPI+SQLite)โ localhost:9222 โ (MV3 Service Worker) โ
โ โ โ โ
โ - REST API :8100โ โโ commands โโโบ โ - Token capture โ
โ - Queue worker โ โโโ results โโ โ - reCAPTCHA solve โ
โ - Post-process โ โ - API proxy โ
โ - SQLite DB โ โ (on labs.google) โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
Quick Start
One-command setup
./setup.sh
This checks and installs: Python 3.10+, pip, ffmpeg, ffprobe, Chrome, creates venv, installs dependencies, verifies imports.
Windows: Use WSL (
wsl --install) or Git Bash. All bash scripts and commands assume a Unix shell.
Manual setup
# Prerequisites: Python 3.10+, ffmpeg, Chrome
pip install -r requirements.txt
Run
# 1. Load Chrome extension: chrome://extensions โ Developer mode โ Load unpacked โ extension/
# 2. Open https://labs.google/fx/tools/flow and sign in
# 3. Start agent
source venv/bin/activate # if using setup.sh
python -m agent.main
# 4. Verify
curl http://127.0.0.1:8100/health
# {"status":"ok","extension_connected":true}
End-to-End Example: โPippip the Fish Merchantโ
A chubby cat sells fish at a market. 3 scenes, vertical, Pixar 3D style.
How it works (read this first)
The system uses reference images to keep visuals consistent across scenes. Hereโs the mental model:
1. Identify every visual element that should look the same across scenes:
- Characters โ
entity_type: "character"(portrait reference) - Places โ
entity_type: "location"(landscape reference) - Important objects โ
entity_type: "visual_asset"(detail reference)
2. Describe ONLY appearance in the entity description โ this generates the reference image:
"Chubby orange tabby cat with blue apron, straw hat"(what it looks like)
3. Write scene prompts as ACTION โ reference entities by name, describe what they DO:
"Pippip stands behind Fish Stall, arranging fish..."(what happens)- NOT:
"A chubby orange tabby cat wearing a blue apron stands behind a wooden stall..."(donโt repeat appearance)
4. List all entities that appear in each sceneโs character_names array โ their reference images get passed to the AI as visual input, ensuring consistency.
Story idea
โ
Break into visual elements โ characters[] array with entity_type + description
โ
Write scene prompts using entity NAMES โ character_names lists which refs to use
โ
System generates ref image per entity โ then composes scenes using those refs
Using Skills (recommended)
Skills handle all the API calls, polling, and verification automatically. Use with Claude Code (/fk-command) or follow the recipe in skills/*.md for any AI agent.
/fk-create-project โ interactive: asks story, creates entities + scenes
/fk-gen-refs โ generates all reference images, verifies UUIDs
/fk-gen-images โ generates scene images with all refs applied
/fk-gen-videos โ generates videos (2-5 min each, polls automatically)
/fk-concat โ downloads + merges into final video
/fk-status โ dashboard: what's done, what's next
Full pipeline in 5 commands. Each skill pre-checks dependencies (e.g. /fk-gen-images verifies all refs exist first).
Manual API (step by step)
Core Concepts
Reference Image System
Every visual element that should stay consistent gets a reference image โ characters, locations, props. Each reference has a UUID media_id used in all scene generations via imageInputs.
| Entity Type | Aspect Ratio | Composition |
|---|---|---|
character |
Portrait | Full body head-to-toe, front-facing, centered |
location |
Landscape | Establishing shot, level horizon, atmospheric |
creature |
Portrait | Full body, natural stance, distinctive features |
visual_asset |
Portrait | Detailed view, textures, scale reference |
Scene Prompts = Action Only
Scene prompts describe what happens, not character appearance. The reference images maintain visual consistency.
DO: "Pippip juggling fish at Fish Stall, crowd watching in Open Market"
DON'T: "Pippip the chubby orange tabby cat wearing a blue apron juggling..."
Media ID = UUID
All media_id values are UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Never the base64 CAMS... mediaGenerationId.
Two Prompts per Scene
Each scene has two separate prompts:
promptโ describes the still image (frame 0):"Luna steps out of rocket onto candy planet. Wide shot, sunrise."video_promptโ describes the 8s video motion with sub-clip timing and camera directions:
0-3s: Wide crane down, Luna steps out of rocket onto Candy Planet Surface. Luna gasps "It's beautiful!"
3-6s: Low angle tracking shot, Luna walks across candy ground, shallow DOF. Luna says "Everything is made of candy."
6-8s: Close-up Luna's face, eyes wide with wonder, golden hour backlight. Silence, ambient wind.
Character Voice
Characters can have a voice_description (max ~30 words) for voice consistency:
{"name": "Luna", "entity_type": "character", "description": "Small white cat...", "voice_description": "Soft curious childlike voice with wonder and slight purring"}
Voice descriptions are auto-appended to video prompts before generation.
No Background Music
The worker auto-appends "No background music. Keep only natural sound effects and ambient sounds." to all video prompts. Sound effects from the scene (footsteps, splashing, wind) are preserved.
Pipeline Overview
1. Create project POST /api/projects (with entities + story)
2. Create video POST /api/videos
3. Create scenes POST /api/scenes (chain_type: ROOT โ CONTINUATION)
4. Gen ref images POST /api/requests {type: GENERATE_CHARACTER_IMAGE} per entity
โ Wait ALL complete, verify all have UUID media_id
5. Gen scene images POST /api/requests {type: GENERATE_IMAGE} per scene
โ Wait ALL complete
6. Gen videos POST /api/requests {type: GENERATE_VIDEO} per scene
โ Wait ALL complete (2-5 min each)
7. (Optional) Upscale POST /api/requests {type: UPSCALE_VIDEO} (TIER_TWO only)
8. Download + concat ffmpeg normalize + concat
Skills (AI Agent Workflows)
Ready-to-use workflow recipes in skills/ (also available as /slash-commands in Claude Code):
Basic Pipeline
| Skill | Description |
|---|---|
/fk-create-project |
Create project + entities + video + scenes interactively |
/fk-research |
Fact-check story details before scripting |
/fk-gen-refs |
Generate reference images for all entities |
/fk-gen-images |
Generate scene images with character refs |
/fk-gen-videos |
Generate videos from scene images (4K upscale via UPSCALE_VIDEO request, PAYGATE_TIER_TWO) |
/fk-concat |
Download + merge all scene videos |
/fk-pipeline |
Smart full-pipeline orchestrator โ runs the whole chain end to end |
/fk-monitor |
Live monitor for a running pipeline |
Advanced Video
| Skill | Description |
|---|---|
/fk-gen-chain-videos |
Auto start+end frame chaining for smooth transitions (i2v_fl) |
/fk-insert-scene |
Multi-angle shots, cutaways, close-ups within a chain |
/fk-creative-mix |
Analyze story + suggest all techniques (chain, insert, r2v, parallel) |
Review & Quality
| Skill | Description |
|---|---|
/fk-review-video |
AI vision scoring of generated scene videos (quality, consistency, usability) โ see AI Vision Providers below |
/fk-review-board |
Visual scene-by-scene review board for feedback before locking a cut |
/fk-change-provider |
View/switch which AI CLI (claude/agy/codex) powers /fk-review-video |
Reference
| Skill | Description |
|---|---|
/fk-camera-guide |
Camera angles, movements, lighting, DOF for cinematic video prompts |
/fk-thumbnail-guide |
Hook-worthy thumbnail design rules |
TTS & Narration
| Skill | Description |
|---|---|
/fk-gen-tts-template |
Create a voice template for consistent narration |
/fk-import-voice |
Import an existing voice recording as a template |
/fk-gen-narrator |
Generate narrator text + TTS for all scenes |
/fk-gen-text-overlays |
Generate text overlays from narrator text (dates, locations, stats) |
/fk-concat-fit-narrator |
Trim scene videos to fit narrator duration, then concat |
/fk-gen-music |
Generate background music via Suno |
YouTube
| Skill | Description |
|---|---|
/fk-youtube-seo |
Generate SEO-optimized title, description, tags |
/fk-brand-logo |
Apply channel icon watermark to video/thumbnails |
/fk-youtube-upload |
Upload to YouTube with rule validation + scheduling |
/fk-thumbnail |
Generate YouTube-optimized thumbnails |
Utilities
| Skill | Description |
|---|---|
/fk-status |
Full project dashboard + recommended next action |
/fk-switch-project |
Switch the active project |
/fk-fix-uuids |
Repair any CAMSโฆ media_ids to UUID format |
/fk-refresh-urls |
Refresh expired GCS signed URLs for images/videos |
/fk-upload-image |
Upload a local image to get a media_id |
/fk-add-material |
Image material system |
/fk-change-model |
View/switch video, image, and upscale model keys |
/fk-dashboard |
Live status in the Claude Code statusline |
/fk-doctor |
Diagnose any error (Flow API, extension, worker, YouTube) and prescribe a fix |
AI CLI Compatibility (Skill Consumption)
Skills are .md recipes any AI coding-assistant CLI can read and follow โ this is about which agent reads the skill files, not which model does the work:
| CLI | Instructions | How skills work |
|---|---|---|
| Claude Code | CLAUDE.md (auto-loaded) |
Native /fk-* slash commands |
| Codex CLI | AGENTS.md โ reads CLAUDE.md |
User says /fk-, agent reads skills/fk-.md |
| Gemini CLI | GEMINI.md โ reads CLAUDE.md |
Same pattern |
AI Vision Providers (Video Review)
Separate from the table above โ this is about which CLI backend does the vision analysis for /fk-review-video. Three providers are supported and swappable at runtime, no restart required:
| Provider | Binary | Setup |
|---|---|---|
claude |
Claude Code CLI | Default โ works out of the box |
agy |
Google Antigravity CLI | Install separately, sign in once |
codex |
OpenAI Codex CLI | npm install -g @openai/codex, then codex login once |
# View provider status (installed / version-tested / currently active)
curl -s "http://127.0.0.1:8100/api/providers?live=true" | python3 -m json.tool
# Switch provider โ hot-reloaded immediately, no server restart
curl -X PATCH http://127.0.0.1:8100/api/providers \
-H "Content-Type: application/json" -d '{"active": "agy"}'
Or just run /fk-change-provider for an interactive picker. Full details in skills/fk-change-provider.md.
Video Generation Techniques
| Technique | API Type | Use Case |
|---|---|---|
| i2v | GENERATE_VIDEO |
Image โ video (standard) |
| i2v_fl | GENERATE_VIDEO + endImage |
Start+end frame โ smooth scene transitions |
| r2v | GENERATE_VIDEO_REFS |
Reference images โ video (intros, dream sequences) |
| Upscale | UPSCALE_VIDEO |
Video โ 4K (TIER_TWO only) |
API Reference
CRUD Endpoints
| Resource | Create | List | Get | Update | Delete |
|---|---|---|---|---|---|
| Project | POST /api/projects |
GET /api/projects |
GET /api/projects/{id} |
PATCH /api/projects/{id} |
DELETE /api/projects/{id} |
| Character | POST /api/characters |
GET /api/characters |
GET /api/characters/{id} |
PATCH /api/characters/{id} |
DELETE /api/characters/{id} |
| Video | POST /api/videos |
GET /api/videos?project_id= |
GET /api/videos/{id} |
PATCH /api/videos/{id} |
DELETE /api/videos/{id} |
| Scene | POST /api/scenes |
GET /api/scenes?video_id= |
GET /api/scenes/{id} |
PATCH /api/scenes/{id} |
DELETE /api/scenes/{id} |
| Request | POST /api/requests |
GET /api/requests |
GET /api/requests/{id} |
PATCH /api/requests/{id} |
โ |
Special Endpoints
| Endpoint | Description |
|---|---|
GET /health |
Server + extension status |
GET /api/flow/status |
Extension connection details |
GET /api/flow/credits |
User credits + tier |
GET /api/requests/pending |
Pending request queue |
GET /api/projects/{id}/characters |
Entities linked to project |
Request Types
| Type | Required Fields | Async? | reCAPTCHA? |
|---|---|---|---|
GENERATE_CHARACTER_IMAGE |
character_id, project_id | No | Yes |
GENERATE_IMAGE |
scene_id, project_id, video_id, orientation | No | Yes |
GENERATE_VIDEO |
scene_id, project_id, video_id, orientation | Yes | Yes |
GENERATE_VIDEO_REFS |
scene_id, project_id, video_id, orientation | Yes | Yes |
UPSCALE_VIDEO |
scene_id, project_id, video_id, orientation | Yes | Yes |
Worker Behavior
- Server handles throttling โ worker enforces max 5 concurrent + 10s cooldown automatically. Use
POST /api/requests/batchto submit all at once; do NOT manually batch. - 10s cooldown between API calls (anti-spam, configurable via
API_COOLDOWN) - Reference blocking โ scene image gen refuses if any referenced entity is missing
media_id - Skip completed โ wonโt re-generate already-completed assets
- Cascade clear โ regenerating image auto-resets downstream video + upscale
- Retry โ failed requests retry up to 5 times
- UUID enforcement โ extracts UUID from fifeUrl if response doesnโt provide it directly
- Voice context โ auto-appends character
voice_descriptionto video prompts - No background music โ auto-appends โno background music, keep sound effectsโ to all video prompts
- Dual video response schema โ Lite/Fast/Ultra models return
operations[]and stream URLs; Low Priority models (veo_3_1_*_low_priority,*_ultra_relaxed) returnworkflows + mediawith the MP4 inline as base64. The SDK auto-detects, validates theftypmagic, and saves the binary tooutput/_workflow_videos/{media_id}.mp4. The sceneโs_video_urlis then afile://path whichcurlandffmpeghandle natively._video_media_idalways stores the real Flow media UUID, so upscale works for both schemas.
Default Model & Tier Compatibility
The default for PAYGATE_TIER_TWO frame_2_video and start_end_frame_2_video is veo_3_1_i2v_lite_low_priority โ the TRUE 0-credit Low Priority that works on every service tier including SERVICE_TIER_ADVANCED.
The *_ultra_relaxed family (Low Priority ultra-quality) silently returns empty operations on SERVICE_TIER_ADVANCED accounts because Google requires SERVICE_TIER_ULTRA for that path. ULTRA-tier users can switch back via /fk-change-model โ see skills/fk-change-model.md for the full preset list and tier compatibility matrix.
Material System
Every project must have a material field that controls the visual style of generated images. Set it at project creation.
# List available materials
curl -s http://127.0.0.1:8100/api/materials
# Set on project
curl -X POST http://127.0.0.1:8100/api/projects \
-d '{"name": "...", "material": "3d_pixar", ...}'
Materials control both entity image_prompt style and scene scene_prefix. Examples: realistic, 3d_pixar, anime, stop_motion, minecraft, oil_painting.
Configuration
| Variable | Default | Description |
|---|---|---|
API_HOST |
127.0.0.1 |
REST API bind address |
API_PORT |
8100 |
REST API port |
WS_HOST |
127.0.0.1 |
WebSocket server bind |
WS_PORT |
9222 |
WebSocket server port |
POLL_INTERVAL |
5 |
Worker poll interval (seconds) |
MAX_RETRIES |
5 |
Max retries per request |
VIDEO_POLL_TIMEOUT |
420 |
Video gen poll timeout (seconds) |
API_COOLDOWN |
10 |
Seconds between API calls (anti-spam) |
Architecture
agent/
โโโ main.py # FastAPI app + WebSocket server
โโโ config.py # Configuration (loads models.json, providers.json)
โโโ models.json # Video/upscale/image model mappings
โโโ providers.json # Active AI CLI provider for video review (claude/agy/codex)
โโโ db/
โ โโโ schema.py # SQLite schema (aiosqlite)
โ โโโ crud.py # Async CRUD with column whitelisting
โโโ models/ # Pydantic models + Literal enums
โโโ api/ # REST routes (projects, videos, scenes, characters, requests,
โ # flow, models, providers, reviews, materials, music, tts)
โโโ services/
โ โโโ flow_client.py # WS bridge to extension
โ โโโ headers.py # Randomized browser headers
โ โโโ tts.py # OmniVoice TTS (subprocess-based)
โ โโโ scene_chain.py # Continuation scene logic
โ โโโ video_reviewer.py # AI vision review โ contact sheet + claude/agy/codex CLI dispatch
โ โโโ post_process.py # ffmpeg trim/merge/music
โโโ worker/
โโโ processor.py # Queue processor + poller
extension/ # Chrome MV3 extension
skills/ # AI agent workflow recipes (CLI-agnostic)
youtube/
โโโ auth.py # OAuth2 multi-channel auth
โโโ upload.py # Upload with scheduling + rule validation
โโโ channels/ # Per-channel config (gitignored)
โโโ /
โโโ client_secrets.json # OAuth2 credentials
โโโ token.json # Auth token (auto-created)
โโโ channel_rules.json # Upload rules + SEO defaults
โโโ upload_history.json # Upload log
CLAUDE.md # AI agent instructions (Claude Code)
AGENTS.md # AI agent instructions (Codex CLI)
GEMINI.md # AI agent instructions (Gemini CLI)
TTS Narration (OmniVoice)
Optional narrator voice for scenes. Uses OmniVoice โ multilingual zero-shot TTS with voice cloning (600+ languages).
Setup
See skills/fk-gen-tts-template.md for full install guide. Quick version:
pip install torch==2.8.0 torchaudio==2.8.0 # or +cu128 for NVIDIA
pip install omnivoice
python3 -c "from omnivoice import OmniVoice; print('OK')"
If OmniVoice is in a separate venv, point to it:
export TTS_PYTHON_BIN=/path/to/omnivoice-venv/bin/python3
Workflow
- Create voice template โ
/fk-gen-tts-templateโ generates an anchor voice WAV - Add narrator text to scenes โ
PATCH /api/scenes/{id}withnarrator_text - Generate narration โ
/fk-gen-narratorโ voice-clones the template for each scene - Concat with narration โ
/fk-concat-fit-narratorโ trims scene videos to match TTS duration
CPU-only recommended (MPS produces artifacts). ~15-30s per scene.
YouTube Upload Pipeline
Automated upload with per-channel rules, SEO optimization, and brand watermarking.
Setup
# 1. Place OAuth credentials
cp client_secrets.json youtube/channels//
# 2. Authenticate (opens browser)
python3 youtube/auth.py # Linux / Windows (WSL)
arch -arm64 python3 youtube/auth.py # macOS Apple Silicon
# 3. Token saved to youtube/channels//token.json (auto-refreshes)
Channel Rules (channel_rules.json)
Each channel has a rules file controlling upload scheduling and SEO:
{
"shorts": {"max_per_day": 3, "optimal_times": ["07:00", "12:00", "17:00"]},
"long_form": {"max_per_day": 1, "optimal_times": ["19:00"]},
"scheduling": {"min_gap_hours": 4, "avoid_hours": [0,1,2,3,4,5]},
"seo": {"niche": "...", "default_tags": [...], "title_max_chars": 65}
}
Skill Chain
/fk-youtube-seo โ generates title, description, hashtags, tags
/fk-brand-logo โ applies channel icon watermark
/fk-youtube-upload โ validates rules + uploads (auto-detects Short vs Long-form)
Upload validation checks: max per day, min gap between uploads, avoid dead hours. Auto-detects Short (<61s + vertical 9:16) vs Long-form.
Error Handling
Errors can originate from four layers โ Google Flow backend, Chrome extension, FastAPI layer, and the worker itself. The workerโs _handle_failure (agent/worker/processor.py:414-481) routes recovery by error_message string content, not HTTP status, because Flow lumps many distinct failures under HTTP 400 with varying details.reason values.
Flow-Native Structured Errors
These arrive in the response body as data.error.details[].reason. The worker appends the reason to error_message as " []".
| Reason string | Meaning | Auto-handling |
|---|---|---|
PUBLIC_ERROR_UNSAFE_GENERATION |
Prompt tripped safety filter (people, violence, nudity) | Mark FAILED โ rewrite prompt (use alias names, remove triggers) |
PUBLIC_ERROR_USER_QUOTA_REACHED |
Daily credits exhausted | Mark FAILED โ wait for reset or upgrade tier |
PUBLIC_ERROR_MODEL_ACCESS_DENIED |
Tier mismatch (e.g. TIER_ONE trying Veo 3 / upscale) | Mark FAILED โ auto-detect should downgrade to allowed model |
Requested entity was not found |
Uploaded media_id expired (~1h TTL) |
Auto-recover via _recover_entity_not_found โ re-uploads from image_url, re-queues PENDING |
Internal error encountered |
Flow backend transient 500 | Exponential backoff retry: 2^retry * 10s, capped 300s |
reCAPTCHA failed / captcha |
Extension couldnโt solve CAPTCHA | Retry up to 10ร without incrementing retry_count (processor.py:454-464) |
PUBLIC_ERROR_UNUSUAL_ACTIVITY (403, message reCAPTCHA evaluation failed) |
Google flagged the session as bot-like โ usually rapid bursts of submits, VPN/shared IP, or stale auth cookies | NOT auto-recoverable. Pause submits, clear cookies for google.com + labs.google in Chrome, sign back in at labs.google/fx/tools/flow, then resubmit with โฅ1s gap and โค5 concurrent. See /fk-doctor for full playbook. |
HTTP Status Codes
| Status | Source | Meaning | Handling |
|---|---|---|---|
| 400 | Flow API | Invalid payload, UNSAFE_GENERATION, entity not found (sometimes) | Route by details.reason โ some are auto-recoverable, others terminal |
| 401 | Flow API | Bearer token expired | Extension re-captures token from labs.google tab; request retries |
| 403 | Extension (background.js:432) |
CAPTCHA_FAILED, NO_FLOW_TAB, or MODEL_ACCESS_DENIED |
CAPTCHA โ retry loop; NO_FLOW_TAB โ fail (user must open Flow); tier โ fail |
| 404 | Flow API | media_id not found (expired upload) |
Same as โRequested entity was not foundโ โ auto re-upload |
| 429 | Flow API | Rate limited / quota | Back off + retry; if USER_QUOTA_REACHED appears, fail |
| 500 | Flow backend or extension fetch exception (background.js:504) |
Transient server error OR network drop during fetch | Retry with exponential backoff |
| 502 | FastAPI default (agent/api/flow.py:80,92) |
Extension returned error without explicit status | Retry; check extension health |
| 503 | FastAPI (api/flow.py) |
โExtension not connectedโ or NO_FLOW_KEY |
Worker waits for reconnect โ status set to PENDING, not FAILED |
| 504 | Agent | 60s timeout waiting for extension WS response | Treated as transient; re-queue PENDING |
Status-code detection logic lives in agent/worker/_parsing.py:_is_error โ a result is an error if result.error is set, status >= 400, or data.error is present.
Extension / Transport Errors
String patterns in error_message that the worker recognizes:
| Error message contains | Cause | Handling |
|---|---|---|
Extension not connected |
Chrome extension offline or WS dropped | 503 returned; worker re-queues PENDING and waits |
extension reconnected / extension disconnected |
WS bounce mid-request | Re-queue PENDING without incrementing retry_count |
extension_switched |
User switched Flow tabs mid-generation | Re-queue PENDING |
NO_FLOW_KEY |
Extension has no captured bearer token | User must open labs.google/fx/tools/flow and sign in |
NO_FLOW_TAB |
No Google Flow tab available for reCAPTCHA | User must open a Flow tab |
Failed to fetch |
Network drop inside extension service worker | Retry with backoff |
timeout / WS 60s no response |
Extension hung mid-request | Re-queue PENDING |
Worker Retry Policy
processor.py:_handle_failure decides terminal vs retryable:
- Auto-recover if message contains
"not found"โ re-upload media, mark PENDING. - Transient WS (
reconnected/disconnected/switched) โ re-queue PENDING, keepretry_count. - CAPTCHA โ retry up to 10ร without counting toward
MAX_RETRIES. - Default โ increment
retry_count; if <MAX_RETRIES(5), schedule retry with2^retry * 10sbackoff (capped 300s). Otherwise mark FAILED.
YouTube Upload Errors
From youtube/upload.py (HTTP errors from YouTube Data API v3):
| Error | Cause | Fix |
|---|---|---|
invalidTags (400) |
Tags exceed 500-char limit (incl. quote overhead: spaces โ +2 per tag) | Trim tags; validate with sum(len(t) + (2 if ' ' in t else 0) for t in tags) + (len(tags)-1) <= 500 |
invalidCategoryId (400) |
Unknown category | Use "22" (People & Blogs) or "24" (Entertainment) |
quotaExceeded (403) |
Daily 10K quota exhausted (uploads cost 1600) | Wait 24h (Pacific midnight reset) |
uploadLimitExceeded (400) |
Channel daily upload cap hit | Wait 24h or use different channel |
invalid_grant (auth) |
Token revoked or expired | Re-run python3 youtube/auth.py |
scheduledPublishTimeInPast |
publishAt <= now |
Use auto_schedule() or bump to next day |
Common Symptoms โ Fix
| Problem | Solution |
|---|---|
| Extension shows โAgent disconnectedโ | Start python -m agent.main |
| Extension shows โNo tokenโ | Open labs.google/fx/tools/flow and sign in |
CAPTCHA_FAILED: NO_FLOW_TAB |
Open a Google Flow tab |
403 MODEL_ACCESS_DENIED |
Tier mismatch โ check /api/flow/credits, downgrade model in models.json |
403 PUBLIC_ERROR_UNUSUAL_ACTIVITY / reCAPTCHA evaluation failed |
Pause submits, clear cookies for google.com + labs.google in Chrome, sign back in, then resubmit with โฅ1s gap and โค5 concurrent. Switch network or wait 1โ6 h if still blocked |
| Scene images inconsistent | Check all refs have UUID media_id โ run /fk-fix-uuids |
media_id starts with CAMS... |
Run /fk-fix-uuids to extract UUID from URL |
| Upscale โpermission deniedโ | Requires PAYGATE_TIER_TWO account |
| Request stuck in PROCESSING | Check error_message history; if extension dropped, restart extension |
| โRequested entity was not foundโ spam | Image URLs expired โ re-upload via POST /api/upload-image or wait for auto-recovery |
YouTube upload invalidTags |
Tag-char overflow; reduce tags (quote overhead bytes count) |
Python cryptography arch mismatch |
Use python3.10, not python3.13 (x86/arm64 binary mismatch) |
License
MIT
Community & Support
Share anything crazy and useful created with Vibe Code. Drop in to:
- Post the story-video runs and thumbnails youโve generated
- Share scene templates, prompt recipes, and reference-image setups
- Ask for help when an output isnโt matching what you imagined
- Request features and report bugs youโve hit in the wild
- Trade tips on Google Flow plan limits, Veo i2v behaviour, and Chrome extension setup
- Facebook Post via Extension MCP
- Right way to build Mobile Application + System
์ถ์ฒ ๋๊ตฌ
๋ค๋ฅธ ํค์๋๋ฅผ ์ ๋ ฅํ๊ฑฐ๋ ํํฐ๋ฅผ ์ ๊ฑฐํด ๋ณด์ธ์.
์ค์น
npx skillfish add crisng95/flowkit