riffusion / riffusion

Stable diffusion for real-time music generation

  • Public
  • 1M runs
  • T4
  • GitHub
  • Paper
  • License

Input

string
Shift + Return to add a new line

The prompt for your audio

Default: "funky synth solo"

number
(minimum: 0, maximum: 1)

How much to transform input spectrogram

Default: 0.75

string
Shift + Return to add a new line

The second prompt to interpolate with the first, leave blank if no interpolation

number
(minimum: 0, maximum: 1)

Interpolation alpha if using two prompts. A value of 0 uses prompt_a fully, a value of 1 uses prompt_b fully

Default: 0.5

integer
(minimum: 1)

Number of steps to run the diffusion model

Default: 50

string

Seed spectrogram to use

Default: "vibes"

Output

audio

Video Player is loading.
Current Time 00:00:000
Duration 00:00:000
Loaded: 0%
Stream Type LIVE
Remaining Time 00:00:000
 
1x

spectrogram

spectrogram
Generated in

Run time and cost

This model costs approximately $0.037 to run on Replicate, or 27 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia T4 GPU hardware. Predictions typically complete within 3 minutes. The predict time for this model varies significantly based on the inputs.

Readme

You’ve heard of Stable Diffusion, the open-source AI model that generates images from text?

photograph of an astronaut riding a horse

Well, we fine-tuned the model to generate images of spectrograms, like this:

funk bassline with a jazzy saxophone solo

The magic is that this spectrogram can then be converted to an audio clip. (See demo above.)

This is the v1.5 stable diffusion model with no modifications, just fine-tuned on images of spectrograms paired with text. Audio processing happens downstream of the model.

It can generate infinite variations of a prompt by varying the seed. All the same web UIs and techniques like img2img, inpainting, negative prompts, and interpolation work out of the box.

Read more about it here: https://www.riffusion.com/about

Citation:

@software{Forsgren_Martiros_2022,
  author = {Forsgren, Seth* and Martiros, Hayk*},
  title = {{Riffusion - Stable diffusion for real-time music generation}},
  url = {https://riffusion.com/about},
  year = {2022}
}