MCPcopy Create free account

hub / github.com/Stability-AI/stable-audio-tools / functions

Functions1,182 in github.com/Stability-AI/stable-audio-tools

↓ 74 callersMethodsum
(x)
stable_audio_tools/training/losses/auraloss.py:99
↓ 52 callersMethodlog
Accumulate *log_dict* and flush every *every_n_steps* calls. NaN/inf values are handled at flush time: if an accumulated sum is non-f
stable_audio_tools/training/utils.py:205
↓ 44 callersMethodupdate
(self)
stable_audio_tools/training/ema.py:136
↓ 37 callersMethodencode
(self, wave: Tensor)
stable_audio_tools/models/adp.py:1506
↓ 32 callersFunctionexists
(val: Optional[T])
stable_audio_tools/models/adp.py:42
↓ 29 callersMethoddecode
(self, stft_a: Tensor, stft_b: Tensor)
stable_audio_tools/models/adp.py:1530
↓ 29 callersMethodsigma
(self, t)
stable_audio_tools/inference/k_diffusion/sampling.py:233
↓ 27 callersMethod__init__
(self, period, channels=1)
stable_audio_tools/models/discriminators.py:513
↓ 23 callersMethod__init__
( self, num_fft: int = 1023, hop_length: int = 256, window_length: Optional[in
stable_audio_tools/models/adp.py:1490
↓ 20 callersMethodload_state_dict
(self, state_dict, strict=True)
stable_audio_tools/models/pretransforms.py:115
↓ 18 callersFunctionaudio_spectrogram_image
Wrapper for calling above two routines at once, does Mel scale; Modified from PyTorch tutorial https://pytorch.org/tutorials/beginner/audio_feature_ex
stable_audio_tools/interface/aeiou.py:254
↓ 18 callersFunctionlog_image
(logger, key, img_data, step=None)
stable_audio_tools/training/utils.py:130
↓ 17 callersFunctioncreate_model_from_config
(model_config)
stable_audio_tools/models/factory.py:3
↓ 16 callersFunctionWNConv1d
(*args, **kwargs)
stable_audio_tools/models/autoencoders.py:25
↓ 16 callersMethod__init__
(self)
stable_audio_tools/models/autoencoders.py:103
↓ 16 callersMethodexpand
(self, x: Any, shape: Tuple[int, ...])
stable_audio_tools/models/adp.py:1394
↓ 16 callersFunctionload_ckpt_state_dict
(ckpt_path)
stable_audio_tools/models/utils.py:26
↓ 15 callersMethod__init__
( self, dim: int, output_dim: int, project_out: bool = False,
stable_audio_tools/models/conditioners.py:32
↓ 15 callersMethodget_conditioning_inputs
(self, cond: tp.Dict[str, tp.Any], negative=False)
stable_audio_tools/models/lm.py:184
↓ 15 callersMethodmodel
(self)
stable_audio_tools/training/ema.py:101
↓ 15 callersFunctionvprint
(*args, **kwargs)
stable_audio_tools/verbose.py:19
↓ 14 callersMethod__init__
( self, dim_in, dim_out, activation: Callable, use_conv = False,
stable_audio_tools/models/transformer.py:420
↓ 14 callersFunctionlog_audio
(logger, key, audio_path, sample_rate, caption=None, step=None)
stable_audio_tools/training/utils.py:124
↓ 13 callersMethod__init__
(self, shape, fix_scale = False, eps=1e-6)
stable_audio_tools/models/blocks.py:360
↓ 13 callersMethodstft
Perform STFT. Args: x (Tensor): Input signal tensor (B, T). Returns: Tensor: x_mag, x_phs Mag
stable_audio_tools/training/losses/auraloss.py:471
↓ 12 callersMethod__init__
(self, is_discrete: bool = False)
stable_audio_tools/models/bottleneck.py:15
↓ 12 callersMethodloss
(self, x)
stable_audio_tools/models/discriminators.py:90
↓ 12 callersFunctionsample_diffusion
Unified sampling function for diffusion models. Handles all diffusion objectives, varlen support (padding_mask + effective_seq_len), timestep
stable_audio_tools/inference/sampling.py:731
↓ 12 callersFunctiontrim_and_concat
Per-element trim and concatenate along time axis. Trims each batch element to its own length (from seconds_total + margin), removing trailing
stable_audio_tools/training/utils.py:161
↓ 11 callersFunctionWNConv1d
(*args, **kwargs)
stable_audio_tools/models/blocks.py:32
↓ 11 callersMethod__init__
(self)
stable_audio_tools/models/diffusion.py:22
↓ 10 callersMethod__init__
( self, fft_size: int = 1024, hop_size: int = 256, win_length: int = 1024,
stable_audio_tools/training/losses/auraloss.py:364
↓ 10 callersFunctionadd_lora
Add LoRA parametrization to layers in a model. Args: model: The model to add LoRA to. lora_config: Dict mapping nn.Module types t
stable_audio_tools/models/lora/model.py:363
↓ 10 callersFunctionresize_padding_mask
Resize a padding mask to target_length using ceiling-based length scaling. Unlike F.interpolate(mode="nearest"), this ensures any target position
stable_audio_tools/training/utils.py:250
↓ 10 callersMethodstep
( self, closure: Optional[Callable] = None )
stable_audio_tools/training/optims.py:159
↓ 9 callersFunctionWNConv1d
(*args, **kwargs)
stable_audio_tools/models/convnext.py:6
↓ 9 callersMethod__init__
(self, key_a: str, key_b: str, weight: float = 1.0, mask_key: str = None, name: str = 'l1_loss', decay = 1.0)
stable_audio_tools/training/losses/losses.py:50
↓ 9 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/training/clap.py:30
↓ 9 callersFunctioncreate_optimizer_from_config
Create optimizer from config. Args: parameters (iterable): parameters to optimize. optimizer_config (dict): optimizer config.
stable_audio_tools/training/utils.py:61
↓ 9 callersFunctioncreate_scheduler_from_config
Create scheduler from config. Args: scheduler_config (dict): scheduler config. optimizer (torch.optim.Optimizer): optimizer.
stable_audio_tools/training/utils.py:94
↓ 9 callersMethodt
(self, sigma)
stable_audio_tools/inference/k_diffusion/sampling.py:230
↓ 9 callersMethodtick
(self, msg)
stable_audio_tools/training/diffusion.py:43
↓ 9 callersFunctiontokens_spectrogram_image
for visualizing embeddings in a spectrogram-like way
stable_audio_tools/interface/aeiou.py:261
↓ 8 callersMethod__init__
(self, enable_grad, io_channels, is_discrete)
stable_audio_tools/models/pretransforms.py:29
↓ 8 callersFunctioncopy_state_dict
Load state_dict to model, but only for keys that match exactly. Args: model (nn.Module): model to load state_dict. state_dict (Or
stable_audio_tools/models/utils.py:6
↓ 8 callersFunctioncreate_pretransform_from_config
(pretransform_config, sample_rate)
stable_audio_tools/models/factory.py:35
↓ 8 callersMethoddecay_weight
(self)
stable_audio_tools/training/losses/losses.py:20
↓ 8 callersFunctiondefault
(val: Optional[T], d: Union[Callable[..., T], T])
stable_audio_tools/models/adp.py:37
↓ 8 callersMethodeps
(self, eps_cache, key, x, t, *args, **kwargs)
stable_audio_tools/inference/k_diffusion/sampling.py:236
↓ 8 callersFunctionget_activation
(activation: Literal["elu", "snake", "none"], antialias=False, channels=None)
stable_audio_tools/models/autoencoders.py:35
↓ 8 callersFunctionget_lora_layers
(model)
stable_audio_tools/models/lora/utils.py:36
↓ 8 callersFunctionget_lora_params
(model, print_shapes=False)
stable_audio_tools/models/lora/utils.py:96
↓ 8 callersFunctionget_lora_state_dict
(model)
stable_audio_tools/models/lora/utils.py:104
↓ 8 callersMethodget_text_embedding
(self, text)
stable_audio_tools/models/clap.py:219
↓ 8 callersFunctionrandom_inpaint_mask
Generates random inpainting masks for a batch of latent audio sequences. The output inpainting mask has 0 where data should be inpainted, and
stable_audio_tools/models/inpainting.py:111
↓ 8 callersFunctiontrim_to_shortest
Trim the longer of two tensors to the length of the shorter one.
stable_audio_tools/training/autoencoders.py:35
↓ 7 callersMethod__init__
(self)
stable_audio_tools/training/diffusion.py:40
↓ 7 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/training/arc.py:21
↓ 7 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/models/blocks.py:38
↓ 7 callersMethodforward
(self, x: Tensor, causal=False)
stable_audio_tools/models/adp.py:130
↓ 7 callersMethodreset_parameters
(self)
stable_audio_tools/models/arc.py:47
↓ 7 callersFunctionunfold_channels_from_batch
(x, channels)
stable_audio_tools/models/autoencoders.py:54
↓ 6 callersMethod_disc_scores
Run discriminator forward and return scores with filtered hidden states.
stable_audio_tools/training/arc.py:793
↓ 6 callersMethoddecode
(self, latents, iterate_batch=False, return_loss = False, **kwargs)
stable_audio_tools/models/autoencoders.py:875
↓ 6 callersMethodencode_audio
Encode audios into latents. Audios should already be preprocesed by preprocess_audio_for_encoder. If chunked is True, split the audio
stable_audio_tools/models/autoencoders.py:986
↓ 6 callersFunctioneuler_step
(x_t, v_t, t, s)
stable_audio_tools/training/arc.py:61
↓ 6 callersFunctionfold_channels_into_batch
(x)
stable_audio_tools/training/losses/semantic.py:11
↓ 6 callersMethodget_audio_embedding
(self, audio_features, **audio_kwargs)
stable_audio_tools/models/clap.py:224
↓ 6 callersFunctionto_d
Converts a denoiser output to a Karras ODE derivative.
stable_audio_tools/inference/k_diffusion/sampling.py:27
↓ 5 callersMethod__init__
(self, channels, hidden_dim=None, soft_clip_scale=None, loss_type="lsgan", anti_aliased=False)
stable_audio_tools/models/arc.py:21
↓ 5 callersMethod__init__
(self, N: int, normalize: bool = True, device=None, dtype=None)
stable_audio_tools/models/transforms.py:117
↓ 5 callersFunctioncheckpoint
(function, *args, **kwargs)
stable_audio_tools/models/autoencoders.py:31
↓ 5 callersFunctioncompute_per_elem_trim
Compute per-element trim lengths from seconds_total in conditioning dicts. Returns a list of trim lengths (in audio samples) or None if no second
stable_audio_tools/training/utils.py:145
↓ 5 callersFunctionexists
(val)
stable_audio_tools/training/ema.py:8
↓ 5 callersMethodget_2d_padding
(self, kernel_size: Tuple[int, int], dilation: Tuple[int, int] = (1, 1), )
stable_audio_tools/models/discriminators.py:763
↓ 5 callersFunctionget_alphas_sigmas
Returns the scaling factors for the clean image (alpha) and for the noise (sigma), given a timestep.
stable_audio_tools/inference/sampling.py:12
↓ 5 callersFunctionlog_metric
(logger, key, value, step=None)
stable_audio_tools/training/utils.py:117
↓ 5 callersFunctionprepare_audio
(audio, in_sr, target_sr, target_length, target_channels, device)
stable_audio_tools/inference/utils.py:21
↓ 5 callersFunctionrand
(shape)
stable_audio_tools/training/autoencoders.py:145
↓ 5 callersMethodsample_t_with_shift
Sample timesteps using the given noise distribution and apply distribution shift. Args: noise_dist_fn: Callable that sam
stable_audio_tools/training/arc.py:547
↓ 5 callersMethodsort
(a, b)
stable_audio_tools/inference/k_diffusion/sampling.py:64
↓ 4 callersMethod__init__
(self, dim, kernel_size=7, mult=4, glu=False)
stable_audio_tools/models/convnext.py:18
↓ 4 callersMethod__init__
(self, n_q: int, group_by: int = 2)
stable_audio_tools/models/codebook_patterns.py:535
↓ 4 callersMethod__init__
( self, joint_embed_dim: int, audio_branch: nn.Module, text_branch: nn.Module,
stable_audio_tools/models/clap.py:180
↓ 4 callersMethod_apply_temporal_masking
Memory-efficient temporal masking using in-place operations
stable_audio_tools/models/psychoacoustics.py:240
↓ 4 callersFunction_canonicalize_svd_signs
Enforce deterministic sign convention: largest-magnitude element of each U column is positive.
stable_audio_tools/models/lora/model.py:19
↓ 4 callersMethod_compute_masking_threshold
Compute frequency-domain masking threshold X: [B, F, T] complex spectrum signal_rms: [B, 1, 1] signal RMS Returns:
stable_audio_tools/models/psychoacoustics.py:201
↓ 4 callersMethod_get_original_weight
Get the true original weight, even when the layer is already parametrized.
stable_audio_tools/models/lora/model.py:255
↓ 4 callersFunction_init_layer
(layer)
stable_audio_tools/training/metrics/fad_metrics.py:208
↓ 4 callersMethod_stft
Compute STFT
stable_audio_tools/models/psychoacoustics.py:142
↓ 4 callersMethodapply_padding
Apply padding handling based on padding_mode. Args: embeddings: [batch, seq_len, dim] - the embeddings to process
stable_audio_tools/models/conditioners.py:51
↓ 4 callersFunctionbuild_schedule
Build a timestep schedule for diffusion sampling. Returns a 1D tensor of shape (N,) where N = steps+1 (if include_endpoint) or steps (if not)
stable_audio_tools/inference/sampling.py:229
↓ 4 callersFunctioncalculate_embd_statistics
(embd_lst)
stable_audio_tools/training/metrics/fad_metrics.py:19
↓ 4 callersFunctioncompute_masked_loss
Compute loss with separate signal and padding contributions. Args: loss_full: Full loss tensor of shape (B, C, T) loss_mask:
stable_audio_tools/training/utils.py:393
↓ 4 callersFunctioncompute_normalized_mse
Compute MSE normalized by detached target magnitude. Prevents high-magnitude latents from dominating the loss, ensuring quiet passages r
stable_audio_tools/training/utils.py:332
↓ 4 callersFunctioncreate_clap_from_config
(model_config: dict, pretransform=None)
stable_audio_tools/models/clap.py:269
↓ 4 callersMethoddecode_audio
Decode latents to audio. If chunked is True, split the latents into chunks of a given maximum size chunk_size, with given overlap, b
stable_audio_tools/models/autoencoders.py:1032
↓ 4 callersMethodencode
(self, x)
stable_audio_tools/models/pretransforms.py:42
↓ 4 callersFunctionfold_channels_into_batch
(x)
stable_audio_tools/models/autoencoders.py:50
↓ 4 callersFunctionfold_channels_into_batch
(x)
stable_audio_tools/models/pretransforms.py:18
next →1–100 of 1,182, ranked by callers