emaph / outpaint-controlnet-union

Outpaint an image using controlnet union for SDXL.

  • Public
  • 6.8K runs
  • L40S
Iterate in playground
Run with an API

Run emaph/outpaint-controlnet-union 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 emaph/outpaint-controlnet-union using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

import { writeFile } from "fs/promises";
import Replicate from "replicate";
const replicate = new Replicate();

const input = {
    top: 0,
    left: 400,
    image: "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
    right: 400,
    bottom: 0,
    prompt: "ice dragon, wings wide open"
};

const output = await replicate.run("emaph/outpaint-controlnet-union:377564d35153c66f8629d9540480813685d114f0552e9a3c9ffe5dd315091e68", { input });
for (const [index, item] of Object.entries(output)) {
  await writeFile(`output_${index}.webp`, item);
}
//=> output_0.webp written to disk
Learn more