Netlops 91dcd8fd85 feat(i2v): enhance image-to-video documentation and single/dual frame support
- Update README.md to clarify single vs dual frame image support with
  automatic model_key selection
- Add detailed explanation of automatic adaptation system for
  different image counts
- Include clear distinction between single frame mode (1 image) and
  dual frame mode (2 images) with proper model selection

fix(browser-captcha): increase page load timeout from 15s to 60s

- Extend retry range from 15 to 60 attempts for page loading
- Update debug logging to reflect new timeout values
- Improve reliability of captcha service by allowing more time for
  page load completion

fix(api): correct I2V API endpoint URL for single frame generation

- Change URL from batchAsyncGenerateVideoStartAndEndImage to
  batchAsyncGenerateVideoStartImage for single frame scenarios

fix(model-config): correct model_key for I2V single frame mode

- Fix typo in model_key: remove duplicate 'fl_' in
  veo_3_1_i2v_s_fast_fl_landscape
- Implement automatic model_key transformation for single frame mode
  by replacing '_fl_' with '_' in model keys
- Add debug logging for model key transformation process
2026-01-08 11:45:24 +08:00
2025-12-25 18:21:17 +08:00
2025-11-24 18:27:05 +08:00
2025-11-25 11:15:22 +08:00
2025-11-24 18:27:05 +08:00
2025-12-18 16:56:48 +08:00

Flow2API

License Python FastAPI Docker

一个功能完整的 OpenAI 兼容 API 服务,为 Flow 提供统一的接口

核心特性

  • 🎨 文生图 / 图生图
  • 🎬 文生视频 / 图生视频
  • 🎞️ 首尾帧视频
  • 🔄 AT自动刷新
  • 📊 余额显示 - 实时查询和显示 VideoFX Credits
  • 🚀 负载均衡 - 多 Token 轮询和并发控制
  • 🌐 代理支持 - 支持 HTTP/SOCKS5 代理
  • 📱 Web 管理界面 - 直观的 Token 和配置管理
  • 🎨 图片生成连续对话

🚀 快速开始

前置要求

  • Docker 和 Docker Compose推荐

  • 或 Python 3.8+

  • 由于Flow增加了额外的验证码你可以自行选择使用浏览器打码或第三发打码 注册YesCaptcha并获取api key将其填入系统配置页面YesCaptcha API密钥区域

方式一Docker 部署(推荐)

标准模式(不使用代理)

# 克隆项目
git clone https://github.com/TheSmallHanCat/flow2api.git
cd flow2api

# 启动服务
docker-compose up -d

# 查看日志
docker-compose logs -f

WARP 模式(使用代理)

# 使用 WARP 代理启动
docker-compose -f docker-compose.warp.yml up -d

# 查看日志
docker-compose -f docker-compose.warp.yml logs -f

方式二:本地部署

# 克隆项目
git clone https://github.com/TheSmallHanCat/flow2api.git
cd sora2api

# 创建虚拟环境
python -m venv venv

# 激活虚拟环境
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate

# 安装依赖
pip install -r requirements.txt

# 启动服务
python main.py

首次访问

服务启动后,访问管理后台: http://localhost:8000,首次登录后请立即修改密码!

  • 用户名: admin
  • 密码: admin

📋 支持的模型

图片生成

模型名称 说明 尺寸
gemini-2.5-flash-image-landscape 图/文生图 横屏
gemini-2.5-flash-image-portrait 图/文生图 竖屏
gemini-3.0-pro-image-landscape 图/文生图 横屏
gemini-3.0-pro-image-portrait 图/文生图 竖屏
imagen-4.0-generate-preview-landscape 图/文生图 横屏
imagen-4.0-generate-preview-portrait 图/文生图 竖屏

视频生成

文生视频 (T2V - Text to Video)

⚠️ 不支持上传图片

模型名称 说明 尺寸
veo_3_1_t2v_fast_portrait 文生视频 竖屏
veo_3_1_t2v_fast_landscape 文生视频 横屏
veo_2_1_fast_d_15_t2v_portrait 文生视频 竖屏
veo_2_1_fast_d_15_t2v_landscape 文生视频 横屏
veo_2_0_t2v_portrait 文生视频 竖屏
veo_2_0_t2v_landscape 文生视频 横屏

首尾帧模型 (I2V - Image to Video)

📸 支持1-2张图片1张作为首帧2张作为首尾帧

💡 自动适配:系统会根据图片数量自动选择对应的 model_key

  • 单帧模式1张图使用首帧生成视频
  • 双帧模式2张图使用首帧+尾帧生成过渡视频
模型名称 说明 尺寸
veo_3_1_i2v_s_fast_fl_portrait 图生视频 竖屏
veo_3_1_i2v_s_fast_fl_landscape 图生视频 横屏
veo_2_1_fast_d_15_i2v_portrait 图生视频 竖屏
veo_2_1_fast_d_15_i2v_landscape 图生视频 横屏
veo_2_0_i2v_portrait 图生视频 竖屏
veo_2_0_i2v_landscape 图生视频 横屏

多图生成 (R2V - Reference Images to Video)

🖼️ 支持多张图片

模型名称 说明 尺寸
veo_3_0_r2v_fast_portrait 图生视频 竖屏
veo_3_0_r2v_fast_landscape 图生视频 横屏

📡 API 使用示例(需要使用流式)

文生图

curl -X POST "http://localhost:8000/v1/chat/completions" \
  -H "Authorization: Bearer han1234" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image-landscape",
    "messages": [
      {
        "role": "user",
        "content": "一只可爱的猫咪在花园里玩耍"
      }
    ],
    "stream": true
  }'

图生图

curl -X POST "http://localhost:8000/v1/chat/completions" \
  -H "Authorization: Bearer han1234" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-4.0-generate-preview-landscape",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "将这张图片变成水彩画风格"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "data:image/jpeg;base64,<base64_encoded_image>"
            }
          }
        ]
      }
    ],
    "stream": true
  }'

文生视频

curl -X POST "http://localhost:8000/v1/chat/completions" \
  -H "Authorization: Bearer han1234" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo_3_1_t2v_fast_landscape",
    "messages": [
      {
        "role": "user",
        "content": "一只小猫在草地上追逐蝴蝶"
      }
    ],
    "stream": true
  }'

首尾帧生成视频

curl -X POST "http://localhost:8000/v1/chat/completions" \
  -H "Authorization: Bearer han1234" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo_3_1_i2v_s_fast_fl_landscape",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "从第一张图过渡到第二张图"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "data:image/jpeg;base64,<首帧base64>"
            }
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "data:image/jpeg;base64,<尾帧base64>"
            }
          }
        ]
      }
    ],
    "stream": true
  }'

📄 许可证

本项目采用 MIT 许可证。详见 LICENSE 文件。


🙏 致谢

  • PearNoDec 提供的YesCaptcha打码方案
  • raomaiping 提供的无头打码方案 感谢所有贡献者和使用者的支持!

📞 联系方式


如果这个项目对你有帮助,请给个 Star

Star History

Star History Chart

Description
无限次数的banana pro!逆向账号池,支持负载均衡、AT自动刷新、缓存策略、代理等。Q交流群1073237297
Readme MIT 22 MiB
Languages
Python 87.6%
HTML 11.4%
JavaScript 0.9%
Shell 0.1%