v2 had no per-model defaults — generate_video hardcoded 30 steps/25 frames/480x832/cfg5/16fps for every model, badly wrong for e.g. LTX-2 distilled (wants 8 steps @1024x1536) or Wan2.2-TI2V (704x1280@24fps). - New SamplingDefaults dataclass + ModelCard.sampling_defaults (v2/card/specs.py), exported from v2.card. - Populated all 7 supported cards from fastvideo's InferencePreset defaults (steps/guidance/HxW/frames/fps + per-modality guidance for LTX-2.3 A/V). Negative prompts copied verbatim into v2/recipes/_prompts.py (recipe DATA, not model code -> v2-owned, no fastvideo import). - VideoGenerator stores the resolved card; generate_video applies card defaults with precedence kwargs > SamplingParam > card > generic fallback (pure _resolve_default helper, unit-tested). - test_sampling_defaults.py: per-card values + precedence (incl. empty-neg-prompt edge). CPU mini 210 pass, 2 skip.
31 lines
1000 B
Python
31 lines
1000 B
Python
"""Model Plane — the center (design_v3 §4). The (recipe, runtime) pair as a typed card."""
|
|
from __future__ import annotations
|
|
|
|
from v2._enums import Capability, ConsistencyLevel, ExecutionProfile, LoopKind, WorkUnitKind
|
|
from v2.card.instance import ModelInstance, load_card
|
|
from v2.card.specs import (
|
|
CacheContract,
|
|
CapabilityMatrix,
|
|
CardValidationError,
|
|
CheckpointManifest,
|
|
ComponentSpec,
|
|
CostModel,
|
|
DataRef,
|
|
LoopSpec,
|
|
ModelCard,
|
|
ParallelismContract,
|
|
ParitySpec,
|
|
ParityTestSpec,
|
|
PrecisionContract,
|
|
RecipeSpec,
|
|
SamplingDefaults,
|
|
)
|
|
|
|
__all__ = [
|
|
"ModelCard", "ComponentSpec", "LoopSpec", "RecipeSpec", "ParitySpec", "ParityTestSpec",
|
|
"CheckpointManifest", "CapabilityMatrix", "CostModel", "CacheContract", "SamplingDefaults",
|
|
"ParallelismContract", "PrecisionContract", "DataRef", "CardValidationError",
|
|
"ModelInstance", "load_card",
|
|
"Capability", "ConsistencyLevel", "ExecutionProfile", "LoopKind", "WorkUnitKind",
|
|
]
|