From 65816e353a640d4cf78717bbfa6a245add0b3e4c Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Mon, 15 Jun 2026 17:15:28 +0300 Subject: [PATCH] Stage 2 (1/3): remove the prompt-repair application + param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neutralize the repair application in refine(): the intent-aligned prompt is encoded as-is — perfect-repair phrase injection, missing-axis repair, and the emphasis pass are gone. The advisor remains the only prompt-rewriting path, and repair_feedback/active_repair_axes is KEPT (it's the 'what's missing' signal the advisor still reads). Drop the prompt_repair param from refine(), INPUT_TYPES, FunPackStudio, and both UIs (web + engine_settings). The dead repair-only methods (_v2_repair_prompt_for_missing_axes, perfect-repair phrases, etc.) come out in the next commit; shared helpers like _v2_repair_intent_roots (used by intent alignment) stay. Deleted the now-obsolete test_repair_candidates_saved_as_json_lists (tested the removed injection). No new test failures vs dev. Co-Authored-By: Claude Opus 4.8 --- conditioning.py | 51 +++++------------------- movie_editor/frontend/engine_settings.js | 1 - tests/test_v2_category_alignment.py | 23 ----------- web/funpack_studio.js | 6 +-- 4 files changed, 11 insertions(+), 70 deletions(-) diff --git a/conditioning.py b/conditioning.py index 3a1e5cc8..08cd60f4 100644 --- a/conditioning.py +++ b/conditioning.py @@ -6379,11 +6379,6 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): "label": "I'm Feeling Lucky", "tooltip": "Compose a learned prompt from V2 phrase memory, then encode it through the connected CLIP.", }), - "prompt_repair": ("BOOLEAN", { - "default": True, - "label": "Prompt Repair", - "tooltip": "Allow V2 to append learned phrases for missing axes. Disable when not enough context has been built yet or when memory suggestions are disrupting the generation.", - }), "advisor_thinking": ("BOOLEAN", { "default": True, "label": "Advisor Thinking", @@ -11981,7 +11976,7 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): reset_session=False, lora_stack=None, im_feeling_lucky=False, user_intent_prompt="", refinement_key_input="", positive_conditioning=None, clip_vision_output=None, source_image=None, model=None, mode="Refine", advisor_mode="Off", advisor_thinking=True, - advisor_clip=None, feedback_prompt="", prompt_repair=True, temporal_style="natural", + advisor_clip=None, feedback_prompt="", temporal_style="natural", split_by_transitions=False, split_transition_placement="start", reference_injection=False, value_guidance=True, latent=None, seed_output_connected=False, steer_mode="relative", absolute_strength=0.6, @@ -12313,40 +12308,16 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): intent_phrases, global_state, ) - if prompt_repair: - aligned_prompt, perfect_repair_status, perfect_repair_adjustments = self._v2_apply_perfect_repair_phrases( - aligned_prompt, - current_family_slot, - intent_prompt=intent_source_prompt, - intent_phrases=intent_phrases, - clip=clip, - encode_cache=encode_cache, - ) - prompt_to_encode, emphasis_status = self._v2_emphasized_prompt( - aligned_prompt, - phrases, - global_state, - {**learning_profile, "missing_axes": repair_feedback.get("missing_axes", [])}, - ) - else: - perfect_repair_status = "Perfect repairs: disabled." - perfect_repair_adjustments = [] - prompt_to_encode = aligned_prompt - emphasis_status = "Prompt emphasis: disabled." + # Prompt repair removed (Stage 2). The intent-aligned prompt is encoded as-is; the only + # remaining prompt-rewriting path is the advisor (when enabled). Perfect-repair phrase + # injection, missing-axis repair, and the emphasis pass are gone. repair_feedback / + # active_repair_axes is KEPT — it's the "what's missing" signal the advisor still reads. + perfect_repair_status = "Perfect repairs: removed." + perfect_repair_adjustments = [] + prompt_to_encode = aligned_prompt + emphasis_status = "Prompt emphasis: removed." advisor_active = advisor_mode != "Off" - if prompt_repair: - prompt_to_encode, repair_status, repair_candidates = self._v2_repair_prompt_for_missing_axes( - prompt_to_encode, - phrases, - global_state, - previous_run, - repair_feedback, - intent_phrases=intent_phrases, - intent_family_slot=current_family_slot, - apply=not advisor_active, - ) - else: - repair_status = "Prompt repair: disabled." + repair_status = "Prompt repair: removed." prompt_to_encode, wildcard_status = self._v2_resolve_scene_builder_wildcards( prompt_to_encode, scene_db, @@ -14529,7 +14500,6 @@ class FunPackStudio: mode = str(rf.get("mode", "Refine") or "Refine") advisor_mode = str(rf.get("advisor_mode", "Off") or "Off") advisor_thinking = bool(rf.get("advisor_thinking", True)) - prompt_repair = bool(rf.get("prompt_repair", True)) im_feeling_lucky = bool(rf.get("im_feeling_lucky", False)) reset_session = bool(rf.get("reset_session", False)) temporal_style = str(rf.get("temporal_style", "natural") or "natural").strip().lower() @@ -14688,7 +14658,6 @@ class FunPackStudio: advisor_thinking=advisor_thinking, advisor_clip=advisor_clip, feedback_prompt=feedback_prompt, - prompt_repair=prompt_repair, temporal_style=temporal_style, split_by_transitions=split_by_transitions, split_transition_placement=split_transition_placement, diff --git a/movie_editor/frontend/engine_settings.js b/movie_editor/frontend/engine_settings.js index 1e67afd9..5e2bd903 100644 --- a/movie_editor/frontend/engine_settings.js +++ b/movie_editor/frontend/engine_settings.js @@ -66,7 +66,6 @@ const STUDIO_REFINER_ESSENTIALS = [ { name: "vision_conditioning", label: "Vision conditioning", default: true }, { name: "reference_injection", label: "Reference injection", default: false }, - { name: "prompt_repair", label: "Prompt repair", default: false }, ]; const STUDIO_REFINER_ADVANCED = [ { name: "value_guidance", label: "Value guidance", kind: "bool", default: true }, diff --git a/tests/test_v2_category_alignment.py b/tests/test_v2_category_alignment.py index 5e2db24f..31ee5e6b 100644 --- a/tests/test_v2_category_alignment.py +++ b/tests/test_v2_category_alignment.py @@ -2177,29 +2177,6 @@ def test_phrase_clusters_train_more_strongly_than_ngrams_and_tokens(): assert phrase_score > ngram_score > token_score -def test_repair_candidates_saved_as_json_lists(tmp_path): - refiner = FunPackVideoRefinerV2() - state_path = tmp_path / "state.json" - refiner._v2_state_path = lambda refinement_key: str(state_path) - rich_prompt = "woman, walking, reaching hand, tiny particles, rain reflections" - - refiner.refine_v2(rich_prompt, FakeClip(), "Perfect", "json-repair-test") - refiner.refine_v2(rich_prompt, FakeClip(), "Perfect", "json-repair-test") - refiner.refine_v2( - "woman, rain", - FakeClip(), - "Missing details + action", - "json-repair-test", - user_intent_prompt=rich_prompt, - ) - - state = json.loads(state_path.read_text(encoding="utf-8")) - candidates = state["last_run"]["repair_candidates"] - assert candidates - assert isinstance(candidates[0]["axes"], list) - assert "walking" in state["last_run"]["encoded_prompt"] - - def test_wrong_action_rating_preserves_quality_but_marks_action_wrong(): refiner = FunPackVideoRefinerV2() global_state = {"phrase_memory": {}, "preferred_context_memory": {}} diff --git a/web/funpack_studio.js b/web/funpack_studio.js index e02e56f6..9c24a325 100644 --- a/web/funpack_studio.js +++ b/web/funpack_studio.js @@ -69,7 +69,7 @@ function defaultSettings() { refinement_key: "", overrides: { refinement_key: false, feedback_prompt: false, user_intent_prompt: false, negative_prompt: false }, scene_builder: { mode: "Pass-through", scene: NONE_SENTINEL, scene_name: "", aliases: "", scene_positive: "", scene_negative: "" }, - refiner: { mode: "Refine", advisor_mode: "Off", advisor_thinking: true, prompt_repair: true, im_feeling_lucky: false, reset_session: false, feedback_prompt: "", user_intent_prompt_override: "", negative_prompt: "", temporal_style: "natural", split_by_transitions: false, split_transition_placement: "start", reference_injection: false, vision_conditioning: true, value_guidance: true, steer_mode: "relative", absolute_strength: 0.6 }, + refiner: { mode: "Refine", advisor_mode: "Off", advisor_thinking: true, im_feeling_lucky: false, reset_session: false, feedback_prompt: "", user_intent_prompt_override: "", negative_prompt: "", temporal_style: "natural", split_by_transitions: false, split_transition_placement: "start", reference_injection: false, vision_conditioning: true, value_guidance: true, steer_mode: "relative", absolute_strength: 0.6 }, advisor_llm: { enabled: false, model_path: "huihui-ai/Huihui-Qwen3-8B-abliterated-v2", dtype: "bfloat16" }, loras: [], loras_config: { mode: "ltx2", per_block: false }, @@ -1188,10 +1188,6 @@ function openPanel(node) { thinkToggle.inp.addEventListener("change", () => { settings.refiner.advisor_thinking = thinkToggle.inp.checked; }); body.append(row("Thinking", thinkToggle.wrap)); - const repairToggle = toggleEl(settings.refiner.prompt_repair, "Prompt repair"); - repairToggle.inp.addEventListener("change", () => { settings.refiner.prompt_repair = repairToggle.inp.checked; }); - body.append(row("Prompt repair", repairToggle.wrap)); - const luckyToggle = toggleEl(settings.refiner.im_feeling_lucky, "I'm Feeling Lucky"); luckyToggle.inp.addEventListener("change", () => { settings.refiner.im_feeling_lucky = luckyToggle.inp.checked; }); body.append(row("Lucky", luckyToggle.wrap));