nightmareai / disco-diffusion

Generate images using a variety of techniques - Powered by Discoart

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

Run nightmareai/disco-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 nightmareai/disco-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 = {
    steps: 250
};

for await (const event of replicate.stream("nightmareai/disco-diffusion:3c128f652e9f24e72896ac0b019e47facfd6bccf93104d50f09f1f2196325507", { input })) {
  process.stdout.write(`${event}
`)
  //=> "https://replicate.delivery/mgxm/d3e8443d-cb0e-45b4-b712-4b6a5f9c2a81/progress.png"
};
process.stdout.write("\n");
Learn more