Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
fofr /controlnet-preprocessors:f6584ef7
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run fofr/controlnet-preprocessors using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/controlnet-preprocessors:f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988e",
{
input: {
hed: true,
sam: true,
mlsd: true,
pidi: true,
canny: true,
image: "https://replicate.delivery/pbxt/JrC7K9M0nR7U4nzeDprdYMZ33bEKuNWC9mpsUkVQNZjOpUTJ/IMG_8325.png",
leres: true,
midas: true,
content: true,
lineart: true,
open_pose: true,
normal_bae: true,
face_detector: true,
lineart_anime: true
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run fofr/controlnet-preprocessors using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/controlnet-preprocessors:f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988e",
input={
"hed": True,
"sam": True,
"mlsd": True,
"pidi": True,
"canny": True,
"image": "https://replicate.delivery/pbxt/JrC7K9M0nR7U4nzeDprdYMZ33bEKuNWC9mpsUkVQNZjOpUTJ/IMG_8325.png",
"leres": True,
"midas": True,
"content": True,
"lineart": True,
"open_pose": True,
"normal_bae": True,
"face_detector": True,
"lineart_anime": True
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run fofr/controlnet-preprocessors 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": "fofr/controlnet-preprocessors:f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988e",
"input": {
"hed": true,
"sam": true,
"mlsd": true,
"pidi": true,
"canny": true,
"image": "https://replicate.delivery/pbxt/JrC7K9M0nR7U4nzeDprdYMZ33bEKuNWC9mpsUkVQNZjOpUTJ/IMG_8325.png",
"leres": true,
"midas": true,
"content": true,
"lineart": true,
"open_pose": true,
"normal_bae": true,
"face_detector": true,
"lineart_anime": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-06-28T10:57:59.169434Z",
"created_at": "2024-06-28T10:56:20.884000Z",
"data_removed": false,
"error": null,
"id": "btzc3d1fjhrgj0cgbsyss4ay28",
"input": {
"hed": true,
"sam": true,
"mlsd": true,
"pidi": true,
"canny": true,
"image": "https://replicate.delivery/pbxt/JrC7K9M0nR7U4nzeDprdYMZ33bEKuNWC9mpsUkVQNZjOpUTJ/IMG_8325.png",
"leres": true,
"midas": true,
"content": true,
"lineart": true,
"open_pose": true,
"normal_bae": true,
"face_detector": true,
"lineart_anime": true
},
"logs": "Processing image with canny\nProcessing image with content\nProcessing image with face_detector\nWARNING: All log messages before absl::InitializeLog() is called are written to STDERR\nE0000 00:00:1719572267.530502 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)\nE0000 00:00:1719572267.530534 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)\nE0000 00:00:1719572267.530542 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)\nINFO: Created TensorFlow Lite XNNPACK delegate for CPU.\nProcessing image with hed\nProcessing image with midas\nProcessing image with mlsd\nProcessing image with open_pose\nProcessing image with pidi\nProcessing image with normal_bae\nProcessing image with lineart\nProcessing image with lineart_anime\nProcessing image with sam\nProcessing image with leres",
"metrics": {
"predict_time": 12.04811129,
"total_time": 98.285434
},
"output": [
"https://replicate.delivery/pbxt/lqqY1Z6NEM44OVTBNrCUonTX9e9obs39cq7b6ONo6pRaSihJA/canny.png",
"https://replicate.delivery/pbxt/fMBcKILZKnVSHy7ORnfYDfLaqkSgSQejqm4POge0sHDvmkYYC/content.png",
"https://replicate.delivery/pbxt/yVSY6mpUDZ4ENxO5merFKoh8KKBLJZI6Rvv0LG70IioaSihJA/face_detector.png",
"https://replicate.delivery/pbxt/SoW1aJpmbqbaCRmAZkOm6f5qAWPNZ52aS0gAh0XO9ce1kEDTA/hed.png",
"https://replicate.delivery/pbxt/D6zWTK7TF06zBtaTZI0o9Idf5PmC1ceqQPsyq8ZPM6r1kEDTA/midas.png",
"https://replicate.delivery/pbxt/CtGdCupwpOY9CpOdiJ9gHpT6WTOxMkEnfsf8W3sG1p91kEDTA/mlsd.png",
"https://replicate.delivery/pbxt/KrA9qXIJYU7pHt86IfEeX2Iu0Dp7qLAKl5sjURs6IQl2kEDTA/open_pose.png",
"https://replicate.delivery/pbxt/P2e9vZwYz3QkS62XUeYfT3n1BmGcN6pjHRrtROWvT0lsJJGmA/pidi.png",
"https://replicate.delivery/pbxt/uPL77J58eerp0kHgMhrvgPXpmou1TxsPBtU9movUBTQ2kEDTA/normal_bae.png",
"https://replicate.delivery/pbxt/BWJBcBZCX6q3Ih2avkOQbfgVYf9xqcSHxdlDk4yi3Qc2kEDTA/lineart.png",
"https://replicate.delivery/pbxt/LopV4X8e2XR7HiX34xRzZmnt4mncA13jION4vBfbWHI2kEDTA/lineart_anime.png",
"https://replicate.delivery/pbxt/ztYeF3st2uUkTqROmCjA0Fjt3lv45Zwe6fdD0UCDIZmsJJGmA/sam.png",
"https://replicate.delivery/pbxt/mzjjB3mJDyI4Opvi5sAD9yfRN7ZwJdCvmCoYjxrIRANbSihJA/leres.png"
],
"started_at": "2024-06-28T10:57:47.121322Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/btzc3d1fjhrgj0cgbsyss4ay28",
"cancel": "https://api.replicate.com/v1/predictions/btzc3d1fjhrgj0cgbsyss4ay28/cancel"
},
"version": "f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988e"
}
Processing image with canny
Processing image with content
Processing image with face_detector
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1719572267.530502 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)
E0000 00:00:1719572267.530534 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)
E0000 00:00:1719572267.530542 218 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Processing image with hed
Processing image with midas
Processing image with mlsd
Processing image with open_pose
Processing image with pidi
Processing image with normal_bae
Processing image with lineart
Processing image with lineart_anime
Processing image with sam
Processing image with leres