Dance Diffusion
Last updated
Last updated
is by Zach Evans.
Dance Diffusion is the first in a suite of generative audio tools for producers and musicians released by .
The original codebase of this implementation can be found at .
Make sure to check out the Schedulers to learn how to explore the tradeoff between scheduler speed and quality, and see the section to learn how to efficiently load the same components into multiple pipelines.
( unetscheduler )
Parameters
unet () — A UNet1DModel
to denoise the encoded audio.
scheduler () — A scheduler to be used in combination with unet
to denoise the encoded audio latents. Can be one of .
Pipeline for audio generation.
This model inherits from . Check the superclass documentation for the generic methods implemented for all pipelines (downloading, saving, running on a particular device, etc.).
__call__
Parameters
batch_size (int
, optional, defaults to 1) — The number of audio samples to generate.
num_inference_steps (int
, optional, defaults to 50) — The number of denoising steps. More denoising steps usually lead to a higher-quality audio sample at the expense of slower inference.
audio_length_in_s (float
, optional, defaults to self.unet.config.sample_size/self.unet.config.sample_rate
) — The length of the generated audio sample in seconds.
Returns
The call function to the pipeline for generation.
Example:
Copied
( audios: ndarray )
Parameters
audios (np.ndarray
) — List of denoised audio samples of a NumPy array of shape (batch_size, num_channels, sample_rate)
.
Output class for audio pipelines.
( batch_size: int = 1num_inference_steps: int = 100generator: typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = Noneaudio_length_in_s: typing.Optional[float] = Nonereturn_dict: bool = True ) → or tuple
generator (torch.Generator
, optional) — A to make generation deterministic.
return_dict (bool
, optional, defaults to True
) — Whether or not to return a instead of a plain tuple.
or tuple
If return_dict
is True
, is returned, otherwise a tuple
is returned where the first element is a list with the generated audio.