← 返回架构图
🔄

Flow Solver

wan/utils/fm_solvers_unipc.py · fm_solvers.py
扩散采样
基于 Flow Matching 的多步采样器,默认使用 UniPC(Unified Predictor-Corrector)。 UniPC 每步同时运行预测器(多项式外推)和校正器(提升精度), 等效阶数 = solver_order+1。训练 1000 步可用 20-40 步推理。
算法参数
solver_order默认 2,引导采样推荐 2,无条件推荐 3
shiftFlow shift 系数,480P→3.0,720P→5.0
sampling_steps推理步数,默认 40(Fast 模式 20)
lower_order_final最后几步降阶防震荡
Flow Matching 关键公式
x0预测x0 = xt - σt × velocity_pred
CFGv = v_uncond + scale × (v_cond - v_uncond)
UniPC更新多阶 Adams-Bashforth 预测 + 校正
dpm++备选求解器,适合无分类器引导