{"id":15557,"date":"2024-07-14T10:27:37","date_gmt":"2024-07-14T02:27:37","guid":{"rendered":"https:\/\/www.1ai.net\/?p=15557"},"modified":"2024-07-14T10:27:37","modified_gmt":"2024-07-14T02:27:37","slug":"comfyui%e9%9b%b6%e5%9f%ba%e7%a1%80%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%ef%bc%8c%e5%a6%82%e4%bd%95%e6%90%ad%e5%bb%bacontrolnet%e5%b7%a5%e4%bd%9c%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/15557.html","title":{"rendered":"ComfyUI zero-based introductory tutorial, how to build a controlNet workflow"},"content":{"rendered":"<p data-track=\"1\" data-pm-slice=\"0 0 []\">This tutorial is the latest SD in 2024 <a href=\"https:\/\/www.1ai.net\/en\/tag\/comfyui\" title=\"_Other Organiser\" target=\"_blank\" >ComfyUI<\/a><a href=\"https:\/\/www.1ai.net\/en\/tag\/%e5%85%a5%e9%97%a8%e6%8c%87%e5%8d%97\" title=\"[Sees articles with [Introduction] labels]\" target=\"_blank\" >Getting Started<\/a>, designed for beginners, details how to build a controlNet workflow. Through step-by-step guidance, you can easily master the advanced functions of SD ComfyUI and improve your<a href=\"https:\/\/www.1ai.net\/en\/tag\/ai%e7%bb%98%e5%9b%be\" title=\"_OTHER ORGANISER\" target=\"_blank\" >AI Drawing<\/a>precision and creativity.<\/p>\n<p data-track=\"2\">We are<a href=\"https:\/\/www.1ai.net\/en\/tag\/webui\" title=\"_Other Organiser\" target=\"_blank\" >WebUI<\/a>ControlNet is used through plugins, which contain preprocessors and models. In comfyui, we build preprocessors and models separately. Let&#039;s see how to build them.<\/p>\n<p data-track=\"3\">First we load our default workflow<\/p>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"4\">1. Preprocessor<\/h1>\n<p data-track=\"5\">We can add our preprocessor in the blank area as follows<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15560\" title=\"get-459\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-459.jpg\" alt=\"get-459\" width=\"800\" height=\"383\" \/><\/div>\n<p data-track=\"6\">Another way is to install the preprocessor plug-in to add our preprocessor node<\/p>\n<p data-track=\"7\">Controlnet Preprocessor Plug-in:<\/p>\n<ol start=\"1\">\n<li data-track=\"8\">Plugin address: https:\/\/github.com\/Fannovel16\/comfyui_controlnet_aux.git<\/li>\n<li data-track=\"9\">If after installation, running ComfyUI shows that the plugin cannot be imported<\/li>\n<li data-track=\"10\">Please run the &quot;install.bat&quot; file in the &quot;ComfyUI\\custom_nodes\\comfyui_controlnet_aux&quot; directory<\/li>\n<\/ol>\n<p data-track=\"11\">With this plugin, it is easier to manage and add our preprocessors<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15559\" title=\"get-458\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-458.jpg\" alt=\"get-458\" width=\"781\" height=\"622\" \/><\/div>\n<p data-track=\"12\">With the preprocessor node, we drag the load image from the left side of the node<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15558\" title=\"get-457\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-457.jpg\" alt=\"get-457\" width=\"800\" height=\"373\" \/><\/div>\n<p data-track=\"13\">Pull out the preview image on the right, and our preprocessing is now complete. The effect after running corresponds to the \ud83d\udca5 button in our webui<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15562\" title=\"get-461\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-461.jpg\" alt=\"get-461\" width=\"800\" height=\"330\" \/><\/div>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"14\">2.ControlNet Model<\/h1>\n<p data-track=\"15\">Then we sort out the logic. After the image is processed by the canny preprocessor, we should send it to the canny model corresponding to the controlnet. So we load it as shown below<a href=\"https:\/\/www.1ai.net\/en\/tag\/controlnet\" title=\"[See article with [ControlNet] label]\" target=\"_blank\" >ControlNet<\/a>Model, remember to select the model corresponding to canny.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15561\" title=\"get-460\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-460.jpg\" alt=\"get-460\" width=\"800\" height=\"494\" \/><\/div>\n<p data-track=\"16\">We see a node on the right side of the loaded controlnet model. Drag it out and select the controlnet application. Does this look familiar to you? It is very similar to the controlnet control strength in WebUI. The image node on the right receives the node after canny preprocessing.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15563\" title=\"get-462\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-462.jpg\" alt=\"get-462\" width=\"756\" height=\"453\" \/><\/div>\n<p data-track=\"17\">We are looking at the conditions on the right. The ControlNet application will process the conditions and add the control information currently extracted by ControlNet. So we need to connect them to the output conditions of the &quot;CLIP Text Encoder&quot; node.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15565\" title=\"get-464\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-464.jpg\" alt=\"get-464\" width=\"776\" height=\"729\" \/><\/div>\n<p data-track=\"18\">The output condition on the left is linked to the positive condition of the K sampler (positive prompt word)<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15564\" title=\"get-463\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-463.jpg\" alt=\"get-463\" width=\"800\" height=\"591\" \/><\/div>\n<p data-track=\"19\">The above connections complete the most basic Contnet workflow. The following is the complete workflow.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15566\" title=\"get-465\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-465.jpg\" alt=\"get-465\" width=\"800\" height=\"495\" \/><\/div>\n<h1 class=\"pgc-h-arrow-right\" spellcheck=\"false\" data-track=\"20\">Multiple controlnet links<\/h1>\n<p data-track=\"21\">We just need to connect another &quot;Controlnet application&quot; in series after the &quot;Controlnet application&quot;, and the rest should be connected to the Controlnet model or the Controlnet preprocessor.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15567\" title=\"get-466\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-466.jpg\" alt=\"get-466\" width=\"800\" height=\"255\" \/><\/div>\n<p data-track=\"22\">Supplement: The controlnet application that comes with comfyui is relatively simple. If you want to use advanced Controlnet<\/p>\n<p data-track=\"23\">We can install this extension in the manager<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15568\" title=\"get-467\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-467.jpg\" alt=\"get-467\" width=\"800\" height=\"418\" \/><\/div>\n<p data-track=\"24\">After the installation is complete, we can use the more feature-rich controlnet application. Does this look more similar to the WebUI?<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15569\" title=\"get-468\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/07\/get-468.jpg\" alt=\"get-468\" width=\"800\" height=\"343\" \/><\/div>\n<ol start=\"1\">\n<li data-track=\"25\">Strength: This is what we use to control the weight.<\/li>\n<li data-track=\"26\">Start time: When we are drawing, when does Controlnet start controlling?<\/li>\n<li data-track=\"27\">End time: When we are drawing, when does Controlnet end control?<\/li>\n<\/ol>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial is the latest 2024 SD ComfyUI Getting Started Guide, designed for beginners, and details how to build a controlNet workflow. With the step-by-step guide, you can easily master the advanced features of SD ComfyUI to enhance the accuracy and creativity of AI drawing. We use controlnet in WebUI through plug-ins, which contain preprocessors and models. In comfyui, we build the preprocessor and the model separately, so let's see how to build it First of all, let's load our default workflow 1. preprocessor We can add our preprocessor in the blank area according to the following method There is also a way to install the preprocessor plugin to add our preprocessor<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[541,1989,3467,3494,369],"collection":[],"class_list":["post-15557","post","type-post","status-publish","format-standard","hentry","category-baike","tag-ai","tag-comfyui","tag-controlnet","tag-webui","tag-369"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/15557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=15557"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/15557\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=15557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=15557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=15557"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=15557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}