Add Model Port Generic
Goal
Prototype or parity-debug one scheduler, conditioner, upsampler, vocoder,
adapter, preprocessor, or unknown component in FastVideo-native code.
Inputs
Follow ../add-model/shared/component_skill_common.md and require the complete
packet from ../add-model/contracts/component_context.md.
Generic-component packet fields:
component: component name.
component_type: scheduler, conditioner, upsampler, vocoder, adapter,
preprocessor, or unknown.
parity_test: tests/local_tests/<bucket>/test_<family>_<component>_parity.py.
weights: converted component dir, HF subfolder, or none.
target_files: matching fastvideo/models/ and fastvideo/configs/models/
bucket files when applicable.
Modes
Use the common prototype and parity-debug modes from
../add-model/shared/component_skill_common.md.
Generic-component prototype concerns include stateless/stateful ambiguity,
missing loader buckets, source prefixes, mutable scheduler state, and output
container shape.
Reuse Proof
Apply the shared reuse proof. Generic-component comparison must include mutable
state, scaling constants, scheduler/conditioner semantics, output containers, and
whether the component owns state or is stateless.
Existing FastVideo Patterns
- Schedulers live under
fastvideo/models/schedulers/ and expose EntryClass.
- Upsamplers use
fastvideo/models/upsamplers/ plus configs under
fastvideo/configs/models/upsamplers/; see hunyuan15.py.
- Vocoders and audio-specific modules can live under
fastvideo/models/audio/
with configs under fastvideo/configs/models/audio/; see ltx2_audio_vae.py.
- Compound conditioners may fit the encoder bucket when the pipeline loader uses
ConditionerLoader; see stable_audio_conditioner.py.
- Registry discovery uses
EntryClass; config bucket exports are required when
pipeline configs import them by bucket.
- Use the narrowest matching config bucket. Wrong bucket inheritance can typecheck
but fail during pipeline wiring.
- Layer guidance:
fastvideo/layers/AGENTS.md.
Bucket Decision
- If the component is a transformer/DiT, stop and use
add-model-03-port-dit.
- If the component is a VAE/autoencoder, stop and use
add-model-04-port-vae.
- If the component is a text/image/audio encoder or encoder-like conditioner,
stop and use
add-model-05-port-encoder unless the loader requires a different
bucket.
- Otherwise choose the narrowest existing bucket. Add a new bucket only when no
existing loader/config shape can represent the component without misleading
names or unsafe runtime behavior.
Implementation Rules
- Match official behavior, not just shapes: constructor args, default values,
runtime flags, RNG use, dtype/autocast, scaling constants, masks, and output
containers all matter.
- Keep the implementation minimal and native. Do not keep a runtime import of
the official implementation as the production component.
- For schedulers, compare timesteps, sigmas/noise levels, step outputs, shift
handling, prediction type, and any mutable internal state.
- For upsamplers, compare resize mode, align_corners, residual branches,
causal padding, normalization, and exact target-shape behavior.
- For vocoders/audio components, compare waveform shape, sample-rate contract,
channel order, hop length, normalization, and dtype.
- If private upstream deps are required only for tests, keep stubs under
tests/local_tests/helpers/ and do not import them from production code.
Prototype Checks
Follow the shared prototype success criteria.
Parity-Debug Loop
Run the shared parity-debug loop. The component test command is:
pytest <parity_test> -v -s
For numerical drift, add targeted intermediate comparisons in the test to
identify the first divergent operation.
Escape Hatches
Follow ../add-model/shared/common_rules.md and the component-specific guidance
in ../add-model/shared/component_skill_common.md. Generic-component ask cases
include creating a new loader bucket, accepting an unsupported private op,
choosing between incompatible official definitions, or dropping a required
component.
Handoff
Return ../add-model/contracts/component_skill_handoff.md following the common
handoff rules in ../add-model/shared/component_skill_common.md.
1---2name: add-model-06-port-generic3description: Use during /add-model Phase 4 or Phase 6 to prototype or parity-debug one non-DiT, non-VAE, non-encoder FastVideo component.4---56# Add Model Port Generic78## Goal910Prototype or parity-debug one scheduler, conditioner, upsampler, vocoder,11adapter, preprocessor, or unknown component in FastVideo-native code.1213## Inputs1415Follow `../add-model/shared/component_skill_common.md` and require the complete16packet from `../add-model/contracts/component_context.md`.1718Generic-component packet fields:1920- `component`: component name.21- `component_type`: scheduler, conditioner, upsampler, vocoder, adapter,22 preprocessor, or unknown.23- `parity_test`: `tests/local_tests/<bucket>/test_<family>_<component>_parity.py`.24- `weights`: converted component dir, HF subfolder, or none.25- `target_files`: matching `fastvideo/models/` and `fastvideo/configs/models/`26 bucket files when applicable.2728## Modes2930Use the common prototype and parity-debug modes from31`../add-model/shared/component_skill_common.md`.3233Generic-component prototype concerns include stateless/stateful ambiguity,34missing loader buckets, source prefixes, mutable scheduler state, and output35container shape.3637## Reuse Proof3839Apply the shared reuse proof. Generic-component comparison must include mutable40state, scaling constants, scheduler/conditioner semantics, output containers, and41whether the component owns state or is stateless.4243## Existing FastVideo Patterns4445- Schedulers live under `fastvideo/models/schedulers/` and expose `EntryClass`.46- Upsamplers use `fastvideo/models/upsamplers/` plus configs under47 `fastvideo/configs/models/upsamplers/`; see `hunyuan15.py`.48- Vocoders and audio-specific modules can live under `fastvideo/models/audio/`49 with configs under `fastvideo/configs/models/audio/`; see `ltx2_audio_vae.py`.50- Compound conditioners may fit the encoder bucket when the pipeline loader uses51 `ConditionerLoader`; see `stable_audio_conditioner.py`.52- Registry discovery uses `EntryClass`; config bucket exports are required when53 pipeline configs import them by bucket.54- Use the narrowest matching config bucket. Wrong bucket inheritance can typecheck55 but fail during pipeline wiring.56- Layer guidance: `fastvideo/layers/AGENTS.md`.5758## Bucket Decision5960- If the component is a transformer/DiT, stop and use `add-model-03-port-dit`.61- If the component is a VAE/autoencoder, stop and use `add-model-04-port-vae`.62- If the component is a text/image/audio encoder or encoder-like conditioner,63 stop and use `add-model-05-port-encoder` unless the loader requires a different64 bucket.65- Otherwise choose the narrowest existing bucket. Add a new bucket only when no66 existing loader/config shape can represent the component without misleading67 names or unsafe runtime behavior.6869## Implementation Rules7071- Match official behavior, not just shapes: constructor args, default values,72 runtime flags, RNG use, dtype/autocast, scaling constants, masks, and output73 containers all matter.74- Keep the implementation minimal and native. Do not keep a runtime import of75 the official implementation as the production component.76- For schedulers, compare timesteps, sigmas/noise levels, step outputs, shift77 handling, prediction type, and any mutable internal state.78- For upsamplers, compare resize mode, align_corners, residual branches,79 causal padding, normalization, and exact target-shape behavior.80- For vocoders/audio components, compare waveform shape, sample-rate contract,81 channel order, hop length, normalization, and dtype.82- If private upstream deps are required only for tests, keep stubs under83 `tests/local_tests/helpers/` and do not import them from production code.8485## Prototype Checks8687Follow the shared prototype success criteria.8889## Parity-Debug Loop9091Run the shared parity-debug loop. The component test command is:9293```bash94pytest <parity_test> -v -s95```9697For numerical drift, add targeted intermediate comparisons in the test to98identify the first divergent operation.99100## Escape Hatches101102Follow `../add-model/shared/common_rules.md` and the component-specific guidance103in `../add-model/shared/component_skill_common.md`. Generic-component ask cases104include creating a new loader bucket, accepting an unsupported private op,105choosing between incompatible official definitions, or dropping a required106component.107108## Handoff109110Return `../add-model/contracts/component_skill_handoff.md` following the common111handoff rules in `../add-model/shared/component_skill_common.md`.