jagilley / controlnet-hough

Modify images using M-LSD line detection

  • Public
  • 9.5M runs
  • A100 (80GB)
  • GitHub
  • License

Run jagilley/controlnet-hough 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 jagilley/controlnet-hough 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 = {
    image: "https://replicate.delivery/pbxt/IJZOELWrncBcjdE1s5Ko8ou35ZOxjNxDqMf0BhoRUAtv76u4/room.png",
    prompt: "a cheerful modernist bedroom"
};

const output = await replicate.run("jagilley/controlnet-hough:854e8727697a057c525cdb45ab037f64ecca770a1769cc52287c2e56472a247b", { input });

import { writeFile } from "node:fs/promises";
for (const [index, item] of Object.entries(output)) {
  await writeFile(`output_${index}.png`, item);
}
//=> output_0.png, output_1.png written to disk
Learn more