Ceci est une ancienne révision du document !
In this part of An Introduction to Stable Diffusion, we will learn to manipulate and edit an image we create with Inpainter. I started this article with 2.5.36 and several upgrades have occurred since, and it’s currently 2.5.38. We begin by creating an image – “a photograph of four penguins dancing,” generating 20 images, and selecting the image below. The image generated is something I would like to keep with the exception of the fourth penguin’s beak in the upper right, and I can remove that with Inpainter.
With the cursor on the image, select “Use as input.” Then, in the area below the prompt, you will see the image selected.
Next select Inpaint to the right of the image and the Inpainter window opens.
By default, the Draw option is selected and you are ready to go. You can change the Brush Size, Opacity and Sharpness of the Inpainter brush. Although it works fine by default, you may want to change the Brush Size depending on what you want to remove. You can Erase (erroneously!) if you highlight too much. When satisfied, select the save button at the bottom of the window and close the Inpainter window by clicking on the X in the upper right corner. Then generate new image(s) using the original parameters. The prompt may need to be changed to reflect what is desired in the final image.
The result should be something like what is shown below. As with any manipulation of graphics, the result depends on the limitation of the tools and the skill of the individual.
Using the same image, let's try adding some color. With the cursor over the new image, again select ‘use as input’, but, this time, select Draw instead of Inpaint. This time, you will see typical color and options. Draw is essentially the same as Inpaint except you are adding color rather than removing what already exists. I added some color to the right penguin, saved, and exited.
After generating another 20 images, several look like what I was expecting. I preferred the one on the right, but it has a few artifacts and while you may not see it, there appears to be some text-like addition at the bottom. Depending on the issue, using GIMP or other graphic editor may be easier in removing the unwanted text. Also, because I didn’t paint the entire white area on the front of the penguin, one result had a jagged edge and there seems to be some bleed over onto the next penguin on the second image generated. As with any modification, you may need several attempts to get the desired result.
Next time we will look at Outpainting followed by adding additional models.