Clear value function on session reset

reset_session now deletes the value function .pt file alongside the
enhancement files. Previously it was orphaned across resets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-05-30 10:56:40 +03:00
co-authored by Claude Sonnet 4.6
parent 3d6e06fd32
commit 199d4cfee0
+7
View File
@@ -6010,6 +6010,13 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner):
clear_refinement_data(refinement_key)
except Exception as e:
print(f"[FunPackVideoRefinerV2] Enhancement cleanup failed: {e}")
vf_path = refinement_state_path(refinement_key, "value_fn", prefix="refine_v2", extension="pt")
try:
if os.path.exists(vf_path):
os.remove(vf_path)
print(f"[FunPackVideoRefinerV2] Value function cleared for key '{refinement_key}'")
except Exception as e:
print(f"[FunPackVideoRefinerV2] Value function cleanup failed: {e}")
if reset_session or not os.path.exists(path):
preserved_scene_builder = None
if reset_session and os.path.exists(path):