ComfyUI's ControlNet Auxiliary Preprocessors Plug-and-play node sets for making hint images "anime style, a protest in the street, cyberpunk city, a woman with pink hair and golden eyes (looking at the viewer) is holding a sign with the text "ComfyUI ControlNet Aux" in bold, neon pink" on Flux.1 Dev The code is copy-pasted from the respective folders in and connected to . All credit & copyright goes to . # Updates Go to to follow updates # Installation: ## Using ComfyUI Manager (recommended): Install and do steps introduced there to install this repo. ## Alternative: If you're running on Linux, or non-admin account on windows you'll want to ensure and has write permissions. There is now a you can run to install to portable if detected. Otherwise it will default to system and assume you followed ConfyUI's manual installation steps. If you can't run (e.g. you are a Linux user). Open the CMD/Shell and do the following: - Navigate to your folder - Run - Navigate to your folder - Portable/venv: - Run - With system python - Run - Start ComfyUI # Nodes Please note that this repo only supports preprocessors making hint images (e.g. stickman, canny edge, etc). All preprocessors except Inpaint are intergrated into node. This node allow you to quickly get the preprocessor but a preprocessor's own threshold parameters won't be able to set. You need to use its node directly to set thresholds. # Nodes (sections are categories in Comfy menu) ## Line Extractors | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | Binary Lines | binary | control_scribble | | Canny Edge | canny | control_v11p_sd15_canny control_canny t2iadapter_canny | | HED Soft-Edge Lines | hed | control_v11p_sd15_softedge control_hed | | Standard Lineart | standard_lineart | control_v11p_sd15_lineart | | Realistic Lineart | lineart (or if is enabled) | control_v11p_sd15_lineart | | Anime Lineart | lineart_anime | control_v11p_sd15s2_lineart_anime | | Manga Lineart | lineart_anime_denoise | control_v11p_sd15s2_lineart_anime | | M-LSD Lines | mlsd | control_v11p_sd15_mlsd control_mlsd | | PiDiNet Soft-Edge Lines | pidinet | control_v11p_sd15_softedge control_scribble | | Scribble Lines | scribble | control_v11p_sd15_scribble control_scribble | | Scribble XDoG Lines | scribble_xdog | control_v11p_sd15_scribble control_scribble | | Fake Scribble Lines | scribble_hed | control_v11p_sd15_scribble control_scribble | | TEED Soft-Edge Lines | teed | control_v11p_sd15_softedge (Theoretically) | Scribble PiDiNet Lines | scribble_pidinet | control_v11p_sd15_scribble control_scribble | | AnyLine Lineart | | mistoLine_fp16.safetensors mistoLine_rank256 control_v11p_sd15s2_lineart_anime control_v11p_sd15_lineart | ## Normal and Depth Estimators | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | MiDaS Depth Map | (normal) depth | control_v11f1p_sd15_depth control_depth t2iadapter_depth | | LeReS Depth Map | depth_leres | control_v11f1p_sd15_depth control_depth t2iadapter_depth | | Zoe Depth Map | depth_zoe | control_v11f1p_sd15_depth control_depth t2iadapter_depth | | MiDaS Normal Map | normal_map | control_normal | | BAE Normal Map | normal_bae | control_v11p_sd15_normalbae | | MeshGraphormer Hand Refiner () | depth_hand_refiner | | | Depth Anything | depth_anything | | | Zoe Depth Anything (Basically Zoe but the encoder is replaced with DepthAnything) | depth_anything | | | Normal DSINE | | control_normal/control_v11p_sd15_normalbae | | Metric3D Depth | | control_v11f1p_sd15_depth control_depth t2iadapter_depth | | Metric3D Normal | | control_v11p_sd15_normalbae | | Depth Anything V2 | | | ## Faces and Poses Estimators | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | DWPose Estimator | dw_openpose_full | control_v11p_sd15_openpose control_openpose t2iadapter_openpose | | OpenPose Estimator | openpose (detect_body) openpose_hand (detect_body + detect_hand) openpose_faceonly (detect_face) openpose_full (detect_hand + detect_body + detect_face) | control_v11p_sd15_openpose control_openpose t2iadapter_openpose | | MediaPipe Face Mesh | mediapipe_face | controlnet_sd21_laion_face_v2 | | Animal Estimator | animal_openpose | | ## Optical Flow Estimators | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | Unimatch Optical Flow | | | ### How to get OpenPose-format JSON? #### User-side This workflow will save images to ComfyUI's output folder (the same location as output images). If you haven't found node, update this extension #### Dev-side An array of corresponsding to each frame in an IMAGE batch can be gotten from DWPose and OpenPose using on the UI or API endpoint. JSON output from AnimalPose uses a kinda similar format to OpenPose JSON: For extension developers (e.g. Openpose editor): For API users: Javascript Python ## Semantic Segmentation | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | OneFormer ADE20K Segmentor | oneformer_ade20k | control_v11p_sd15_seg | | OneFormer COCO Segmentor | oneformer_coco | control_v11p_sd15_seg | | UniFormer Segmentor | segmentation |control_sd15_seg control_v11p_sd15_seg| ## T2IAdapter-only | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | Color Pallete | color | t2iadapter_color | | Content Shuffle | shuffle | t2iadapter_style | ## Recolor | Preprocessor Node | sd-webui-controlnet/other | ControlNet/T2I-Adapter | |-----------------------------|---------------------------|-------------------------------------------| | Image Luminance | recolor_luminance | | | Image Intensity | recolor_intensity | Idk. Maybe same as above? | # Examples > A picture is worth a thousand words # Testing workflow Input image: # Q&A: ## Why some nodes doesn't appear after I installed this repo? This repo has a new mechanism which will skip any custom node can't be imported. If you meet this case, please create a issue on with the log from the command line. ## DWPose/AnimalPose only uses CPU so it's so slow. How can I make it use GPU? There are two ways to speed-up DWPose: using TorchScript checkpoints (.torchscript.pt) checkpoints or ONNXRuntime (.onnx). TorchScript way is little bit slower than ONNXRuntime but doesn't require any additional library and still way way faster than CPU. A torchscript bbox detector is compatiable with an onnx pose estimator and vice versa. ### TorchScript Set and according to this picture. You can try other bbox detector endings with to reduce bbox detection time if input images are ideal. ### ONNXRuntime If onnxruntime is installed successfully and the checkpoint used endings with , it will replace default cv2 backend to take advantage of GPU. Note that if you are using NVidia card, this method currently can only works on CUDA 11.8...
js const poseNodes = app.graph._nodes.filter(node => ["OpenposePreprocessor", "DWPreprocessor", "AnimalPosePreprocessor"].includes(node.type)) for (const poseNode of poseNodes) { const openposeResults = JSON.parse(app.nodeOutputs[poseNode.id].openpose_json[0]) console.log(openposeResults) //An array containing Openpose JSON for each frame }
js import fetch from "node-fetch" //Remember to add "type": "module" to "package.json" async function main() { const promptId = '792c1905-ecfe-41f4-8114-83e6a4a09a9f' //Too lazy to POST /queue let history = await fetch(`http://127.0.0.1:8188/history/${promptId}`).then(re => re.json()) history = history[promptId] const nodeOutputs = Object.values(history.outputs).filter(output => output.openpose_json) for (const nodeOutput of nodeOutputs) { const openposeResults = JSON.parse(nodeOutput.openpose_json[0]) console.log(openposeResults) //An array containing Openpose JSON for each frame } } main()
py import json, urllib.request server_address = "127.0.0.1:8188" prompt_id = '' #Too lazy to POST /queue def get_history(prompt_id): with urllib.request.urlopen("http://{}/history/{}".format(server_address, prompt_id)) as response: return json.loads(response.read()) history = get_history(prompt_id)[prompt_id] for o in history['outputs']: for node_id in history['outputs']: node_output = history['outputs'][node_id] if 'openpose_json' in node_output: print(json.loads(node_output['openpose_json'][0])) #An list containing Openpose JSON for each frame