typefile
{
"condition_scale": 0.5,
"image": "https://replicate.delivery/pbxt/JLl0qK0Hjm0GCGhfrmDPQDZkzKHBD98jQ1EjiRiUpC08MzK1/demo.png",
"num_inference_steps": 30,
"prompt": "spiderman lecture, photorealistic",
"seed": 25087
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0Wj**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/sdxl-controlnet-depth using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/sdxl-controlnet-depth:5e0a5cda895aa23a1aaa1a9a265220097102448e1b4c42b22a3c6d87c12d41a9",
{
input: {
condition_scale: 0.5,
image: "https://replicate.delivery/pbxt/JLl0qK0Hjm0GCGhfrmDPQDZkzKHBD98jQ1EjiRiUpC08MzK1/demo.png",
num_inference_steps: 30,
prompt: "spiderman lecture, photorealistic",
seed: 25087
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0Wj**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/sdxl-controlnet-depth using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/sdxl-controlnet-depth:5e0a5cda895aa23a1aaa1a9a265220097102448e1b4c42b22a3c6d87c12d41a9",
input={
"condition_scale": 0.5,
"image": "https://replicate.delivery/pbxt/JLl0qK0Hjm0GCGhfrmDPQDZkzKHBD98jQ1EjiRiUpC08MzK1/demo.png",
"num_inference_steps": 30,
"prompt": "spiderman lecture, photorealistic",
"seed": 25087
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0Wj**********************************
This is your API token. Keep it to yourself.
Run lucataco/sdxl-controlnet-depth 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 $'{
"version": "lucataco/sdxl-controlnet-depth:5e0a5cda895aa23a1aaa1a9a265220097102448e1b4c42b22a3c6d87c12d41a9",
"input": {
"condition_scale": 0.5,
"image": "https://replicate.delivery/pbxt/JLl0qK0Hjm0GCGhfrmDPQDZkzKHBD98jQ1EjiRiUpC08MzK1/demo.png",
"num_inference_steps": 30,
"prompt": "spiderman lecture, photorealistic",
"seed": 25087
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "cgekvctbear65ui5vgwiahmn34",
"model": "lucataco/sdxl-controlnet-depth",
"version": "5e0a5cda895aa23a1aaa1a9a265220097102448e1b4c42b22a3c6d87c12d41a9",
"input": {
"condition_scale": 0.5,
"image": "https://replicate.delivery/pbxt/JLl0qK0Hjm0GCGhfrmDPQDZkzKHBD98jQ1EjiRiUpC08MzK1/demo.png",
"num_inference_steps": 30,
"prompt": "spiderman lecture, photorealistic",
"seed": 25087
},
"logs": "Using seed: 25087\nOriginal width:458, height:458\nAspect Ratio: 1.00\nnew_width:1024, new_height:1024\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:09, 3.05it/s]\n 7%|▋ | 2/30 [00:00<00:08, 3.26it/s]\n 10%|█ | 3/30 [00:00<00:08, 3.33it/s]\n 13%|█▎ | 4/30 [00:01<00:07, 3.34it/s]\n 17%|█▋ | 5/30 [00:01<00:07, 3.36it/s]\n 20%|██ | 6/30 [00:01<00:07, 3.38it/s]\n 23%|██▎ | 7/30 [00:02<00:06, 3.38it/s]\n 27%|██▋ | 8/30 [00:02<00:06, 3.38it/s]\n 30%|███ | 9/30 [00:02<00:06, 3.39it/s]\n 33%|███▎ | 10/30 [00:02<00:05, 3.39it/s]\n 37%|███▋ | 11/30 [00:03<00:05, 3.38it/s]\n 40%|████ | 12/30 [00:03<00:05, 3.35it/s]\n 43%|████▎ | 13/30 [00:03<00:05, 3.37it/s]\n 47%|████▋ | 14/30 [00:04<00:04, 3.37it/s]\n 50%|█████ | 15/30 [00:04<00:04, 3.37it/s]\n 53%|█████▎ | 16/30 [00:04<00:04, 3.38it/s]\n 57%|█████▋ | 17/30 [00:05<00:03, 3.38it/s]\n 60%|██████ | 18/30 [00:05<00:03, 3.38it/s]\n 63%|██████▎ | 19/30 [00:05<00:03, 3.38it/s]\n 67%|██████▋ | 20/30 [00:05<00:02, 3.38it/s]\n 70%|███████ | 21/30 [00:06<00:02, 3.38it/s]\n 73%|███████▎ | 22/30 [00:06<00:02, 3.38it/s]\n 77%|███████▋ | 23/30 [00:06<00:02, 3.38it/s]\n 80%|████████ | 24/30 [00:07<00:01, 3.38it/s]\n 83%|████████▎ | 25/30 [00:07<00:01, 3.38it/s]\n 87%|████████▋ | 26/30 [00:07<00:01, 3.38it/s]\n 90%|█████████ | 27/30 [00:08<00:00, 3.38it/s]\n 93%|█████████▎| 28/30 [00:08<00:00, 3.38it/s]\n 97%|█████████▋| 29/30 [00:08<00:00, 3.38it/s]\n100%|██████████| 30/30 [00:08<00:00, 3.38it/s]\n100%|██████████| 30/30 [00:08<00:00, 3.37it/s]",
"output": "https://pbxt.replicate.delivery/lvhWUVZ8cqaaDRyNwcoP5SxZnZYO8lG3JXqRmNFAM5Fmc6YE/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-09-12T22:45:45.734709Z",
"started_at": "2023-09-12T22:47:41.267643Z",
"completed_at": "2023-09-12T22:47:53.749512Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/cgekvctbear65ui5vgwiahmn34/cancel",
"get": "https://api.replicate.com/v1/predictions/cgekvctbear65ui5vgwiahmn34"
},
"metrics": {
"predict_time": 12.481869,
"total_time": 128.014803
}
}
