[bugfix]: fix Pika H3 Flex example inputs and docs

Remove the unsupported pipeline.preset selection from the example; the compatibility adapter rejects it before model loading. Load the last image as a PIL image because the request adapter does not do it for the stage. Document that the local Ref2VA path enforces reference counts and the 22-frame video floor, but not Pika's hosted per-clip/per-modality duration caps.
This commit is contained in:
aryan5v
2026-10-29 17:37:52 -07:00
committed by Aryan Kumar
parent dcbaed504f
commit b69b52b938
2 changed files with 16 additions and 7 deletions
+11 -5
View File
@@ -48,11 +48,17 @@ python examples/inference/basic/basic_pika_h3_flex.py --task ref2va \
--reference audio:voice.wav --prompt "the person dances to the music"
```
Ref2VA accepts up to 12 references: 9 images, 3 videos, and 3 audio. Each video
and audio reference is 2–15 s; video/audio totals are capped at 15 s per
modality. A video reference needs at least 22 decoded frames at 24 fps. At
least one image or video is required, and the Ref2VA pipeline must be selected
with `PikaH3FlexRef2VAModularPipeline` (the example does this).
Ref2VA accepts up to 12 references: 9 images, 3 videos, and 3 audio. These
counts are enforced locally, as is the rule that audio-only requests are
invalid. A video reference needs at least 22 decoded frames at 24 fps. At least
one image or video is required, and the Ref2VA pipeline must be selected with
`PikaH3FlexRef2VAModularPipeline` (the example does this).
Pika's hosted API also documents a 2–15 s limit per video/audio reference and a
15 s total per modality. **The local path does not currently enforce those
duration caps**; it trims each reference to the requested output duration. Treat
the per-reference and per-modality limits as recommendations until the checks
are added.
## Canvas and frames
@@ -45,6 +45,7 @@ from fastvideo.api import (
PipelineSelection,
SamplingConfig,
)
from fastvideo.models.vision_utils import load_image
from fastvideo.pipelines.basic.minimax_h3 import MiniMaxH3Reference
# Training-free switches FastVideo already exposes. Workers inherit the
@@ -106,7 +107,10 @@ def parse_args() -> argparse.Namespace:
def _inputs(args: argparse.Namespace) -> InputConfig:
if args.task == "ref2va":
return InputConfig(references=args.reference)
return InputConfig(image_path=args.image, last_image=args.last_image)
# The request adapter copies image fields verbatim; the stage loads
# ``image_path`` itself but requires ``last_image`` to already be a PIL image.
last_image = load_image(args.last_image) if args.last_image else None
return InputConfig(image_path=args.image, last_image=last_image)
def _pipeline(args: argparse.Namespace) -> PipelineSelection:
@@ -115,7 +119,6 @@ def _pipeline(args: argparse.Namespace) -> PipelineSelection:
components.override_pipeline_cls_name = "PikaH3FlexRef2VAModularPipeline"
return PipelineSelection(
workload_type="t2v" if args.task == "t2va" else "i2v",
preset=f"pika_h3_flex_{args.task}",
components=components,
vae_tiling=True,
)