Rabornkraken/browser2api
Rabornkraken/browser2api has 28 GitHub stars and 6 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-14 10:24 UTC. Last push 2026-03-02.
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Turn browser UIs into programmatic image and video generation APIs. Automates image generation tools such as Jimeng (即梦AI) and Google Flow via Playwright + Chrome CDP — no API keys or reverse engineering needed.
Creative & MediaREADME.md
Originalbrowser2api
Turn browser UIs into programmatic image and video generation APIs.
Automates web UIs via Playwright + Chrome CDP — no API keys or reverse engineering needed.
Supported Platforms
Image: Seedream 5.0 — up to 4 images, 2K/4K |
|
Image: Imagen 4, Nano Banana 2 — up to 4 images |
Demo
Jimeng — Image Generation with Seedream 5.0 · "A Shiba Inu eating ramen in a ramen shop, anime style"
https://github.com/user-attachments/assets/616f7f5f-1b20-49dd-9579-4680f310a32b
Google Flow — Image Generation with Nano Banana 2 · "Shiba eating ramen, anime style"
https://github.com/user-attachments/assets/8df63cf4-a429-48df-a26d-74be0c23b7e5
Google Flow — Video Generation with Veo 3.1 Fast · "A cat walking through a garden"
https://github.com/user-attachments/assets/7b69ccf4-4824-4bff-adca-11dfc12fcbbf
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
playwright install chromium
Requires Python 3.11+ and Google Chrome installed locally.
Quick Start
Jimeng — Image Generation
python examples/generate.py "A cat in an astronaut suit standing on the moon"
python examples/generate.py "prompt" --model jimeng-5.0 --ratio 1:1 --resolution "超清 4K"
Models: jimeng-3.0 jimeng-3.1 jimeng-4.0 jimeng-4.1 jimeng-4.5 jimeng-4.6 jimeng-5.0
Jimeng — Video Generation
python examples/generate_video.py "A cat walking through a garden"
python examples/generate_video.py "City night skyline" --ratio 16:9 --duration 10s --model video-3.0-fast
Models: seedance-2.0-fast seedance-2.0 video-3.5-pro video-3.0-pro video-3.0-fast video-3.0
Google Flow — Image Generation
python examples/generate_flow.py "A sunset over mountains, digital art"
python examples/generate_flow.py "prompt" --model nano-banana-2 --orientation portrait --count 4
Models: nano-banana-pro nano-banana-2 imagen-4
Google Flow — Video Generation
python examples/generate_flow_video.py "A cat walking through a garden"
python examples/generate_flow_video.py "prompt" --model veo-3.1-quality --orientation portrait --count 1
Models: veo-3.1-fast veo-3.1-quality veo-2-fast veo-2-quality
How It Works
- Launch — Opens a real Chrome browser via CDP (not Playwright's bundled Chromium) for anti-detection
- Login — Checks for a valid session. If not logged in, opens a headed browser for manual login. Session persists in
~/.browser2api/browser_data/ - Generate — Navigates to the generation page, configures model/settings via UI automation, fills the prompt, clicks submit
- Capture — Intercepts network responses and polls the DOM for generated content
- Download — Downloads results locally
Programmatic Usage
import asyncio
from browser2api import BrowserManager, Platform
from browser2api.platforms.jimeng import JimengClient, JimengModel, JimengRatio
async def main():
bm = BrowserManager()
context, page = await bm.launch_for_login(Platform.JIMENG)
client = JimengClient(
page, context,
output_dir="./output",
model=JimengModel.JIMENG_5_0,
ratio=JimengRatio.RATIO_1_1,
)
result = await client.generate_images("一只猫", count=4, timeout_seconds=120)
print(f"Status: {result.status.value}")
for img in result.images:
print(f" {img.local_path} ({img.width}x{img.height})")
await bm.close()
asyncio.run(main())
from browser2api.platforms.flow import FlowVideoClient, FlowVideoModel, FlowOrientation
async def generate_flow_video():
bm = BrowserManager()
context, page = await bm.launch_for_login(Platform.FLOW)
client = FlowVideoClient(
page, context,
output_dir="./output",
model=FlowVideoModel.VEO_3_1_FAST,
orientation=FlowOrientation.LANDSCAPE,
)
result = await client.generate_video("A cat walking through a garden", timeout_seconds=300)
print(f"Video: {result.video.local_path} ({result.video.size_bytes:,} bytes)")
await bm.close()
Notes
Jimeng (即梦AI)
- Member subscription recommended — Required for video generation and higher daily image quotas.
- Login — First run opens a headed Chrome window for manual login. Session is saved and reused.
- 4K resolution — Requires membership. Free accounts are limited to 2K.
- Video generation — 30-120s depending on model/duration.
Google Flow
- Google account required — Must be logged in via the headed browser.
- Regional availability — May require a VPN in some regions.
- Video generation — 60-120+s depending on model.
Project Structure
src/browser2api/
├── config.py # Shared constants (DATA_DIR)
├── types.py # Platform, GenerationStatus, GeneratedImage, GeneratedVideo, etc.
├── base.py # Abstract base classes
├── browser.py # BrowserManager, ChromeLauncher, CDP connection
└── platforms/
├── jimeng/
│ ├── client.py # JimengBaseClient, JimengClient, JimengVideoClient
│ ├── enums.py # Models, ratios, resolutions, durations
│ ├── selectors.py # CSS selectors and URL constants
│ └── login.py # Cookie-based login handler
└── flow/
├── client.py # FlowBaseClient, FlowClient, FlowVideoClient
├── enums.py # Models, orientations, video models
├── selectors.py # CSS selectors and URL constants
└── login.py # Login handler
Disclaimer
This project automates browser interactions with third-party platforms. Use at your own risk.
- Rate limits — Avoid aggressive usage. Respect platform rate limits and credit quotas.
- Session data — Stored locally in
~/.browser2api/. Keep this directory secure. - For personal/research use only — Do not use for commercial purposes or at scale without permission from the respective platforms.
Explore related projects
ytdl-org/youtube-dl
Command-line program to download videos from YouTube.com and other video sites
141,559 starsexcalidraw/excalidraw
Virtual whiteboard for sketching hand-drawn like diagrams
135,664 starsgodotengine/godot
Godot Engine – Multi-platform 2D and 3D game engine
120,120 starsmrdoob/three.js
JavaScript 3D Library.
118,356 stars