replicate / dreambooth

Train your own custom Stable Diffusion model using a small set of images

  • Public
  • 295.7K runs
  • A100 (80GB)
  • GitHub
  • Paper
  • License

Run replicate/dreambooth 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 replicate/dreambooth 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 = {
    class_prompt: "a photo of a man",
    instance_data: "https://replicate.delivery/pbxt/HoUeWsrtTTCJEpKGdLKqIYTfo8nbUTSNs565MkGxEstjfwKt/data.zip",
    instance_prompt: "a photo of bfirsh"
};

const output = await replicate.run("replicate/dreambooth:a8ba568da0313951a6b311b43b1ea3bf9f2ef7b9fd97ed94cebd7ffd2da66654", { input });

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