From ba18fc5747d6635d70af8fe8ee88eeaef9c125da Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Sat, 30 May 2026 10:57:50 +0300 Subject: [PATCH] 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 --- conditioning.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conditioning.py b/conditioning.py index f9ef540c..999fa046 100644 --- a/conditioning.py +++ b/conditioning.py @@ -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 = []