black-forest-labs
/
flux-canny-dev
Open-weight edge-guided image generation. Control structure and composition using Canny edge detection.
Prediction
black-forest-labs/flux-canny-devOfficial modelIDd9v5nwg7xsrma0ck9x4a8z0g18StatusSucceededSourceWebTotal durationCreatedInput
- prompt
- A red vintage convertible driving through an old town
- guidance
- 30
- megapixels
- 1
- num_outputs
- 1
- output_format
- webp
- output_quality
- 80
- num_inference_steps
- 28
{ "prompt": "A red vintage convertible driving through an old town", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M0mUcvKOwNSS4axvv7LAngBAR5Iuv2GsIcnSKdpQRJA62f8G/Screenshot%202024-11-21%20at%2016.08.20.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "A red vintage convertible driving through an old town", guidance: 30, megapixels: "1", num_outputs: 1, control_image: "https://replicate.delivery/pbxt/M0mUcvKOwNSS4axvv7LAngBAR5Iuv2GsIcnSKdpQRJA62f8G/Screenshot%202024-11-21%20at%2016.08.20.png", output_format: "webp", output_quality: 80, num_inference_steps: 28 }; const output = await replicate.run("black-forest-labs/flux-canny-dev", { input }); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-canny-dev", input={ "prompt": "A red vintage convertible driving through an old town", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M0mUcvKOwNSS4axvv7LAngBAR5Iuv2GsIcnSKdpQRJA62f8G/Screenshot%202024-11-21%20at%2016.08.20.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "A red vintage convertible driving through an old town", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M0mUcvKOwNSS4axvv7LAngBAR5Iuv2GsIcnSKdpQRJA62f8G/Screenshot%202024-11-21%20at%2016.08.20.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-canny-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-11-21T15:12:27.593277Z", "created_at": "2024-11-21T15:12:20.974000Z", "data_removed": false, "error": null, "id": "d9v5nwg7xsrma0ck9x4a8z0g18", "input": { "prompt": "A red vintage convertible driving through an old town", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M0mUcvKOwNSS4axvv7LAngBAR5Iuv2GsIcnSKdpQRJA62f8G/Screenshot%202024-11-21%20at%2016.08.20.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }, "logs": "running bf16 model, fp8 disabled\nUsing seed: 25823\n0it [00:00, ?it/s]\n1it [00:00, 8.11it/s]\n2it [00:00, 5.66it/s]\n3it [00:00, 5.15it/s]\n4it [00:00, 4.94it/s]\n5it [00:00, 4.74it/s]\n6it [00:01, 4.69it/s]\n7it [00:01, 4.66it/s]\n8it [00:01, 4.65it/s]\n9it [00:01, 4.64it/s]\n10it [00:02, 4.61it/s]\n11it [00:02, 4.61it/s]\n12it [00:02, 4.61it/s]\n13it [00:02, 4.61it/s]\n14it [00:02, 4.59it/s]\n15it [00:03, 4.59it/s]\n16it [00:03, 4.59it/s]\n17it [00:03, 4.60it/s]\n18it [00:03, 4.60it/s]\n19it [00:04, 4.58it/s]\n20it [00:04, 4.58it/s]\n21it [00:04, 4.59it/s]\n22it [00:04, 4.60it/s]\n23it [00:04, 4.61it/s]\n24it [00:05, 4.59it/s]\n25it [00:05, 4.59it/s]\n26it [00:05, 4.59it/s]\n27it [00:05, 4.60it/s]\n28it [00:06, 4.59it/s]\n28it [00:06, 4.67it/s]\nTotal safe images: 1 out of 1", "metrics": { "image_count": 1, "predict_time": 6.611810817, "total_time": 6.619277 }, "output": [ "https://replicate.delivery/xezq/4bt5HoegzYR9EKqv70zsBoHnhFkcaB9Yk1naaQJai6rtfPzTA/out-0.webp" ], "started_at": "2024-11-21T15:12:20.981466Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-rxxzhmhyoia3wetm2bu2vgsqfgoy3q7d2nhua3spprualor3nk4q", "get": "https://api.replicate.com/v1/predictions/d9v5nwg7xsrma0ck9x4a8z0g18", "cancel": "https://api.replicate.com/v1/predictions/d9v5nwg7xsrma0ck9x4a8z0g18/cancel" }, "version": "hidden" }
Generated inrunning bf16 model, fp8 disabled Using seed: 25823 0it [00:00, ?it/s] 1it [00:00, 8.11it/s] 2it [00:00, 5.66it/s] 3it [00:00, 5.15it/s] 4it [00:00, 4.94it/s] 5it [00:00, 4.74it/s] 6it [00:01, 4.69it/s] 7it [00:01, 4.66it/s] 8it [00:01, 4.65it/s] 9it [00:01, 4.64it/s] 10it [00:02, 4.61it/s] 11it [00:02, 4.61it/s] 12it [00:02, 4.61it/s] 13it [00:02, 4.61it/s] 14it [00:02, 4.59it/s] 15it [00:03, 4.59it/s] 16it [00:03, 4.59it/s] 17it [00:03, 4.60it/s] 18it [00:03, 4.60it/s] 19it [00:04, 4.58it/s] 20it [00:04, 4.58it/s] 21it [00:04, 4.59it/s] 22it [00:04, 4.60it/s] 23it [00:04, 4.61it/s] 24it [00:05, 4.59it/s] 25it [00:05, 4.59it/s] 26it [00:05, 4.59it/s] 27it [00:05, 4.60it/s] 28it [00:06, 4.59it/s] 28it [00:06, 4.67it/s] Total safe images: 1 out of 1
Prediction
black-forest-labs/flux-canny-devOfficial modelIDfwjkca20a5rm80ckcgy90sa1fcStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- a white owl with glittery dark red wings
- guidance
- 30
- megapixels
- 1
- num_outputs
- 1
- output_format
- webp
- output_quality
- 80
- num_inference_steps
- 28
{ "prompt": "a white owl with glittery dark red wings", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E2P9bGEFfTZCkj8srFB3VDBw6ORZBXrxmCckxNcEFtgWha/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "a white owl with glittery dark red wings", guidance: 30, megapixels: "1", num_outputs: 1, control_image: "https://replicate.delivery/pbxt/M2E2P9bGEFfTZCkj8srFB3VDBw6ORZBXrxmCckxNcEFtgWha/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", output_format: "webp", output_quality: 80, num_inference_steps: 28 }; const output = await replicate.run("black-forest-labs/flux-canny-dev", { input }); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-canny-dev", input={ "prompt": "a white owl with glittery dark red wings", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E2P9bGEFfTZCkj8srFB3VDBw6ORZBXrxmCckxNcEFtgWha/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "a white owl with glittery dark red wings", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E2P9bGEFfTZCkj8srFB3VDBw6ORZBXrxmCckxNcEFtgWha/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-canny-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-11-25T16:51:37.014350Z", "created_at": "2024-11-25T16:51:30.513000Z", "data_removed": false, "error": null, "id": "fwjkca20a5rm80ckcgy90sa1fc", "input": { "prompt": "a white owl with glittery dark red wings", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E2P9bGEFfTZCkj8srFB3VDBw6ORZBXrxmCckxNcEFtgWha/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }, "logs": "running bf16 model, fp8 disabled\nUsing seed: 28997\n0it [00:00, ?it/s]\n1it [00:00, 8.12it/s]\n2it [00:00, 5.69it/s]\n3it [00:00, 5.19it/s]\n4it [00:00, 4.98it/s]\n5it [00:00, 4.83it/s]\n6it [00:01, 4.76it/s]\n7it [00:01, 4.73it/s]\n8it [00:01, 4.71it/s]\n9it [00:01, 4.70it/s]\n10it [00:02, 4.66it/s]\n11it [00:02, 4.65it/s]\n12it [00:02, 4.66it/s]\n13it [00:02, 4.66it/s]\n14it [00:02, 4.64it/s]\n15it [00:03, 4.63it/s]\n16it [00:03, 4.64it/s]\n17it [00:03, 4.64it/s]\n18it [00:03, 4.64it/s]\n19it [00:03, 4.63it/s]\n20it [00:04, 4.63it/s]\n21it [00:04, 4.63it/s]\n22it [00:04, 4.64it/s]\n23it [00:04, 4.65it/s]\n24it [00:05, 4.64it/s]\n25it [00:05, 4.64it/s]\n26it [00:05, 4.64it/s]\n27it [00:05, 4.65it/s]\n28it [00:05, 4.65it/s]\n28it [00:05, 4.72it/s]\nTotal safe images: 1 out of 1", "metrics": { "image_count": 1, "predict_time": 6.494316276, "total_time": 6.50135 }, "output": [ "https://replicate.delivery/xezq/odMv9afjejrl90wNz5QK9IoaADJDpvF8vGGcHheWnSzzoLpnA/out-0.webp" ], "started_at": "2024-11-25T16:51:30.520034Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-hapmlsowx2oosfcwlospctfsw5xkuhg2fwngnseknmbni7xcoh7a", "get": "https://api.replicate.com/v1/predictions/fwjkca20a5rm80ckcgy90sa1fc", "cancel": "https://api.replicate.com/v1/predictions/fwjkca20a5rm80ckcgy90sa1fc/cancel" }, "version": "hidden" }
Generated inrunning bf16 model, fp8 disabled Using seed: 28997 0it [00:00, ?it/s] 1it [00:00, 8.12it/s] 2it [00:00, 5.69it/s] 3it [00:00, 5.19it/s] 4it [00:00, 4.98it/s] 5it [00:00, 4.83it/s] 6it [00:01, 4.76it/s] 7it [00:01, 4.73it/s] 8it [00:01, 4.71it/s] 9it [00:01, 4.70it/s] 10it [00:02, 4.66it/s] 11it [00:02, 4.65it/s] 12it [00:02, 4.66it/s] 13it [00:02, 4.66it/s] 14it [00:02, 4.64it/s] 15it [00:03, 4.63it/s] 16it [00:03, 4.64it/s] 17it [00:03, 4.64it/s] 18it [00:03, 4.64it/s] 19it [00:03, 4.63it/s] 20it [00:04, 4.63it/s] 21it [00:04, 4.63it/s] 22it [00:04, 4.64it/s] 23it [00:04, 4.65it/s] 24it [00:05, 4.64it/s] 25it [00:05, 4.64it/s] 26it [00:05, 4.64it/s] 27it [00:05, 4.65it/s] 28it [00:05, 4.65it/s] 28it [00:05, 4.72it/s] Total safe images: 1 out of 1
Prediction
black-forest-labs/flux-canny-devOfficial modelIDwrgrc5zs35rmc0ckcgzaxvggbgStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- an owl with sleek black plumage
- guidance
- 30
- megapixels
- 1
- num_outputs
- 1
- output_format
- webp
- output_quality
- 80
- num_inference_steps
- 28
{ "prompt": "an owl with sleek black plumage", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E5DIgMZnXVoBD95A2SYzExQneQUIp4WgXmzcxzTidlSLXh/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "an owl with sleek black plumage", guidance: 30, megapixels: "1", num_outputs: 1, control_image: "https://replicate.delivery/pbxt/M2E5DIgMZnXVoBD95A2SYzExQneQUIp4WgXmzcxzTidlSLXh/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", output_format: "webp", output_quality: 80, num_inference_steps: 28 }; const output = await replicate.run("black-forest-labs/flux-canny-dev", { input }); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-canny-dev", input={ "prompt": "an owl with sleek black plumage", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E5DIgMZnXVoBD95A2SYzExQneQUIp4WgXmzcxzTidlSLXh/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "an owl with sleek black plumage", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E5DIgMZnXVoBD95A2SYzExQneQUIp4WgXmzcxzTidlSLXh/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-canny-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-11-25T16:54:35.416101Z", "created_at": "2024-11-25T16:54:28.889000Z", "data_removed": false, "error": null, "id": "wrgrc5zs35rmc0ckcgzaxvggbg", "input": { "prompt": "an owl with sleek black plumage", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E5DIgMZnXVoBD95A2SYzExQneQUIp4WgXmzcxzTidlSLXh/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }, "logs": "running bf16 model, fp8 disabled\nUsing seed: 42934\n0it [00:00, ?it/s]\n1it [00:00, 8.15it/s]\n2it [00:00, 5.69it/s]\n3it [00:00, 5.18it/s]\n4it [00:00, 4.98it/s]\n5it [00:00, 4.85it/s]\n6it [00:01, 4.78it/s]\n7it [00:01, 4.73it/s]\n8it [00:01, 4.71it/s]\n9it [00:01, 4.69it/s]\n10it [00:02, 4.66it/s]\n11it [00:02, 4.64it/s]\n12it [00:02, 4.65it/s]\n13it [00:02, 4.65it/s]\n14it [00:02, 4.64it/s]\n15it [00:03, 4.64it/s]\n16it [00:03, 4.65it/s]\n17it [00:03, 4.66it/s]\n18it [00:03, 4.66it/s]\n19it [00:03, 4.65it/s]\n20it [00:04, 4.64it/s]\n21it [00:04, 4.64it/s]\n22it [00:04, 4.65it/s]\n23it [00:04, 4.64it/s]\n24it [00:05, 4.62it/s]\n25it [00:05, 4.61it/s]\n26it [00:05, 4.61it/s]\n27it [00:05, 4.62it/s]\n28it [00:05, 4.63it/s]\n28it [00:05, 4.71it/s]\nTotal safe images: 1 out of 1", "metrics": { "image_count": 1, "predict_time": 6.520595023, "total_time": 6.527101 }, "output": [ "https://replicate.delivery/xezq/4Ptsqhlyw9JPDhq7pvQ4QmeEi2deeJ9umXSecFEgyIUvcXSPB/out-0.webp" ], "started_at": "2024-11-25T16:54:28.895506Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-tcimxln3cgarf4l735v6ybbdfvqzpwfmsh6pfhu6sppnif5i6uvq", "get": "https://api.replicate.com/v1/predictions/wrgrc5zs35rmc0ckcgzaxvggbg", "cancel": "https://api.replicate.com/v1/predictions/wrgrc5zs35rmc0ckcgzaxvggbg/cancel" }, "version": "hidden" }
Generated inrunning bf16 model, fp8 disabled Using seed: 42934 0it [00:00, ?it/s] 1it [00:00, 8.15it/s] 2it [00:00, 5.69it/s] 3it [00:00, 5.18it/s] 4it [00:00, 4.98it/s] 5it [00:00, 4.85it/s] 6it [00:01, 4.78it/s] 7it [00:01, 4.73it/s] 8it [00:01, 4.71it/s] 9it [00:01, 4.69it/s] 10it [00:02, 4.66it/s] 11it [00:02, 4.64it/s] 12it [00:02, 4.65it/s] 13it [00:02, 4.65it/s] 14it [00:02, 4.64it/s] 15it [00:03, 4.64it/s] 16it [00:03, 4.65it/s] 17it [00:03, 4.66it/s] 18it [00:03, 4.66it/s] 19it [00:03, 4.65it/s] 20it [00:04, 4.64it/s] 21it [00:04, 4.64it/s] 22it [00:04, 4.65it/s] 23it [00:04, 4.64it/s] 24it [00:05, 4.62it/s] 25it [00:05, 4.61it/s] 26it [00:05, 4.61it/s] 27it [00:05, 4.62it/s] 28it [00:05, 4.63it/s] 28it [00:05, 4.71it/s] Total safe images: 1 out of 1
Prediction
black-forest-labs/flux-canny-devOfficial modelIDq0zxq47jj9rma0ckch0t1vhvscStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- an owl with piercing green eyes, set against a serene and misty forest backdrop
- guidance
- 30
- megapixels
- 1
- num_outputs
- 1
- output_format
- webp
- output_quality
- 80
- num_inference_steps
- 28
{ "prompt": "an owl with piercing green eyes, set against a serene and misty forest backdrop", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E8I8hK06EaL0el7IxFnfqUt7Iq9Dx2KcSP0b08x60U4Tz4/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "an owl with piercing green eyes, set against a serene and misty forest backdrop", guidance: 30, megapixels: "1", num_outputs: 1, control_image: "https://replicate.delivery/pbxt/M2E8I8hK06EaL0el7IxFnfqUt7Iq9Dx2KcSP0b08x60U4Tz4/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", output_format: "webp", output_quality: 80, num_inference_steps: 28 }; const output = await replicate.run("black-forest-labs/flux-canny-dev", { input }); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-canny-dev", input={ "prompt": "an owl with piercing green eyes, set against a serene and misty forest backdrop", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E8I8hK06EaL0el7IxFnfqUt7Iq9Dx2KcSP0b08x60U4Tz4/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run black-forest-labs/flux-canny-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "an owl with piercing green eyes, set against a serene and misty forest backdrop", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E8I8hK06EaL0el7IxFnfqUt7Iq9Dx2KcSP0b08x60U4Tz4/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-canny-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-11-25T16:57:50.349674Z", "created_at": "2024-11-25T16:57:43.826000Z", "data_removed": false, "error": null, "id": "q0zxq47jj9rma0ckch0t1vhvsc", "input": { "prompt": "an owl with piercing green eyes, set against a serene and misty forest backdrop", "guidance": 30, "megapixels": "1", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/M2E8I8hK06EaL0el7IxFnfqUt7Iq9Dx2KcSP0b08x60U4Tz4/Screenshot%202024-11-25%20at%2011.38.09%E2%80%AFAM.png", "output_format": "webp", "output_quality": 80, "num_inference_steps": 28 }, "logs": "running bf16 model, fp8 disabled\nUsing seed: 7521\n0it [00:00, ?it/s]\n1it [00:00, 8.14it/s]\n2it [00:00, 5.69it/s]\n3it [00:00, 5.18it/s]\n4it [00:00, 4.96it/s]\n5it [00:00, 4.81it/s]\n6it [00:01, 4.75it/s]\n7it [00:01, 4.71it/s]\n8it [00:01, 4.70it/s]\n9it [00:01, 4.69it/s]\n10it [00:02, 4.66it/s]\n11it [00:02, 4.65it/s]\n12it [00:02, 4.64it/s]\n13it [00:02, 4.64it/s]\n14it [00:02, 4.63it/s]\n15it [00:03, 4.63it/s]\n16it [00:03, 4.63it/s]\n17it [00:03, 4.64it/s]\n18it [00:03, 4.64it/s]\n19it [00:04, 4.64it/s]\n20it [00:04, 4.65it/s]\n21it [00:04, 4.64it/s]\n22it [00:04, 4.64it/s]\n23it [00:04, 4.65it/s]\n24it [00:05, 4.65it/s]\n25it [00:05, 4.65it/s]\n26it [00:05, 4.64it/s]\n27it [00:05, 4.64it/s]\n28it [00:05, 4.64it/s]\n28it [00:05, 4.71it/s]\nTotal safe images: 1 out of 1", "metrics": { "image_count": 1, "predict_time": 6.51693605, "total_time": 6.523674 }, "output": [ "https://replicate.delivery/xezq/doftNpDPu9UdRSSwY8lRSgzL4wQIa3yZnj7RbhWrYQTH9S6JA/out-0.webp" ], "started_at": "2024-11-25T16:57:43.832738Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-mnptnd3wfd74ff33aibxjnbajzq3rak3f4i4pnavpy5fbqxctg6a", "get": "https://api.replicate.com/v1/predictions/q0zxq47jj9rma0ckch0t1vhvsc", "cancel": "https://api.replicate.com/v1/predictions/q0zxq47jj9rma0ckch0t1vhvsc/cancel" }, "version": "hidden" }
Generated inrunning bf16 model, fp8 disabled Using seed: 7521 0it [00:00, ?it/s] 1it [00:00, 8.14it/s] 2it [00:00, 5.69it/s] 3it [00:00, 5.18it/s] 4it [00:00, 4.96it/s] 5it [00:00, 4.81it/s] 6it [00:01, 4.75it/s] 7it [00:01, 4.71it/s] 8it [00:01, 4.70it/s] 9it [00:01, 4.69it/s] 10it [00:02, 4.66it/s] 11it [00:02, 4.65it/s] 12it [00:02, 4.64it/s] 13it [00:02, 4.64it/s] 14it [00:02, 4.63it/s] 15it [00:03, 4.63it/s] 16it [00:03, 4.63it/s] 17it [00:03, 4.64it/s] 18it [00:03, 4.64it/s] 19it [00:04, 4.64it/s] 20it [00:04, 4.65it/s] 21it [00:04, 4.64it/s] 22it [00:04, 4.64it/s] 23it [00:04, 4.65it/s] 24it [00:05, 4.65it/s] 25it [00:05, 4.65it/s] 26it [00:05, 4.64it/s] 27it [00:05, 4.64it/s] 28it [00:05, 4.64it/s] 28it [00:05, 4.71it/s] Total safe images: 1 out of 1
Want to make some of these yourself?
Run this model