stable_audio_conditioner ¶
Stable Audio Open 1.0 conditioner.
T5-base text encoder + two NumberConditioners (seconds_start, seconds_total), wrapped by StableAudioMultiConditioner which produces the cross-attention and global-conditioning tensors the DiT expects.
Classes¶
fastvideo.models.encoders.stable_audio_conditioner.NumberConditioner ¶
Bases: _Conditioner
Float-valued conditioner with min/max clamping + NumberEmbedder.
Source code in fastvideo/models/encoders/stable_audio_conditioner.py
fastvideo.models.encoders.stable_audio_conditioner.StableAudioMultiConditioner ¶
Bases: Module
SA-Open-1.0 conditioner: T5 prompt + duration NumberConditioners.
All hardcoded constants (cond_dim, sub-conditioner ids, T5 model name + max_length, NumberConditioner ranges) live on StableAudioConditionerConfig — see fastvideo/configs/models/encoders/stable_audio_conditioner.py.
Source code in fastvideo/models/encoders/stable_audio_conditioner.py
Methods:¶
fastvideo.models.encoders.stable_audio_conditioner.StableAudioMultiConditioner.from_official_state_dict classmethod ¶
from_official_state_dict(state_dict: dict[str, Tensor], prefix: str = 'conditioner.') -> 'StableAudioMultiConditioner'
Load NumberConditioner weights from a raw stable_audio_tools monolithic state dict. Kept for tests / older checkpoints; production loads go through the standard ConditionerLoader against the converted Diffusers repo.
Source code in fastvideo/models/encoders/stable_audio_conditioner.py
fastvideo.models.encoders.stable_audio_conditioner.StableAudioMultiConditioner.get_conditioning_inputs ¶
Pack conditioner outputs into the (cross_attn_cond, cross_attn_mask, global_embed) triple the DiT consumes. Order is driven by cross_attention_cond_ids / global_cond_ids from the config — SA-1.0 uses three sub-conditioners (prompt + seconds_start + seconds_total); SA-small uses two (prompt + seconds_total).
Source code in fastvideo/models/encoders/stable_audio_conditioner.py
fastvideo.models.encoders.stable_audio_conditioner.T5Conditioner ¶
T5Conditioner(output_dim: int, t5_model_name: str = 't5-base', max_length: int = 128, dtype: str = 'float16')
Bases: _Conditioner
T5 text conditioner. Pads to model_max_length (=128 for the SA repo's tokenizer, NOT the standard 512) and emits a masked last-hidden-state.