Dance Diffusion

Dance Diffusion

Dance Diffusionarrow-up-right is by Zach Evans.

Dance Diffusion is the first in a suite of generative audio tools for producers and musicians released by Harmonaiarrow-up-right.

The original codebase of this implementation can be found at Harmonai-orgarrow-up-right.

Make sure to check out the Schedulers guidearrow-up-right to learn how to explore the tradeoff between scheduler speed and quality, and see the reuse components across pipelinesarrow-up-right section to learn how to efficiently load the same components into multiple pipelines.

DanceDiffusionPipeline

class diffusers.DanceDiffusionPipeline

<source>arrow-up-right

( unetscheduler )

Parameters

Pipeline for audio generation.

This model inherits from DiffusionPipelinearrow-up-right. Check the superclass documentation for the generic methods implemented for all pipelines (downloading, saving, running on a particular device, etc.).

__call__

<source>arrow-up-right

( 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 ) β†’ AudioPipelineOutputarrow-up-right or tuple

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.

  • generator (torch.Generator, optional) β€” A torch.Generatorarrow-up-right to make generation deterministic.

  • 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.

  • return_dict (bool, optional, defaults to True) β€” Whether or not to return a AudioPipelineOutputarrow-up-right instead of a plain tuple.

Returns

AudioPipelineOutputarrow-up-right or tuple

If return_dict is True, AudioPipelineOutputarrow-up-right is returned, otherwise a tuple is returned where the first element is a list with the generated audio.

The call function to the pipeline for generation.

Example:

Copied

AudioPipelineOutput

class diffusers.AudioPipelineOutput

<source>arrow-up-right

( 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.

Last updated