fofr
/
controlnet-preprocessors
Canny, soft edge, depth, lineart, segmentation, pose, etc
Prediction
fofr/controlnet-preprocessors:f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988eIDbtzc3d1fjhrgj0cgbsyss4ay28StatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
{ "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 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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.
Install Replicate’s Python client library:pip install replicate
Import the client: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.
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": "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.
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" }
Generated inProcessing 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
Prediction
fofr/controlnet-preprocessors:f6584ef76cf07a2014ffe1e9bdb1a5cfa714f031883ab43f8d4b05506625988eID54kd4flb5sdiepnoqgs7raf2waStatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
{ "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 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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.
Install Replicate’s Python client library:pip install replicate
Import the client: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.
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": "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.
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" }
Generated inProcessing 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
Want to make some of these yourself?
Run this model