# wan22-serving **Repository Path**: smallsource/wan22-serving ## Basic Information - **Project Name**: wan22-serving - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-21 - **Last Updated**: 2026-08-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Wan2.2 Serving(T2V / I2V API) 在 GPU 服务器上一键部署 **Wan2.2-14B**(及可选 5B / LTX-2B)视频生成 HTTP API,供其它业务机远程调用。 > 本仓库**不含**大模型权重(约 70GB+)。克隆后执行下载脚本,或从已下好模型的「中转机」`rsync` 同步。 ## 能力 | 接口 | 说明 | |------|------| | `GET /health` | 健康检查 / 是否忙碌 | | `POST /v1/i2v` | 图生视频(multipart:`image` + `prompt` + 可选 `model=14b`)→ 返回 mp4 | | `POST /v1/t2v` | 文生视频(LTX 等;14B 更推荐 i2v) | | `POST /cancel` / `POST /free` | 取消任务 / 释放显存 | | `GET /v1/last` | 最近一次成片 | 兼容 [manhua-maker](https://github.com/) 的 `VIDEO_PROVIDER=wanhttp`: ```bash WAN_I2V_URL=http://:8000 VIDEO_PROVIDER=wanhttp ``` 调用时在 form 里传 `model=14b` 即可走 Wan2.2-14B。 ## 硬件建议 | 模型 | 显存 | 说明 | |------|------|------| | **Wan2.2-14B fp8**(推荐) | ≥ 22GB(RTX 3090/4090) | high/low 分段加载,不同时驻留 | | Wan2.2-5B | ≥ 16GB | 单文件 TI2V | | LTX-Video 2B distilled | ≥ 8GB | 默认快出片 | 官方完整 MoE `Wan2.2-*-A14B` 体积更大、显存要求更高;本仓库默认使用 **ComfyUI 重打包 fp8**(与 Comfy 官方工作流一致)。 ## 快速开始 ### 1. 克隆 ```bash git clone https://gitee.com/smallsource/wan22-serving.git cd wan22-serving ``` ### 2. 下载模型(在网速好的机器上执行) ```bash # 国内推荐 hf-mirror export HF_ENDPOINT=https://hf-mirror.com bash scripts/download_models.sh ``` 或从已下载好的机器同步: ```bash bash scripts/rsync_models_from.sh user@fast-gpu-host:/path/to/models ``` ### 3. 启动 需要本机已有 **ComfyUI** 运行时(推荐 `yanwk/comfyui-boot:cu128-slim`),并把模型挂到 `COMFY_MODELS`。 ```bash cp .env.example .env # 编辑 COMFY_ROOT / 模型目录 / 可选 API_KEY docker compose up -d curl http://127.0.0.1:8000/health ``` ### 4. 远程调用示例 ```bash # 图生视频 · 14B curl -X POST "http://GPU_IP:8000/v1/i2v" \ -H "X-API-Key: $WAN_API_KEY" \ -F "prompt=镜头缓慢推进,人物自然眨眼" \ -F "model=14b" \ -F "duration=3" \ -F "image=@frame.jpg" \ --output out.mp4 ``` 更多见 `examples/`。 ## 本仓库目录 ``` wan22-serving/ ├── api/server.py # FastAPI 服务(复用 Comfy 节点推理) ├── scripts/ │ ├── download_models.sh # 从 HF/镜像拉 14B T2V+I2V + VAE + umT5 │ ├── verify_models.sh # 检查文件是否齐全 │ └── rsync_models_from.sh ├── docker-compose.yml ├── .env.example ├── examples/ └── docs/API.md ``` ## 模型清单(ComfyUI 布局) 放到 `models/`(或挂载到 ComfyUI `models/`): ``` models/ ├── diffusion_models/ │ ├── wan2.2_t2v_high_noise_14B_fp8_scaled.safetensors │ ├── wan2.2_t2v_low_noise_14B_fp8_scaled.safetensors │ ├── wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors │ └── wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors ├── text_encoders/ │ └── umt5_xxl_fp8_e4m3fn_scaled.safetensors └── vae/ └── wan_2.1_vae.safetensors ``` 来源:`Comfy-Org/Wan_2.2_ComfyUI_Repackaged`(Hugging Face)。 ## 许可证 - 本仓库脚本与 API 封装:MIT - Wan2.2 权重:遵循 [Wan-AI / Comfy-Org](https://huggingface.co/Wan-AI) 原协议,商用请自行合规审查