Inpaint
Painting on the image that already exists.
Last updated
Painting on the image that already exists.
Last updated
I would just like to start by covering a couple important things to know.
A lot of this guide assumes you have read through Tools and Functions. Or will reference it when needed.
The Starting Image space has no effect in the paint tab.
The width/height sliders in the menu have no effect in the paint tab.
You can add multiple images, but for now they all get stuck onto the canvas where they are placed. The top-left corner corresponds between the bounding box and image being placed. Until layers are added external editors are the better option Image Editor (GIMP/Photoshop) Assist
Loras will work with the paint tab. Loras
So you got a cool image to generate, but something about it isn't quite right.
Maybe a hand is just a little off. Or there's not enough detail in some places after Upscaling. Maybe you need to add more to the background or subject. With inpainting you can modify one part of an image while leaving the rest of it the same.
To start, import an image onto the canvas.
This can be done by dragging it from a folder, using the import button, or pressing (Ctrl+V) if there's an image on your clipboard
You can use a combination of middle mouse click to move the canvas and image around. For now they are stuck together
Now you can move (V) the bounding box to the location on the image you want to modify.
You can scale it to work on just the space you're working on, especially if it's a really large image.
This bounding box scale is used NOT the width and height sliders in the menu. Those are ignored.
Just be aware that the AI can only see what's inside this box. Everything outside of it may as well not exist.
Keeping important things in 'context' (parts of the image the AI can use for reference), can help get better results.
Once you selected the region you want to edit, use the mask tool (H) and switch to the brush tool (B). Cover the area you want to modify.
Whatever it is you want to change, it's usually fine to leave lots of overlap with the surrounding area.
The only time you don't want to overlap is if trying to keep a very specific detail.
So don't worry about being picky if you don't mind slight changes to background.
When masking, it's recommended you do not to mask up to the edge of the bounding box if there's more image on the other side. Because the AI can't work past the bounding box it creates a seam if you do this. But keeping it back from that edge lets the AI blend the image better.
Enter a prompt for just the stuff you want modified in the mask, using the same conventions you would for a normal prompt Same with settings, use your preferred model and settings
The only setting that needs explanation is Variation Strength. To keep it simple, the more of this you use the less like the original image it will be. It may take a couple of attempts to dial this in.
Personal Variation recommendations |
---|
0.10-0.20 for minor fixes and detail additions 0.33-0.50 for large changes that keep context of the image 0.70-0.99 for random results that don't follow the original image at all |
For this touch up 0.33 should do, there's a lot to add back in. It can also help to do more than one pass, using the new gen as the base for the next. This is called 'loopback'
Much better, but sometimes changes aren't that easy.
If there's things in the image that aren't wanted it might be better to erase (E) them and let the AI try again. Because having the colors of that part will try to gen more of that in the same space. Having nothing will allow for a more varied result.
For this example we'll be changing the extra weird finger. First by it, them masking the area, and applying a moderate amount of variation (0.33) with no prompts.
It may take a couple attempts to get the results desired, and potentially some fiddling around with the variation. But this is much easier than leaving the finger intact and trying to remove without erasing.
The last inpainting method is to simply draw a rough shape of what you want changed. For this example let's try adding a moon to the top corner of the image.
You can select the desired color from the brush tool on the toolbar, or use the color picker (C) to select an appropriate color from the image.
Now simply paint the desired object onto the canvas, mask over it, set the variation higher to get a more drastic change, and prompt for a moon.
And with that, the image is looking much better than at the start of this process.