Hello I'm a Neural Ninja In this video, I will teach you how to use ControlNet Inpaint.
It seems to be more improved than the default inpaint in WebUI. I'm going to use this like a generative fill added to Photoshop this time. The method of use is not much different from the basic inpaint, so you will be able to follow it easily. If you are new to Stable-Diffusion-WebUI or are curious about the settings, please refer to this video in More to help you. I will use the braBeautiful realistic model First open ControlNet Select inpaint-only for the preprocessor and inpaint for the model. Clicking on the new control type makes it easier to select Please activate the controlnet and I will use the image previously created in the Wildcard video for testing. Paint the area to be changed as you would with conventional inpaint.
Change the selected part naturally like Photoshop I'll change the height to 768 I'll set it to 30 steps
Create an image and create it best when it is the same size as 512 I'll create it without prompt settings like Photoshop Please cancel what you painted, and this time I will make and fill in the blanks. I will use Photopea, a free editing tool.
Please select the Photopea tab Please drag and drop the image Press the keyboard shortcut Ctrl+Alt+C I'll add margins on the left and right with the width set to 1536 Add a new layer and move it to the bottom Please select a paint tool
I'll fill the transparent background with white When I paint the mask, I just paint it to make it easier to see.
Click Send to txt2img ControlNet below It's set right like this
I will fill in the image naturally by painting in the blanks. Now that the size is square, I'll type in 512 512
I will create an image When using Colab, if the status of the relay server is bad, check the Colab output window. You can select one of several by increasing the batch count. I'll change it in the ControlNet preprocessor as well.
I'll set it to the newly added inpaint only+lama this time It seems to be much more natural when creating new parts. Comparing the source image, it looks much more natural with lama set.
This time, I'm going to create it by increasing it a little more downwards. Go to Photopea
Press Ctrl+Alt+C to set the height to 2306 Please select the standard above I'll select the background layer below and paint it white. I'll hit Send to txt2img and send it to ControlNet. I'm going to color the white part carefully. Now that the image ratio is 2:3 again, set the size to 512 768 I'll try changing the settings Please select ControlNet is more important
In most cases, I think this option is better than Balanced. I'll change the batch count back to 1 Since the image is created with a fixed 512 pixel resolution, the resolution is very disappointing. As with image creation, you can use hires fix.
I'll set it to UltraSharp denoising 0.4 The image is also well created. There is no way to add a mask image yet, so it is inconvenient to paint directly.
Let's find out how to select more easily using img2img Please go to the Photopea tab Please select the selection tool
Please select an image Click on inpaint selection at the bottom It is moved to img2img, and the image and mask image are selected in the inpaint upload tab. I'll set it up to write like txt2img
to apply the black part Please select inpaint not masked Since you are not going to use the img2img function, please select latent nothing I'll set the sampling step to 30. I'll change the height to 768
I'll set the denoising strength to 1 I'll set up ControlNet as it is. Now let's create an image This is convenient because you don't have to paint the mask yourself. It is a pity that the hires fix cannot be used. It can be applied similarly with the tile resample upscale explained in the previous video.
Click the send img2img button I'll change the settings to use img2img
I will only enter the prompts related to the quality for upscaling. I'll double the size Please disable ControlNet inpaint for a while I'll choose the tile resample of the preprocessor.
I will also choose tile as the model. I'll set the denoising to 0.65 I will create an image I will send the created image to Photopea Please select an image Please press Ctrl+Alt+T to make the image full. Change the layer order on the right and upload the original image Now I'll handle only the border naturally
Please select the eraser tool Please set the size and hardness appropriately erase the border I'll save the edited image In this way, the quality can be corrected to some extent. Now let's add another element.
please go back to img2img Click copy to inpaint I'll change it back to the ControlNet inpaint setting.
Change the size to 512 Please change the denoising to 1 disable tile resample ControlNet and disable inpaint
I'll choose inpaint masked to paint the mask myself. Please select only masked
I'll add a castle I'll erase the wall this time Another wall came out
You can try again, but I'll add a prompt to be more specific. well erased Now let's work with another image
This is a horizontal size image I'll increase the height to 1536 Select an image and click inpaint selection below I'll set the size to 512
Let me re-adjust the settings for ControlNet inpaint. I'll try setting the bottom a bit longer Set the height to 2306 (1.5 * 1536) Select an image and click inpaint selection below I'll edit the height to fit the proportions I'll try to create it again I'll try to create it again I'll edit the prompt and recreate it. looks like it came out well I'll expand it left and right this time
Click on the Photopea tab Click on New File Please enter width 1152 height 768
I will send the image created by img2img to Photopea Select an image and click inpaint selection I'll create it right away I could try a few more times, but this time I'm going to tweak it by typing in the prompt. It seems to be well made Let's add a sailboat to the sea Click send to inpaint I'll choose masked
I'll choose only masked I'll remove the iron bar from the back this time. I'll clear the prompt first
And I'll choose a stick Looks like it's gone One last change to the sailboat Above, I used ControlNet inpaint to follow Photoshop's generative fill function.
I think it's convenient to be able to use it easily regardless of the denoising value (out-painting seems to be better than basic out-painting) I'll see you next time with a good video
thank you [music]