Fix conditioning ascent: load value function inside inference_mode(False)

torch.load under inference_mode creates inference tensors; MLP params then
can't participate in backward. Same fix as the earlier value function loader
in samplers.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-05-30 10:57:50 +03:00
co-authored by Claude Sonnet 4.6
parent 199d4cfee0
commit ba18fc5747
+3 -1
View File
@@ -11874,7 +11874,9 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner):
except ImportError:
from value_function import OnlineValueFunction
vf_path = refinement_state_path(refinement_key, "value_fn", prefix="refine_v2", extension="pt")
vf = OnlineValueFunction.load_or_create(vf_path)
import torch as _torch
with _torch.inference_mode(False):
vf = OnlineValueFunction.load_or_create(vf_path)
if vf is None or not vf.is_ready():
return conditioning_list
ascended = []