RTX 3090 (24GB, Ampere) · INT8 ConvRot · dpmpp_2m_sde+karras · 1024×1024 · 同 seed=42
| 配置 | s/it | 采样时间 | 总执行 | 加速 |
|---|---|---|---|---|
| 基线 INT8 ConvRot · 50步 | 6.38s | ~319s | 448s | 1.00× |
| + torch.compile · 50步 | 4.48s | ~224s | 253s | 1.77× |
| + torch.compile · 30步 | 4.50s | ~135s | 137s | 3.27× |
✅ torch.compile 使用 KJ Nodes TorchCompileModelAdvanced,仅编译 transformer blocks,disable_dynamic_vram=true
⚠️ INT8LazyTorchCompile(INT8-Fast Fork 自带)在 FLUX.2 上报错:_CompiledModuleProxy has no attribute 'dtype',需用 KJ 版本替代
✅ 编译后 4.48 s/it 稳定,首次有 ~8s 编译开销(第一步 16.58s),后续缓存命中
✅ 30步 vs 50步:同 seed 下画面差异极小(点击图片可查看原图对比)
FLUX.2 已集成到 KAP(commit 9351a43d),需将 TorchCompileModelAdvanced 节点添加到工作流中:
POST /api/v1/production/flux2/scene-generate
下一步:将 torch.compile 优化写入 KAP 的 flux2Generate.ts