Outils pour utilisateurs

Outils du site


issue194:stable_diffusion

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.

Dans cette partie de mon « Introduction à Stable Diffusion », nous apprenons comment utiliser Inpainter pour manipuler et éditer une image que nous avons créée. J’ai commencé cette série avec la version 2.5.36 et il y a eu plusieurs mises à niveau depuis. Actuellement, c’est à la version 2.5.38. Nous commençons par créer une image : « une photo de quatre pingouins qui dansent » (a photograph of four penguins dancing) en générant 20 images et en sélectionnant l’image ci-dessous. J’aimerais garder l’image générée, à l’exception du bec du quatrième pingouin en haut à droite. Je peux l'enlever avec Inpainter.

Pendant que votre curseur est sur l’image, sélectionner « Use as input. » (Utiliser comme entrée.) Puis, dans la zone sous le prompt , vous verrez que l’image est sélectionnée.

Ensuite, choisissez Inpaint à droite de l’image et la fenêtre d’Inpainter s’ouvre.

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.

Par défaut, l’option Draw (Dessiner) est sélectionnée et vous êtes prêt à commencer. Vous pouvez changer la taille du pinceau (Brush Size), l’opacité et la netteté (Sharpness) du pinceau Inpainter. Bien qu’il fonctionne sans problème avec les réglages par défaut, vous pouvez vouloir changer la taille du pinceau en fonction de ce que vous voulez enlever. Vous pouvez Erase (effacer – faussement !) si vous avez trop surligné.

Quand vous êtes satisfait, sélectionnez le bouton save (enregistrer) en bas de la fenêtre et fermez la fenêtre d’Inpainter en cliquant sur le X dans le coin en haut à droite. Ensuite, générez une ou des nouvelle(s) image(s) avec les paramètres d’origine. Vous aurez peut-être besoin de changer le prompt pour qu’il corresponde mieux à ce que vous désirez dans l’image finale.

Le résultat devrait être quelque chose comme ce qui est montré ci-dessous. Comme c’est le cas de toute manipulation de graphismes, le résultat dépend des limites des outils et de l’habileté de l’individu.

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.

En nous servant de la même image, essayons d’ajouter un peu de couleur. Lorsque le curseur se trouve sur la nouvelle image, sélectionnez « use as input » à nouveau, mais, cette fois-ci, sélectionnez Draw à la place de Inpaint et vous verrez des options et des couleurs typiques. Essentiellement, Draw est la même chose que Inpaint, sauf que vous ajoutez de la couleur au lieu d’enlever celle qui existe déjà. J’ai ajouté des couleurs au pingouin à droite, enregistré mon travail et quitté Draw.

Après la génération de 20 images de plus, il y en a plusieurs qui ressemblent à ce à quoi je m’attendais. Celle de droite avait ma préférence, mais il y a quelques artefacts et, bien que peu visible, il y a un ajout ressemblant à du texte en bas de l’image. Selon le problème, l’utilisation du GIMP ou d’un autre éditeur de graphismes peut être plus facile pour l’élimination du texte de trop. De plus, puisque je n’ai pas peint la zone blanche complète sur le devant du pingouin, un résultat avait un bord irrégulier, et, dans la deuxième image générée, il semble que la couleur a bavé sur le pingouin d'à côté. Comme c’est le cas avec toute modification, vous devrez peut-être faire plusieurs essais avant d’arriver au résultat désiré.

La prochaine fois, nous regarderons Outpainting suivi de l’ajout de modèles supplémentaires.

issue194/stable_diffusion.txt · Dernière modification : 2023/07/03 16:04 de andre_domenech