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/JrCCMJ7WAdjQSIkZUQrUkOmyDeFhkRkgQgH1S3QvryX8Iypg/IMG_7845.jpeg",
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/JrCCMJ7WAdjQSIkZUQrUkOmyDeFhkRkgQgH1S3QvryX8Iypg/IMG_7845.jpeg",
"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/JrCCMJ7WAdjQSIkZUQrUkOmyDeFhkRkgQgH1S3QvryX8Iypg/IMG_7845.jpeg",
"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": "2023-11-11T06:58:25.102627Z",
"created_at": "2023-11-11T06:58:08.625273Z",
"data_removed": false,
"error": null,
"id": "54kd4flb5sdiepnoqgs7raf2wa",
"input": {
"hed": true,
"sam": true,
"mlsd": true,
"pidi": true,
"canny": true,
"image": "https://replicate.delivery/pbxt/JrCCMJ7WAdjQSIkZUQrUkOmyDeFhkRkgQgH1S3QvryX8Iypg/IMG_7845.jpeg",
"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\nE0000 00:00:1699685889.055007 259 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:1699685889.055045 259 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:1699685889.055053 259 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)\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": 16.501693,
"total_time": 16.477354
},
"output": [
"https://replicate.delivery/pbxt/uw93lneIWuUTMCo5rrKKTTDUAu6XbNImxkZ4hfuwZVMLgN3RA/canny.png",
"https://replicate.delivery/pbxt/zs4XRbOlkxZeZaoZ52xnXe48s18KyBTVf4bfZRJhtfokBs5OC/content.png",
"https://replicate.delivery/pbxt/QhUeh3vdAuU2H6ykifMReU14F6zm4IoeqRfOrCOfDTydDYzdE/face_detector.png",
"https://replicate.delivery/pbxt/hwMZ86nAfbxWXKxAemdIOz6umijHKz7HTUXcVlqnuuuNgN3RA/hed.png",
"https://replicate.delivery/pbxt/JyyRt4DuftzAbyghuqaRjSjhsaNqQF5fbdizkqAdaNQNgN3RA/midas.png",
"https://replicate.delivery/pbxt/IpkTd18fexldvkpJWhYNJQZ5EnukEfIeukLTi1JfpE7wBs5OC/mlsd.png",
"https://replicate.delivery/pbxt/T5HOBsOKHHqMNVTrLeOKci4jGfkyfeSsstGYVwgSglc5A2cHB/open_pose.png",
"https://replicate.delivery/pbxt/hMP1a8Y41vIoHBDEtN02eE6gCT41LXXebtcJh108fwbcAbujA/pidi.png",
"https://replicate.delivery/pbxt/2J93cnvbxxpdMhQbFLWUvsEZcSStPahCj3Ni73GkQhyDYzdE/normal_bae.png",
"https://replicate.delivery/pbxt/lf9Y6I3bBPVRN6a6ffVKlvjqrcxBVoQZnckerKNfnVM9Bs5OC/lineart.png",
"https://replicate.delivery/pbxt/dCeKSeaACpgEuUdemacT4S7YfEBxf44vBE1xsueeg61zHwm7IA/lineart_anime.png",
"https://replicate.delivery/pbxt/fdBSo7qeUFodVU4IP6cnyPOEULcKogpk2DCCTkUZcZUQgN3RA/sam.png",
"https://replicate.delivery/pbxt/Y5S0q7BS7zZ8OxOLTNQ67QBhFsPjiaOzuPRRPcAJoXIEYzdE/leres.png"
],
"started_at": "2023-11-11T06:58:08.600934Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/54kd4flb5sdiepnoqgs7raf2wa",
"cancel": "https://api.replicate.com/v1/predictions/54kd4flb5sdiepnoqgs7raf2wa/cancel"
},
"version": "f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988e"
}
Processing image with canny
Processing image with content
Processing image with face_detector
E0000 00:00:1699685889.055007 259 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:1699685889.055045 259 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:1699685889.055053 259 gl_context.cc:408] INTERNAL: ; RET_CHECK failure (mediapipe/gpu/gl_context_egl.cc:303) successeglMakeCurrent() returned error 0x3008; (entering GL context)
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