开源 AI 视频生成模型 | 150 亿参数 | 1080p + 同步音频 | 单次前向传播
| 指标 | 规格 |
|---|---|
| 参数量 | 150 亿(15B) |
| 架构 | 统一自注意力 Transformer(无交叉注意力) |
| 输出分辨率 | 720p / 1080p |
| 音频 | 原生同步音频生成(多语言唇形同步) |
| 推理步数 | 仅需 8 步(蒸馏版本) |
| 官方推荐显存 | H100 80GB / H20 96GB |
| 消费级显存 | RTX 4090 24GB(需量化 + 较低分辨率) |
| 节点标签 | CPU | GPU 显存 | 状态 | 适用场景 |
|---|---|---|---|---|
cnb:arch:amd64:gpu:H20 | 32 核 | 96 GB | ✅ 可用(停产) | 15B 全量推理 |
cnb:arch:amd64:gpu:L40 | 16 核 | 48 GB | ✅ 推荐 | 量化推理 / 720p |
cnb:arch:amd64:gpu | 16 核 | 48 GB | ✅ 可用 | 同上 |
💡 显存建议:
- H20 (96GB):15B 全量模型,1080p 全分辨率
- L40 (48GB):需量化到 FP16 或更低位宽,或降低到 720p
happy-horse-1-0cnb.cool/ky-video/happy-horse-1-0Dockerfile、.cnb.yml、server.py、requirements.txt)ky-video/happy-horse-1-0 → 设置 → 访问令牌read_registry + write_registry 权限方式 A:推送 main 分支
git init
git add .
git commit -m "Initial commit: Happy Horse 1.0"
git remote add origin https://cnb.cool/ky-video/happy-horse-1-0.git
git push -u origin main
方式 B:在 CNB 控制台手动触发
main 分支制品地址:docker.cnb.cool/ky-video/happy-horse-1-0:latest CNB 制品库:https://cnb.cool/ky-video/happy-horse-1-0/-/artifact
创建 .cnb.yml 开发配置(或在控制台选择 GPU 环境启动),使用 VSCode Web IDE 打开:
$:
vscode:
- runner:
# ▼ 切换 GPU 类型 ▼
tags: cnb:arch:amd64:gpu:H20
# tags: cnb:arch:amd64:gpu:L40
services:
- vscode
- docker
docker build -t happy-horse-1-0:latest -f Dockerfile .
# 仅 CPU(不推荐,非常慢)
docker run -d \
--name happy-horse \
-p 8000:8000 \
happy-horse-1-0:latest
# GPU 模式(推荐)
docker run -d \
--name happy-horse \
--gpus all \
-p 8000:8000 \
-e HF_TOKEN=hf_your_token_here \
-e PORT=8000 \
-v $(pwd)/models:/app/models \
-v $(pwd)/outputs:/app/outputs \
happy-horse-1-0:latest
curl http://localhost:8000/health
| 端点 | 方法 | 说明 |
|---|---|---|
/ | GET | 服务信息 |
/health | GET | 健康检查 |
/api/v1/text-to-video | POST | 文本生成视频 |
/api/v1/image-to-video | POST | 图片生成视频 |
/api/v1/tasks/{task_id} | GET | 查询任务状态 |
/api/v1/outputs/{filename} | GET | 下载视频文件 |
curl -X POST http://localhost:8000/api/v1/text-to-video \
-H "Content-Type: application/json" \
-d '{
"prompt": "A serene lake at sunset with birds flying overhead, cinematic shot",
"negative_prompt": "blurry, low quality, distorted",
"duration_seconds": 5,
"resolution": "1080p",
"num_inference_steps": 8,
"audio_language": "en"
}'
响应:
{
"task_id": "a1b2c3d4",
"status": "processing",
"created_at": "2026-04-08T21:30:00"
}
查询状态:
curl http://localhost:8000/api/v1/tasks/a1b2c3d4
下载视频:
curl -O http://localhost:8000/api/v1/outputs/text2video_a1b2c3d4_20260408.mp4
import requests
# 提交任务
resp = requests.post("http://localhost:8000/api/v1/text-to-video", json={
"prompt": "A panda eating bamboo in a forest",
"duration_seconds": 5,
"resolution": "1080p",
})
task_id = resp.json()["task_id"]
# 轮询状态
import time
while True:
status = requests.get(f"http://localhost:8000/api/v1/tasks/{task_id}").json()
print(f"Status: {status['status']}")
if status["status"] == "completed":
print(f"Download: http://localhost:8000{status['output_url']}")
break
elif status["status"] == "failed":
print(f"Error: {status['error']}")
break
time.sleep(5)
编辑 .cnb.yml,修改 pipeline.runner.tags:
pipeline:
runner:
tags:
# ✅ H20:32核 + 96GB显存(适合 15B 全量推理)
- cnb:arch:amd64:gpu:H20
# ⚠️ L40:16核 + 48GB显存(需量化,推荐)
# - cnb:arch:amd64:gpu:L40
⚠️ 注意:修改
.cnb.yml后需重新推送main分支触发新构建。
| 场景 | H20 (96GB) | L40 (48GB) |
|---|---|---|
| 1080p 全量推理 | ✅ 流畅 | ⚠️ 需量化或 720p |
| 720p 量化推理 | ✅ 流畅 | ✅ 流畅 |
| 构建时间 | 较长 | 较短 |
| CNB 成本 | 约 35 核时/小时 | 约 35 核时/小时 |
Happy Horse 1.0 代码和权重尚未正式发布(仓库当前为预发布状态)。
方式 1:从 HuggingFace Hub 自动下载
docker run -d \ --gpus all \ -p 8000:8000 \ -e HF_TOKEN=hf_your_token \ happy-horse-1-0:latest
方式 2:挂载本地模型目录
docker run -d \ --gpus all \ -p 8000:8000 \ -v /path/to/model:/app/models \ happy-horse-1-0:latest
方式 3:使用 CNB 制品库中的模型(推荐)
CNB 文档显示 H20 已停产,但节点仍可用。如果追求稳定,建议使用 L40 节点,并通过量化(FP16/INT8)降低显存占用。
720pduration_secondstorch.float16 而非 float32)device_map="auto")# 容器内
docker exec happy-horse nvidia-smi
# API 健康检查返回 GPU 信息
curl http://localhost:8000/health
GPU 节点最大时长 4 小时。Docker 构建通常 30-60 分钟完成。如超时,尝试:
.cnb.yml 中 cache: 配置已默认开启)read┌─────────────────────────────────────────────────────────┐ │ CNB 云原生构建 │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ H20 / L40 │───▶│ Docker │ │ │ │ GPU 节点 │ │ Build │ │ │ └──────────────┘ └──────┬───────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────┐ │ │ │ CNB 制品库 │ │ │ │ docker.cnb.cool │ │ │ │ /ky-video/ │ │ │ │ happy-horse-1-0 │ │ │ └────────┬─────────┘ │ └─────────────────────────────┼───────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ CNB 云原生开发 │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ H20 / L40 │───▶│ FastAPI │ │ │ │ GPU 节点 │ │ Inference │ │ │ └──────────────┘ │ Server │ │ │ └──────────────┘ │ │ │ │ │ ▼ │ │ /api/v1/text-to-video │ │ (支持 Web 界面调用) │ └─────────────────────────────────────────────────────────┘
📅 更新时间:2026-04-08 | 仓库:
cnb.cool/ky-video/happy-horse-1-0