Official

black-forest-labs / flux-canny-pro

Professional edge-guided image generation. Control structure and composition using Canny edge detection

  • Public
  • 136.9K runs
  • $0.05 per image
  • Commercial use
  • License

Run replicate/flux-canny-pro-internal-model 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 black-forest-labs/flux-canny-pro 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: 28,
    prompt: "a photo of a car on a city street",
    guidance: 25,
    control_image: "https://replicate.delivery/pbxt/M0j11UQhwUWoxUQ9hJCOaALsAHTeoPZcGGtUf6n3BJxtKHul/output-14.webp"
};

const output = await replicate.run("black-forest-labs/flux-canny-pro", { input });

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