pollinations / stable-diffusion-dance

Audio Reactive Stable Diffusion

  • Public
  • 5.7K runs
  • A100 (80GB)
  • GitHub
  • License

Run pollinations/stable-diffusion-dance with an API

Use one of our client libraries to get started quickly.

Set the REPLICATE_API_TOKEN environment variable

export REPLICATE_API_TOKEN=<paste-your-token-here>

Learn more about authentication

Install Replicate’s Node.js client library

npm install replicate
Learn more about setup

Run pollinations/stable-diffusion-dance using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

import Replicate from "replicate";
const replicate = new Replicate();

const input = {
    width: 512,
    prompts: "A painting of a moth\nA painting of a killer dragonfly\nTwo fishes talking to each other in deep sea\nA painting of a moth",
    audio_file: "https://replicate.delivery/pbxt/IEUhQkLT4CaUs08buoPAyXgVlvf0157xNiHcyukEfDDfWxB5/ganze_boot.mp3",
    batch_size: 20,
    style_suffix: "by paul klee, intricate detail",
    audio_smoothing: 0.85,
    diffusion_steps: 15
};

for await (const event of replicate.stream("pollinations/stable-diffusion-dance:dfb636aa9c04fe5b7d9897e6159ef88e3ecb3e1eb274c3f072dca7b495823280", { input })) {
  process.stdout.write(`${event}
`)
  //=> "https://replicate.delivery/pbxt/qeDC7uZ1nwSECK5VFOIOcFRVJgkSRaX6VD3Yye0v4dk0e50gA/00019.png"
};
process.stdout.write("\n");
Learn more