sglang 部署wan2.2_i2v_low_noise_14B_fp8_scaled说明

4次阅读
没有评论

1. 模型说明

wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors 是 ComfyUI 专用的拆分 FP8 量化模型(Low Noise 精炼阶段),通常需要配合 wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors 一起使用。SGLang 主要支持 Wan-AI 官方 Diffusers 格式 的完整模型(如 Wan-AI/Wan2.2-I2V-A14B-Diffusers),而不是 ComfyUI 的 split safetensors。

如果你想在 SGLang 中跑这个模型,推荐使用官方 Diffusers 版本(性能更好、支持更完整)。

2. 安装 SGLang Diffusion

Bash

# 推荐方式(支持 diffusion)
pip install 'sglang[diffusion]' --prerelease=allow

# 或使用 uv(更快)
uv pip install 'sglang[diffusion]' --prerelease=allow

3. 部署命令(推荐)

启动服务器(推荐生产方式)

Bash

sglang serve --model-path Wan-AI/Wan2.2-I2V-A14B-Diffusers \
  --port 3000 \
  --num-gpus 4 \                  # 根据你的卡数调整(14B 需要多卡)
  --text-encoder-cpu-offload \
  --pin-cpu-memory \
  --enable-cfg-parallel           # I2V 强烈推荐

常见优化参数(根据硬件调整):

  • –dit-cpu-offload / –vae-cpu-offload:显存不够时开启 CPU offload
  • –ulysses-degree 2 –ring-degree 2:多卡 Sequence Parallelism
  • SGLANG_CACHE_DIT_ENABLED=true:开启 Cache-DiT 加速(可提升 2-7x)

单条生成(无需启动 server)

Bash

sglang generate --model-path Wan-AI/Wan2.2-I2V-A14B-Diffusers \
  --prompt "你的提示词" \
  --image-path "https://你的图片链接或本地路径" \
  --num-gpus 2 \
  --enable-cfg-parallel \
  --save-output

4. 如果一定要用你的 FP8 safetensors

SGLang 当前对 ComfyUI split 文件支持有限,可能需要:

  1. 下载完整 Diffusers 格式模型(推荐)。
  2. 或尝试将 safetensors 转换为 Diffusers 格式(较复杂,社区脚本可能可用)。
  3. 直接用 ComfyUI 跑你的 FP8 文件(目前最稳定)。

5. 常见问题

  • 显存需求:14B I2V 通常需要 多张 H100/B200 或 4+ 张 4090/A100(搭配 offload)。
  • I2V 输入:必须提供 –image-path。
  • 错误排查:查看 GitHub Issue(如 Wan2.2 diffusion profiler bug)。

更多官方文档参考:

  • SGLang Wan2.2 Cookbook
  • SGLang Diffusion Blog
正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)
验证码