{"id":24927,"date":"2024-12-11T10:20:40","date_gmt":"2024-12-11T02:20:40","guid":{"rendered":"https:\/\/www.1ai.net\/?p=24927"},"modified":"2024-12-11T10:20:40","modified_gmt":"2024-12-11T02:20:40","slug":"ai%e7%bb%98%e7%94%bb%ef%bc%8c%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e5%9c%a8comfyui%e7%8e%a9%e8%bd%ac%e5%9b%be%e7%89%87%e9%87%8d%e7%bb%98%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/24927.html","title":{"rendered":"AI Painting, Hands-on Image Redrawing Feature at ComfyUI"},"content":{"rendered":"<p>Today we continue to learn<a href=\"https:\/\/www.1ai.net\/en\/tag\/comfyui\" title=\"_Other Organiser\" target=\"_blank\" >ComfyUI<\/a>Official Workflow Case.<\/p>\n<p>After learning that workflow, let's do the same for learning by example.<\/p>\n<p>This will allow us to get up to speed quickly and go further.<\/p>\n<p>Official Tutorial: https:\/\/comfyanonymous.github.io\/ComfyUI_examples\/inpaint\/<\/p>\n<p>Download the text: https:\/\/pan.quark.cn\/s\/46a899c45618<\/p>\n<p><strong>Example of official website<\/strong><\/p>\n<p>The official website sample workflow is as follows: We can import this workflow by dragging this image into the ComfyUI workbench interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24928\" title=\"60e0cfadj00sob4tj000xd000u000dkp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/60e0cfadj00sob4tj000xd000u000dkp.jpg\" alt=\"60e0cfadj00sob4tj000xd000u000dkp\" width=\"1080\" height=\"488\" \/><\/p>\n<p>Note: For those of you who don't have ComfyUI installed, you can read my article<a href=\"https:\/\/www.1ai.net\/en\/24510.html\/\">Want to learn ComfyUI? This article will get you started and get you up to speed!<\/a>\u300b.<\/p>\n<p>Workflow Functionality: The functionality of this workflow is rather simple to describe, it is to remove something from an existing picture and draw another person or object in that position by using a cue word.<\/p>\n<p>Workflow Interpretation:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24929\" title=\"29ea8d22j00sob4vo005cd000u000a7p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/29ea8d22j00sob4vo005cd000u000a7p.jpg\" alt=\"29ea8d22j00sob4vo005cd000u000a7p\" width=\"1080\" height=\"367\" \/><\/p>\n<p>1. the workflow first loads the large model specified in node 1 (512-inpainting-ema.safetensors);<\/p>\n<p>2. Node 3 and node 4 are set up with cue word backup;<\/p>\n<p>3. Then node 2 loads an image and passes the masked portion of node 2 to node 5, which is then given to node 5 to encode the image;<\/p>\n<p>4. Next node 3, node 4, node 5 data through to node 6 to generate Latent (node 6 is the most critical processing is also the most time-consuming);<\/p>\n<p>5. Node 7 converts Latent data into image and gives it to node 8 to save and display;<\/p>\n<p>Node 2 Special Note:<\/p>\n<p>Node 2 is as follows after uploading the image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24930\" title=\"8d16622bj00sob4t7000ud000kb00bap\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/8d16622bj00sob4t7000ud000kb00bap.jpg\" alt=\"8d16622bj00sob4t7000ud000kb00bap\" width=\"731\" height=\"406\" \/><\/p>\n<p>Right button on uploaded pictures, select \" Open in mask editor \"<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24931\" title=\"abd16b6bj00sob4t1000xd000bv00knp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/abd16b6bj00sob4t1000xd000bv00knp.jpg\" alt=\"abd16b6bj00sob4t1000xd000bv00knp\" width=\"427\" height=\"743\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24932\" title=\"355db911j00sob4wa000vd000u000d8p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/355db911j00sob4wa000vd000u000d8p.jpg\" alt=\"355db911j00sob4wa000vd000u000d8p\" width=\"1080\" height=\"476\" \/><\/p>\n<p>Here we can use a brush to cover the areas that need to need to be painted as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24933\" title=\"cab16b7fj00sob50p00b2d000u000ewp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/cab16b7fj00sob50p00b2d000u000ewp.jpg\" alt=\"cab16b7fj00sob50p00b2d000u000ewp\" width=\"1080\" height=\"536\" \/><\/p>\n<p>Once applied, click the button in the lower right corner to save it<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24934\" title=\"e9d06f22j00sob4so000vd000ls00b9p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/e9d06f22j00sob4so000vd000ls00b9p.jpg\" alt=\"e9d06f22j00sob4so000vd000ls00b9p\" width=\"784\" height=\"405\" \/><\/p>\n<p>(click on the right) add a hint queue or ctrl + back) to perform the workflow as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24935\" title=\"0da014bdj00sob4si000sd000u000bpp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/0da014bdj00sob4si000sd000u000bpp.jpg\" alt=\"0da014bdj00sob4si000sd000u000bpp\" width=\"1080\" height=\"421\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24937\" title=\"e80ead2cj00sob4sa001cd000u000h0p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/e80ead2cj00sob4sa001cd000u000h0p.jpg\" alt=\"e80ead2cj00sob4sa001cd000u000h0p\" width=\"1080\" height=\"612\" \/><\/p>\n<p>The execution yielded the expected results, with the position of the smear changed from a bird to a cat;<\/p>\n<p>But if we look closely, we will still notice a light layer like a watermark where the cat is.<\/p>\n<p><strong>deduce many things from one case<\/strong><\/p>\n<p>For example, for this official website example, I wanted to make those gray areas painted in front of me disappear in order to be closer to the background. This is something we currently need to target by example.<\/p>\n<p>In ComfyUI, those areas we painted earlier are called masks, and in terms of drawing-specific terminology, we need to feather out those masks. Below we'll use local redraw to avoid having a watermark-like appearance in front of us.<\/p>\n<p>We'll start by loading an image:<\/p>\n<p>1. Draws a line from the mask, linked to the \"shade plume\", as graphed, and sets a value such as 60:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24936\" title=\"eb501363j00sob4s4000td000ko0095p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/eb501363j00sob4s4000td000ko0095p.jpg\" alt=\"eb501363j00sob4s4000td000ko0095p\" width=\"744\" height=\"329\" \/><\/p>\n<p>2. Drag two lines from the right of the \"favour mask\" to access the \"cover to image\":<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24938\" title=\"d93c99e4j00sob4rx000id000k50069p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/d93c99e4j00sob4rx000id000k50069p.jpg\" alt=\"d93c99e4j00sob4rx000id000k50069p\" width=\"725\" height=\"225\" \/><\/p>\n<p>Also drags a line from the \u201clocal redraw model\u201d using the \u201clocal redraw model\u201d and adds the \u201cload local redraw model\u201d node\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24939\" title=\"93c4f8f5j00sob4ro000pd000ho009lp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/93c4f8f5j00sob4ro000pd000ho009lp.jpg\" alt=\"93c4f8f5j00sob4ro000pd000ho009lp\" width=\"636\" height=\"345\" \/><\/p>\n<p>Linking the images with the Local Redrawing Using Models and the Image Loading<\/p>\n<p>4. Drag out a line from the \"load image\" image and add a node to the image size as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24940\" title=\"7939d5dbj00sob4ri000ud000ic00d1p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/7939d5dbj00sob4ri000ud000ic00d1p.jpg\" alt=\"7939d5dbj00sob4ri000ud000ic00d1p\" width=\"660\" height=\"469\" \/><\/p>\n<p>5. Then drags the line out of the width, height, and adds nodes from the \"Get Image Size\" to generate a multiplier noise, e.g<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24941\" title=\"05df4331j00sob4rc0010d000u000a8p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/05df4331j00sob4rc0010d000u000a8p.jpg\" alt=\"05df4331j00sob4rc0010d000u000a8p\" width=\"1080\" height=\"368\" \/><\/p>\n<p>6. The following modifications were made at the original K sampler, as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24942\" title=\"88e42513j00sob4pl0014d000u000cvp\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/88e42513j00sob4pl0014d000u000cvp.jpg\" alt=\"88e42513j00sob4pl0014d000u000cvp\" width=\"1080\" height=\"463\" \/><\/p>\n<p>A \"VAE encoded local redraw conditions\" node has been added to the front to receive parameters such as positive, negative, and so forth, and to pass the Latin+ positive and negative to the K sampler<\/p>\n<p>7. The final overall workflow is as follows: (mainly to add some local redraw nodes), if necessary, you can drag the following picture directly to the workbench.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24943\" title=\"959d8fc3j00sob4pd001kd000u000l0p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/959d8fc3j00sob4pd001kd000u000l0p.jpg\" alt=\"959d8fc3j00sob4pd001kd000u000l0p\" width=\"1080\" height=\"756\" \/><\/p>\n<p>8. Execute the workflow, the effect is as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24944\" title=\"a4c83865j00sob4p40012d000u000h0p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/a4c83865j00sob4p40012d000u000h0p.jpg\" alt=\"a4c83865j00sob4p40012d000u000h0p\" width=\"1080\" height=\"612\" \/><\/p>\n<p>The resulting image is as follows, with no more of those obnoxious watermark-like things around the kitten.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24945\" title=\"1cb2fcf3j00sob4ox001bd000u000h0p\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/12\/1cb2fcf3j00sob4ox001bd000u000h0p.jpg\" alt=\"1cb2fcf3j00sob4ox001bd000u000h0p\" width=\"1080\" height=\"612\" \/><\/p>\n<p>Overall, the current lift is using some nodes in terms of local redrawing, feathering the masked regions and redrawing the masked regions using a local redraw model, then integrating the image with cue words etc. by encoding the local redraw conditions through the VAE and ultimately handing it over to the K-sampler for processing.<\/p>\n<p><strong>at last<\/strong><\/p>\n<p>Well, we have mastered the redraw function of the image by learning from the previous example on the official website.<\/p>\n<p>And then by way of example, we can remove the obnoxious watermark-like stuff from the official website example.<\/p>\n<p>Through this learning process, we continue to master the use of new plug-ins and techniques, expanding our learning and enhancing our ComfyUI capabilities.<\/p>","protected":false},"excerpt":{"rendered":"<p>Today we will continue to learn the ComfyUI official workflow example. After learning the workflow, we will do the same to learn by example. This will enable us to quickly master and go farther. Official Tutorial: https:\/\/comfyanonymous.github.io\/ComfyUI_examples\/inpaint\/ Download: https:\/\/pan.quark.cn\/s\/46a899c45618 Official Example The official example workflow is as follows: We drag the image to the ComfyUI workbench interface, you can import this workflow. Note: If you don't have ComfyUI installed, you can read my article \"Do you want to learn ComfyUI? This<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[491,1989],"collection":[],"class_list":["post-24927","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","category-baike","tag-ai","tag-comfyui"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/24927","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=24927"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/24927\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=24927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=24927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=24927"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=24927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}