Riffusion is an AI music generation project that first produced audio by fine-tuning Stable Diffusion to generate spectrogram images from text prompts and then converting those images into sound. Released in late 2022 as an open-source hobby project by Seth Forsgren and Hayk Martiros, it became one of the earliest widely known demonstrations of text-to-music in Generative media, a field of artificial intelligence that covers images, video, voice and music.
The name later also came to describe a commercial music service that grew out of the project and moved to newer models capable of longer songs with vocals. The original approach remains significant because it showed that an image diffusion model could be repurposed for audio with surprisingly little change to its architecture.
How Riffusion turns images into sound
The original Riffusion model treats music as a picture. A spectrogram is a two-dimensional image in which the horizontal axis is time, the vertical axis is frequency and pixel brightness shows the amplitude of each frequency at each moment. Riffusion generates such images with a diffusion model and then reconstructs a waveform from them.
The pipeline has a small number of clearly separated stages, summarized in the table below.
| Stage | What happens | Key detail |
|---|---|---|
| Text encoding | The prompt is turned into embeddings | Uses the CLIP text encoder of Stable Diffusion |
| Latent diffusion | Noise is iteratively denoised into a latent image | Fine-tuned Stable Diffusion v1.5 weights |
| Decoding | The VAE decodes the latent into a spectrogram | Typically 512 by 512 pixels |
| Phase reconstruction | Magnitude is converted back to a waveform | Griffin-Lim algorithm estimates phase |
| Audio output | A short clip is rendered | About five seconds per image |
The spectrogram stores only magnitude, not phase, so phase must be estimated. The Griffin-Lim algorithm iteratively searches for a phase that matches the magnitudes, which works but introduces audible metallic or smeared artifacts, one of the main quality limits of the method.
Interpolation and continuous playback
Riffusion overcame the five-second clip length with latent space interpolation. Instead of generating unrelated clips, it blends between two prompts or two random seeds in small steps, and each step produces a new spectrogram that shares structure with its neighbor.
The original web application used this to create endless, gradually evolving music, for example morphing from a jazz piano groove into an electronic beat. Conditioning each new clip on an initial image also kept tempo and key more consistent across segments. Smooth transitions were not guaranteed, however, and abrupt changes in rhythm remained common.
The same mechanism supports image-to-audio editing. Starting from an existing spectrogram and adding partial noise, the model can restyle a clip while keeping its rough timing, much like image-to-image generation in Stable Diffusion. The denoising strength controls the balance: low values preserve the source rhythm, while high values replace most of it with material that follows the new prompt. This makes Riffusion useful for variations on a short loop rather than for composing a complete arrangement.
Strengths and limitations of the spectrogram approach
The spectrogram method made text-to-music accessible on consumer GPUs because it reused a mature image model, its tooling and its fine-tuning workflow. The same design, however, imposes limits that later audio-native models were built to remove.
| Property | Typical behavior | Consequence |
|---|---|---|
| Clip length | About five seconds | Longer pieces require interpolation |
| Audio fidelity | Lossy, with phase artifacts | Unsuitable for final production masters |
| Vocals | Vague, unintelligible singing | No usable lyrics |
| Musical structure | No verse or chorus planning | Loops and textures rather than songs |
| Hardware needs | Runs on a single consumer GPU | Easy local experimentation |
A frequent misconception is that Riffusion composes music symbolically, like a MIDI generator. It does not: it paints sound directly as an image, so it has no explicit notion of notes, bars or harmony, and long-range structure emerges only by chance.
Riffusion compared with other music generators
Riffusion belongs to the first generation of text-to-audio systems. Later generators moved away from spectrogram images toward neural audio codecs and transformer or diffusion models trained directly on audio tokens, which improved fidelity and duration.
| System | Core technique | Typical output |
|---|---|---|
| Riffusion (original) | Image diffusion on spectrograms | Short loops, evolving textures |
| MusicGen | Autoregressive transformer over codec tokens | Instrumental clips up to tens of seconds |
| Stable Audio | Latent diffusion on compressed audio | Instrumental tracks with timing control |
| Lyria | Large audio generation model | Higher-fidelity music, including vocals |
The commercial Riffusion service followed this broader shift and introduced newer models able to produce full songs with lyrics and vocals. Its technical details are less openly documented than those of the 2022 open-source release, which remains the version most often cited in research and teaching.
Uses, licensing and responsible practice
Typical uses of Riffusion include rapid sketching of musical ideas, ambient backgrounds for prototypes, sound design experiments and teaching how diffusion models work. The open code and weights were published under a permissive license, which encouraged many forks and browser demos.
Users should remember that training data provenance affects how generated music may be used. Before releasing generated audio commercially, it is prudent to check the terms of the specific model version and to avoid prompts that imitate an identifiable living artist, a practice that raises both legal and ethical concerns in AI cover song and voice cloning debates.
A non-technical view
Sound can be drawn as a picture. Low notes sit at the bottom. High notes sit at the top. Loud parts are bright, and quiet parts are dark.
Riffusion took an AI that was already good at drawing pictures from words and taught it to draw these sound pictures. You type a description such as calm piano. The AI draws a matching picture, and a program plays the picture back as music. The clips are short and a little rough, but the idea opened a new path for AI music.
A concrete example
An independent game developer needs background music for a prototype of a puzzle game and has no budget for a composer during early testing. The developer runs the open-source Riffusion model locally on a desktop graphics card and writes prompts such as soft lo-fi beat with warm piano and vinyl crackle.
Using seed interpolation, the developer generates about two minutes of slowly changing audio from a series of five-second segments and loops it under the first level. Playtesters report that the music fits the mood, although an audio engineer notes phase artifacts in the high frequencies. The team keeps the track for internal testing only and later commissions original music for the public release.