From a224c577b08109083d68e21b2a1c56319ff24ab5 Mon Sep 17 00:00:00 2001 From: Aryan Kumar Date: Thu, 29 Oct 2026 22:13:55 -0700 Subject: [PATCH] [feat]: Pika H3 Flex Ref2VA coverage rows from the OmniRef v4 sources Re-encode references and Qwen3-VL conditioning with Flex's tier sizing (1024 short edge below 768p) and add audio-reference, mixed image+video, 6-9 image and two-video rows, reusing the v4 target latents. --- .../train/models/test_pika_h3_flex_qad.py | 66 +++ .../build_flex_ref2va_rows.py | 445 ++++++++++++++++++ 2 files changed, 511 insertions(+) create mode 100644 scripts/distill/pika_h3_flex_qad/build_flex_ref2va_rows.py diff --git a/fastvideo/tests/train/models/test_pika_h3_flex_qad.py b/fastvideo/tests/train/models/test_pika_h3_flex_qad.py index 1de5e0843..aa6bf4231 100644 --- a/fastvideo/tests/train/models/test_pika_h3_flex_qad.py +++ b/fastvideo/tests/train/models/test_pika_h3_flex_qad.py @@ -255,3 +255,69 @@ def test_calibration_choice_all_tokens_or_balanced(): assert report["b0.ff.fc_in"]["best"] == "0.5x_max" table, _ = calibrate.choose_table(mse, candidates, "all") assert table == {"b0.ff.fc_in": 10.0} + + +def _builder_module(): + path = Path(__file__).resolve().parents[4] / "scripts/distill/pika_h3_flex_qad/build_flex_ref2va_rows.py" + spec = importlib.util.spec_from_file_location("build_flex_ref2va_rows", path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +_PROMPT = "subject_definitions: is the exact first frame of the target video.\n\nsummary: A dog runs." + + +def _v4_entry(case: str, refs: list[dict], clip: str = "asset-" + "a" * 32 + "_f000001_f000124_x") -> dict: + return { + "case": case, + "id": f"{case}:{clip}" if case in ("first_frame", "first_last_frame", "storyboard") else clip, + "resolution": "480p", + "prompt": _PROMPT, + "references": refs, + "target": {"height": 480, "width": 832, "num_frames": 124}, + "target_clip_id": clip, + } + + +def test_builder_adds_subject_definitions_in_order(): + builder = _builder_module() + after = builder._subject(_PROMPT, "