andreasjansson / stable-diffusion-animation

Animate Stable Diffusion by interpolating between two prompts

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

Run andreasjansson/stable-diffusion-animation 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 andreasjansson/stable-diffusion-animation 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 = {
    prompt_end: "tall rectangular black monolith, a white room in the future with a bed, victorian details and a tall black monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection",
    prompt_start: "tall rectangular black monolith, monkeys in the desert looking at a large tall monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection",
    gif_ping_pong: true,
    output_format: "mp4",
    prompt_strength: 0.9,
    num_animation_frames: "25"
};

for await (const event of replicate.stream("andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5", { input })) {
  process.stdout.write(`${event}
`)
  //=> "https://replicate.delivery/mgxm/56df19d7-3776-4119-a0f9-d278b26a4a8a/output.mp4"
};
process.stdout.write("\n");
Learn more