BSAI-ComfyUI-VAERouter
Smart VAE decode/encode routing node - automatically selects the decode device by GPU1 VRAM headroom: CUDA (GPU1) / XPU (8190 iGPU worker) / CPU (fallback), offloading VAE decode from the discrete GPU to the Intel iGPU to free VRAM for sampling.
Nodes (2)
BSAI-ComfyUI-VAERouter
VAE 解码/编码智能路由节点 —— 按 GPU1 显存水位自动选择解码设备:CUDA(GPU1)/ XPU(8190 核显 worker)/ CPU(兜底),把 VAE 解码负载从独显分流到 Intel 核显,释放独显显存给采样。
Smart VAE decode/encode router — automatically picks decode device by GPU1 VRAM headroom: CUDA (GPU1) / XPU (8190 iGPU worker) / CPU (fallback). Offloads VAE decode from the discrete GPU to Intel iGPU, freeing VRAM for sampling.
Nodes | 节点
| Node | 说明 | |---|---| | BSAIVAEDecodeRouter | VAE 解码路由:auto / cuda / xpu / cpu | | BSAIVAEEncodeRouter | VAE 编码路由:cuda / cpu |
Device Strategy | 设备策略
| Mode | Behavior |
|---|---|
| cuda | Decode on GPU1 (default, fastest) |
| xpu | Forward to XPU worker at http://127.0.0.1:8190 (latent binary protocol) |
| cpu | Decode on CPU, zero VRAM (slow fallback) |
| auto | If GPU1 free VRAM below threshold AND XPU worker online → xpu; if below threshold but worker offline → cpu; else cuda |
Prerequisite | 前置
The XPU worker (port 8190) must be running. It is launched automatically by the BSAI launcher bat (BSAI_XPU_VAE_Worker_8190.bat), which starts BSAI_XPU_VAE_Server.py.
Install | 安装
cd ComfyUI/custom_nodes
git clone https://github.com/xm6018924/BSAI-ComfyUI-VAERouter.git
No extra pip dependencies beyond ComfyUI base.
Usage | 使用
- Start the XPU VAE worker (auto-started by BSAI launcher).
- Replace your regular
VAEDecodenode with BSAIVAEDecodeRouter. - Set mode to
autofor hands-off offloading. - Connect model/latent/images exactly like the standard VAE node.
Compatibility | 兼容
- ComfyUI ≥ 0.37
- Windows 10/11 with NVIDIA dGPU + Intel iGPU
- Pairs with BSAI-ComfyUI-Orchestrator for policy-driven routing.
NVFP4 Decoder 推荐映射 | Recommended NVFP4 Decoder Mapping (2026-10-20 FastH3-QAD-v2)
海螺 AI Lab 2026-10-20 发布 FastH3-QAD-v2(量化感知蒸馏整套 NVFP4,118GB→30GB,质量不降反升)时随附两款新 NVFP4 VAE 解码器。本路由节点负责"解码跑在哪块卡",decoder 模型文件由上游 Loader(如 BSAI_SolH3_Loader)提供,选型建议如下:
| 档位 | 文件(放 models/vae) | 体积 | PSNR | 速度 | 推荐场景 |
|---|---|---|---|---|---|
| 36 层高质量档 | *h3_nvfp4_vae_36l*.safetensors(新,ComfyUI 版文件名以官方发布为准) | 1.29 GiB | 33.63 dB(距原版仅差 0.10 dB) | 单 DGX Spark 解码 58s/5s-clip | 成片/交付级:口型、细节、音画同步要求最高时 |
| 8 层极速档 | *h3_nvfp4_vae_8l*.safetensors(新) | 0.31 GiB | 32.2 dB | 快 15 倍(单 DGX Spark 43s→1.6s) | 草稿/迭代/批量预览:RTX 5090 5s 480P 全程 12.6~14.8s |
| (旧)LightVAE-Lite | lightvae-lite-h3-decoder-int8-convrot.safetensors | 0.78 GiB | ≈31.7 dB | 2.5s/124帧 | 兼容兜底(旧工作流) |
注意:两款新解码器在 FastH3 自己生成的潜变量上训练,贴合实际使用场景;社区 LoRA 以 BF16 旁路挂在 NVFP4 权重旁,选任一档都不影响 LoRA 注入。搭配
render_pipeline = QAD-v2-8步档(H3-Film-Factory v14.196+,官方 shift 10/3)食用最佳。
License | 许可
MIT