deforum / deforum_stable_diffusion

Animating prompts with stable diffusion

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

Run deforum/deforum_stable_diffusion 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 deforum/deforum_stable_diffusion 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 = {
    sampler: "klms",
    max_frames: "100",
    animation_prompts: "a beautiful forest by Asher Brown Durand, trending on Artstation"
};

const output = await replicate.run("deforum/deforum_stable_diffusion:e22e77495f2fb83c34d5fae2ad8ab63c0a87b6b573b6208e1535b23b89ea66d6", { input });

import { writeFile } from "node:fs/promises";
await writeFile("output.mp4", output);
//=> output.mp4 written to disk
Learn more