Skip to content
FastVideo
Esc
↑↓navigate↵open⌘Jpreview
On this page

stable_audio

PipelineConfig for Stable Audio Open 1.0.

fastvideo.configs.pipelines.stable_audio.DiTConfig

DiTConfig(arch_config: DiTArchConfig = DiTArchConfig(), prefix: str = '', quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)

fastvideo.configs.pipelines.stable_audio.DiTConfig.add_cli_args

add_cli_args(parser: Any, prefix: str = 'dit-config') -> Any

Add CLI arguments for DiTConfig fields

fastvideo.configs.pipelines.stable_audio.VAEConfig

VAEConfig(arch_config: VAEArchConfig = VAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = True, use_temporal_tiling: bool = True, use_parallel_tiling: bool = True, use_temporal_scaling_frames: bool = True, *, _resolved_attention_backend: AttentionBackendEnum | None = None)

fastvideo.configs.pipelines.stable_audio.VAEConfig.add_cli_args

add_cli_args(parser: Any, prefix: str = 'vae-config') -> Any

Add CLI arguments for VAEConfig fields

fastvideo.configs.pipelines.stable_audio.VAEConfig.from_cli_args

from_cli_args(args: argparse.Namespace) -> VAEConfig

fastvideo.configs.pipelines.stable_audio.StableAudioConfig

StableAudioConfig(arch_config: DiTArchConfig = StableAudioArchConfig(), prefix: str = 'StableAudio', quant_config: QuantizationConfig | None = None, *, _resolved_attention_backend: AttentionBackendEnum | None = None)

fastvideo.configs.pipelines.stable_audio.OobleckVAEConfig

OobleckVAEConfig(arch_config: VAEArchConfig = OobleckVAEArchConfig(), load_encoder: bool = True, load_decoder: bool = True, tile_sample_min_height: int = 256, tile_sample_min_width: int = 256, tile_sample_min_num_frames: int = 16, tile_sample_stride_height: int = 192, tile_sample_stride_width: int = 192, tile_sample_stride_num_frames: int = 12, blend_num_frames: int = 0, use_tiling: bool = False, use_temporal_tiling: bool = False, use_parallel_tiling: bool = False, use_temporal_scaling_frames: bool = True, pretrained_path: str = 'stabilityai/stable-audio-open-1.0', pretrained_subfolder: str = 'vae', pretrained_dtype: str = 'float16', *, _resolved_attention_backend: AttentionBackendEnum | None = None)

FastVideo VAE config wrapping the Oobleck arch.

Audio VAEs don't use the temporal/spatial tiling defaults that the base VAEConfig is shaped for (those exist for video VAEs); they are retained but irrelevant for audio.

fastvideo.configs.pipelines.stable_audio.PipelineConfig

PipelineConfig(model_path: str = '', pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = DiTConfig(), dit_precision: str = 'bf16', upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = 'fp32', vae_config: VAEConfig = VAEConfig(), vae_precision: str = 'fp32', vae_decode_precision: str | None = None, vae_tiling: bool = True, vae_sp: bool = True, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = 'fp32', image_encoder_configs: tuple[EncoderConfig, ...] | None = None, image_encoder_precisions: tuple[str, ...] | None = None, text_encoder_configs: tuple[EncoderConfig, ...] = (lambda: (EncoderConfig(),))(), text_encoder_precisions: tuple[str, ...] = (lambda: ('fp32',))(), preprocess_text_funcs: tuple[Callable[[str], str], ...] = (lambda: (preprocess_text,))(), postprocess_text_funcs: tuple[Callable[[BaseEncoderOutput], torch.tensor], ...] = (lambda: (postprocess_text,))(), dmd_denoising_steps: list[int] | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None)

Base configuration for all pipeline architectures.

fastvideo.configs.pipelines.stable_audio.PipelineConfig.add_cli_args

add_cli_args(parser: FlexibleArgumentParser, prefix: str = '') -> FlexibleArgumentParser

fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_config_from_dict

update_config_from_dict(args: dict[str, Any], prefix: str = '') -> None

fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_pretrained

from_pretrained(model_path: str) -> PipelineConfig

use the pipeline class setting from model_path to match the pipeline config

fastvideo.configs.pipelines.stable_audio.PipelineConfig.from_kwargs

from_kwargs(kwargs: dict[str, Any], config_cli_prefix: str = '') -> PipelineConfig

Load PipelineConfig from kwargs Dictionary. kwargs: dictionary of kwargs config_cli_prefix: prefix of CLI arguments for this PipelineConfig instance

fastvideo.configs.pipelines.stable_audio.PipelineConfig.check_pipeline_config

check_pipeline_config() -> None

fastvideo.configs.pipelines.stable_audio.PipelineConfig.resolve_checkpoint_settings

resolve_checkpoint_settings(fastvideo_args: FastVideoArgs) -> None

Apply the run settings that the checkpoint at fastvideo_args.model_path fixes.

FastVideoArgs.__post_init__ calls this once in the main process, before argument validation and before any weights load. Most checkpoints fix no run settings, so the base implementation does nothing.

fastvideo.configs.pipelines.stable_audio.PipelineConfig.apply_request_constraints

apply_request_constraints(request: GenerationRequest, sampling_param: SamplingParam) -> SamplingParam

Apply this model's constraints on a generation request to its sampling parameters.

sampling_param holds the preset defaults with the request's explicit fields applied. A model sets the values it fixes when the request leaves them unset, and raises when the request sets a value it does not accept. The base PipelineConfig accepts every request unchanged.

fastvideo.configs.pipelines.stable_audio.PipelineConfig.dump_to_json

dump_to_json(file_path: str)

fastvideo.configs.pipelines.stable_audio.PipelineConfig.load_from_json

load_from_json(file_path: str)

fastvideo.configs.pipelines.stable_audio.PipelineConfig.update_pipeline_config

update_pipeline_config(source_pipeline_dict: dict[str, Any]) -> None

fastvideo.configs.pipelines.stable_audio.StableAudioT2AConfig

StableAudioT2AConfig(model_path: str = '', pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = StableAudioConfig(), dit_precision: str = 'fp16', upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = 'fp32', vae_config: VAEConfig = OobleckVAEConfig(), vae_precision: str = 'fp16', vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = 'fp32', image_encoder_configs: tuple[EncoderConfig, ...] | None = None, image_encoder_precisions: tuple[str, ...] | None = None, text_encoder_configs: tuple = tuple(), text_encoder_precisions: tuple[str, ...] = tuple(), preprocess_text_funcs: tuple = tuple(), postprocess_text_funcs: tuple = tuple(), dmd_denoising_steps: list[int] | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, num_inference_steps: int = 100, guidance_scale: float = 7.0, audio_end_in_s: float = 10.0, audio_start_in_s: float = 0.0, sampling_rate: int = 44100, audio_channels: int = 2, sample_size: int = 2097152, max_audio_duration_s: float = 2097152 / 44100, precision: str = 'fp16')

Stable Audio Open 1.0 pipeline config.

Source
@dataclass
class StableAudioT2AConfig(PipelineConfig):
    """Stable Audio Open 1.0 pipeline config."""
dit_config: DiTConfig = field(default_factory=StableAudioConfig)
# Standard `TransformerLoader` reads `dit_precision`; default in
# `PipelineConfig` is bf16, but we want fp16 to match official.
dit_precision: str = "fp16"

vae_config: VAEConfig = field(default_factory=OobleckVAEConfig)
vae_tiling: bool = False
vae_sp: bool = False

# `StableAudioMultiConditioner` owns its own T5; zero out the
# parent's text-encoder slots so the length-equality validator passes.
text_encoder_configs: tuple = field(default_factory=tuple)
preprocess_text_funcs: tuple = field(default_factory=tuple)
postprocess_text_funcs: tuple = field(default_factory=tuple)

num_inference_steps: int = 100
guidance_scale: float = 7.0
audio_end_in_s: float = 10.0  # short-clip default
audio_start_in_s: float = 0.0
sampling_rate: int = 44100
audio_channels: int = 2
# Stable Audio Open 1.0 was trained at a fixed 2,097,152-sample
# window (= 2097152 / 44100 ≈ 47.55s). Anything past this is
# silently truncated by the post-decode slice — validate up-front.
sample_size: int = 2097152
max_audio_duration_s: float = 2097152 / 44100

# Match the official `stable_audio_tools` defaults (`model_half=True`
# in `run_gradio.py`), which loads the DiT, VAE, and T5 in fp16 and
# wraps T5 forward in `autocast(fp16)`. fp16 is also a hard
# requirement for FlashAttention-2 / FA-3.
precision: str = "fp16"
vae_precision: str = "fp16"
text_encoder_precisions: tuple[str, ...] = field(default_factory=tuple)

def __post_init__(self) -> None:
    # A2A needs encode; load both halves for either path.
    self.vae_config.load_encoder = True
    self.vae_config.load_decoder = True</code></pre></details>

fastvideo.configs.pipelines.stable_audio.StableAudioOpenSmallConfig

StableAudioOpenSmallConfig(model_path: str = '', pipeline_config_path: str | None = None, embedded_cfg_scale: float = 6.0, flow_shift: float | None = None, flow_shift_sr: float | None = None, disable_autocast: bool = False, scheduler_step_in_fp32: bool = False, is_causal: bool = False, dit_config: DiTConfig = StableAudioConfig(), dit_precision: str = 'fp16', upsampler_config: UpsamplerConfig = UpsamplerConfig(), upsampler_precision: str = 'fp32', vae_config: VAEConfig = OobleckVAEConfig(), vae_precision: str = 'fp16', vae_decode_precision: str | None = None, vae_tiling: bool = False, vae_sp: bool = False, image_encoder_config: EncoderConfig = EncoderConfig(), image_encoder_precision: str = 'fp32', image_encoder_configs: tuple[EncoderConfig, ...] | None = None, image_encoder_precisions: tuple[str, ...] | None = None, text_encoder_configs: tuple = tuple(), text_encoder_precisions: tuple[str, ...] = tuple(), preprocess_text_funcs: tuple = tuple(), postprocess_text_funcs: tuple = tuple(), dmd_denoising_steps: list[int] | None = None, ti2v_task: bool = False, lucy_edit_task: bool = False, boundary_ratio: float | None = None, num_inference_steps: int = 100, guidance_scale: float = 7.0, audio_end_in_s: float = 6.0, audio_start_in_s: float = 0.0, sampling_rate: int = 44100, audio_channels: int = 2, sample_size: int = 524288, max_audio_duration_s: float = 524288 / 44100, precision: str = 'fp16')

stable-audio-open-small overrides: shorter training window (524288 samples ≈ 11.89s @ 44.1 kHz) and a faster default sampler config carried by the small preset.

Source
@dataclass
class StableAudioOpenSmallConfig(StableAudioT2AConfig):
    """`stable-audio-open-small` overrides: shorter training window
    (524288 samples ≈ 11.89s @ 44.1 kHz) and a faster default sampler
    config carried by the small preset.
    """
sample_size: int = 524288
max_audio_duration_s: float = 524288 / 44100
audio_end_in_s: float = 6.0  # short-clip default suitable for the small window</code></pre></details>

Was this page helpful?