2023-07-07 10:34:04
When retouching pictures, have you ever encountered “It would be better if it was a little more to the left!” “It would be better if it was a wider angle!” Before, I might only find a way to manually P out, but rely on the new Inpaint model launched by Stable Diffusion + ControlNet , in addition to inpainting the picture, it can also be extended to complete the picture (outpaintng)! It’s too strong! Come and see how it works! Catalog preparation material download ControlNet Inpaint Model ControlNet Inpaint Model Please go to HuggingFace to download control_v11p_sd15_inpaint.pth and control_v11p_sd15_inpaint.yaml, put them into the stable-diffusion-webuiextensionssd-webui-controlnet folder. Go back to StableDiffusion WebUI, restart it, if you see the ControlNet v1.1 block and Inpaint Model, it means the installation is complete! Note: If ControlNet has been installed before, it must be updated to ControlNet v1.1 or above to have the inpaint function! Prepare the experimental picture In order to “contrast” the ability of Stable Diffusion to expand outward, I deliberately used the complete picture as a crop to remove the two sides, leaving the central part for AI to complete, and finally compared with the original picture and cut out the two sides. The test diagram on the side uses Interrogate inference prompts. In order to make the diagram more perfect, you can use the built-in Interrogate CLIP or Interrogate DeepBooru in the Stable Diffusion img2img tab to infer prompts from the diagram, and then manually modify it according to the situation, which is faster. The detailed steps are as follows: Drag the image into the source block of the img2img tab and click the orange Interrogate CLIP button on the upper right (DeepBooru is also available, it will be generated as a keyword) Wait for a short calculation time, and the inferred prompt words will appear in Copy in the Positive Prompt input box and use ControlNet Inpaint to Outpaint the basic txt2img settings. Everything is ready, go back to the Stable Diffusion txt2img tab page and start the implementation: Paste the Prompt just now, and add the Negative Prompt Sampling Method appropriately: Select Euler a, because it is calculated The speed of the picture is relatively fast, and it is used for preliminary composition Sampling Steps: First use the preset 20 Width / Hight: set to 784, 512 respectively, the value can be freely selected, but in order for it to be able to do outpainting, the proportion must be different from the original picture! For example, the original image is a vertical format. To make it outpainted into a banner, the width must be set to be larger than the height. Others can be kept as default. ControlNet settings Next, focus on ControlNet settings: Check enable and drag the picture to the source area Preprocessor: Select inpaint_only Model: Select control_v11p_sd15_inpaint Resize Mode: Select Resize and Fill, very important! Because it is necessary for him to fill the blank part, if he chooses wrong, there will be no outpainting!further reading
1688735842
#expand #pictures #outward #Stable #Diffusion #ControlNet #Outpainting