How to Inpaint in Stable Diffusion A1111, A Detailed Guide with Inpainting Techniques to level up!

Keyboard Alchemist
27 Nov 202318:11

Summary

TLDRIn this video, Keyboard Alchemist demonstrates advanced inpainting techniques using Stable Diffusion. He shows how to add elements like a parrot on a girl's shoulder and transform her arm into a cyborg arm. The tutorial covers installing and using the Photopia extension, refining inpainted images, and leveraging Lora models for specific effects. Detailed steps, parameter settings, and troubleshooting tips are provided to ensure successful image manipulation. Viewers are encouraged to leave comments for future tutorial ideas and to like and subscribe for more content.

Takeaways

  • 😀 You can inpaint new objects, like a parrot on a girl's shoulder, using stable diffusion techniques.
  • 🩜 To install Photopia, go to extensions, click on install from URL, paste the Photopia GitHub link, and install.
  • đŸ–Œïž Use the Photopia extension in automatic1111 for photo editing similar to Photoshop.
  • 🔧 After installing Photopia, keep your extensions up to date by checking for updates and restarting the UI.
  • đŸ’» To edit an image in Photopia, import it from PNG info into image-to-image, regenerate it with low denoising strength, and send it to Photopia.
  • ✂ In Photopia, use the magnet selection tool to cut out the background of the object you want to inpaint, like a parrot.
  • 🎹 Use inpainting techniques to add new elements to an image, ensuring the mask covers the area with some padding for context.
  • 📈 Adjust denoising strength values to ensure the new object blends well with the original image without distortions.
  • đŸŽ© You can also inpaint completely new elements, like a pirate hat, by using fill mode and higher denoising strength values.
  • đŸ€– To inpaint specific parts, like changing an arm to a robotic arm, download and use a LoRA model, adjusting parameters like denoising strength and sampling steps to achieve the desired result.

Q & A

  • What is the purpose of the video?

    -The purpose of the video is to show viewers how to use inpainting techniques in Stable Diffusion to achieve various creative effects, such as adding a parrot to a girl's shoulder or changing a girl's arm into a cyborg arm.

  • What tool does the creator recommend for photo editing within the web UI?

    -The creator recommends using the extension 'photopia,' which is similar to Photoshop and allows for image editing directly within the web UI.

  • How do you install the photopia extension?

    -To install the photopia extension, go to extensions, click on the install from URL tab, copy the photopia GitHub link, paste it into the first field, click install, and wait for the installation to finish.

  • What are the key settings for inpainting a parrot on a girl's shoulder?

    -Key settings for inpainting a parrot include setting masked content to 'original,' using the whole picture setting for inpaint area, and adjusting the denoising strength to a suitable level to merge the parrot seamlessly into the image.

  • How can you improve the inpainting results for a specific area?

    -To improve inpainting results, you can use the XYZ plot script to test a range of denoising strength values and pick the best one, ensuring the new element integrates well without distorting the rest of the image.

  • What method does the creator use to add a pirate hat to the girl?

    -The creator uses the inpaint sketch method, drawing a rough shape of the pirate hat with a mouse, and setting the masked content to 'fill' with a higher denoising strength to generate the hat.

  • What is a 'lora' and how is it used in the video?

    -A 'lora' (low rank adaptation) is a training method to fine-tune a stable diffusion checkpoint for generating specific styles or objects. In the video, it is used to inpaint a robotic arm by downloading a 'real mechanical Parts lora' and applying it to the image.

  • How can you add a preview image to a lora for better organization?

    -To add a preview image to a lora, save an image representative of the lora in the stable diffusion lora folder, renaming it with the same name as the lora file but with a '.preview.png' extension, and refresh the web UI to see the preview.

  • What settings are important for inpainting a robotic arm using a lora?

    -Important settings for inpainting a robotic arm using a lora include setting masked content to 'fill,' inpaint area to 'whole picture,' resize mode to 'resize and fill,' and using a higher denoising strength for better integration.

  • How can you fix inconsistencies in an image after multiple inpainting steps?

    -You can fix inconsistencies in an image by using latent upscaling in the image to image interface, which helps correct minor issues and ensure elements like skin tones are consistent across the image.

Outlines

00:00

🎹 Introduction to Inpainting and Viewer Questions

The host, Keyboard Alchemist, introduces the video and addresses viewer comments about inpainting techniques using stable diffusion. He mentions the possibility of inpainting a parrot on a girl's shoulder and changing a girl's arm into a cyborg arm. The video will demonstrate these techniques in detail, starting with how to inpaint a parrot using the Photopia extension.

05:01

📾 Installing and Using the Photopia Extension

The host guides viewers on how to install the Photopia extension for automatic1111, comparing it to Photoshop for web UI. After installation, he demonstrates regenerating an image with minimal changes and using Photopia to cut out the background of a parrot image. The parrot is then placed on the girl's shoulder, ready for inpainting.

10:04

🩜 Inpainting the Parrot

The process of inpainting the parrot is explained, emphasizing the importance of masking with padding to provide context to the AI model. Different settings such as masked content, inpaint area, and denoising strength are discussed. The host generates several images to find the best seed and denoising strength for a realistic parrot inpainting result.

15:05

👒 Adding a Pirate Hat Using Inpaint Sketch

The host demonstrates adding a pirate hat to the image using inpaint sketch. He sketches the hat and adjusts settings like masked content and denoising strength. The video includes an XY plot to illustrate how these settings affect the inpainted hat's appearance. The host uses latent upscaling to fix any inconsistencies in the final image.

đŸŠŸ Using Loras for Specific Inpainting: Robotic Arm

The video explains how to use Loras (low rank adaptation) to inpaint a specific part of an image, such as turning a girl's arm into a robotic arm. The host details downloading, installing, and using the real mechanical parts Lora, along with tips for organizing Loras and adding preview images. Parameters for inpainting the robotic arm are covered, along with an example of refining the inpainting mask for better results.

🏝 Cleaning Up Background and Final Touches

To remove unwanted elements from the background, the host demonstrates careful masking and inpainting with specific prompts and settings. The video also covers using inpaint sketch to add back missing elements like a tree trunk and final upscaling to improve image quality. The host concludes by encouraging viewers to like and subscribe for more content.

Mindmap

Keywords

💡inpainting

Inpainting is a technique used to fill in or modify parts of an image. In the video, the creator demonstrates how to use inpainting to add a parrot to a girl's shoulder and change the girl's arm into a cyborg arm. This process involves using software tools to seamlessly integrate new elements into an existing image.

💡photopia

Photopia is an extension for automatic 1111 that provides photo editing capabilities similar to Photoshop within a web UI. The video explains how to install and use Photopia to edit images, such as selecting and cutting out the background of a parrot image before integrating it into another image.

💡denoising strength

Denoising strength is a parameter that controls the extent to which the original image is altered during the inpainting process. In the video, different denoising strengths are tested to find the optimal setting for merging the parrot into the image without distorting it. Higher values result in more significant changes.

💡mask

A mask in image editing is used to define the area of the image that should be modified. The video shows how to create and use masks to cover the area where the parrot will be placed, ensuring that the inpainting tool has enough context from the surrounding pixels to generate a cohesive image.

💡dream shaper 7 model

The Dream Shaper 7 model is an AI model used for generating images in the inpainting process. In the video, this model is employed to generate a parrot in the inpainted image, with specific prompts and settings to achieve the desired result.

💡batch generation

Batch generation refers to generating multiple versions of an image simultaneously using different random seeds. The video demonstrates this process to find the best image where the parrot is facing the right direction and integrates well with the background.

💡XYZ plot script

The XYZ plot script is a tool used to test various parameters, such as denoising strength and sampling steps, to find the best combination for image generation. The video uses this script to determine the optimal settings for integrating the parrot into the image.

💡latent upscaling

Latent upscaling is a technique to increase the resolution of an image while maintaining its quality. In the video, this method is used to fix minor inconsistencies and improve the overall cohesion of the inpainted image, ensuring that skin tones and other details match.

💡Lora

Lora (Low Rank Adaptation) is a training method to fine-tune stable diffusion checkpoints for generating specific styles or objects. The video explains how to use a Lora to change a girl's arm into a robotic arm by downloading and applying a specific Lora model designed for mechanical parts.

💡seed

A seed in image generation is a starting point for the random number generator that determines the output of the AI model. The video shows how different seeds can produce different versions of the inpainted image and how selecting the right seed is crucial for achieving the desired result.

Highlights

Introduction to inpainting techniques with Stable Diffusion, including user-submitted ideas such as adding a parrot to a girl's shoulder and changing a girl's arm into a cyborg arm.

Downloading and installing the Photopia extension for automatic1111, which integrates Photoshop-like capabilities into the web UI.

Detailed steps for installing Photopia: go to extensions, click install from URL, paste the GitHub link, and restart the UI.

Using the PNG info to image to image feature to regenerate the original image with minimal changes using a denoising strength of 0.1.

Transferring images between image to image and Photopia to manipulate and edit images more effectively.

Using the magnet selection tool in Photopia to cut out the background of the parrot image and clean up jagged edges with the eraser tool.

Positioning the parrot on the girl's shoulder in Photopia and sending it back to the web UI for inpainting.

Setting masked content to original and inpaint area to whole picture, and generating images with a higher denoising strength to blend the parrot into the image.

Using the XYZ plot script to test different denoising strength values and find the best one for merging the parrot into the image.

Switching to only masked mode in inpainting to improve the parrot's appearance, using the whole picture mode for better integration.

Demonstrating a method for adding new elements, such as a pirate hat, by drawing a sketch in inpaint sketch mode and using a high denoising strength.

Adjusting denoising strength and sampling steps for detailed inpainting results, and using latent upscaling to fix inconsistencies.

Introduction to using luras for specific part inpainting, like transforming an arm into a robotic arm, by downloading and installing a real mechanical parts lora.

Setting up and using a lora in the web UI, including adding keywords to prompts and organizing loras with preview images.

Fine-tuning inpainting results by adjusting mask size, denoising strength, and sampling steps, and addressing background inconsistencies with additional inpainting and sketching.

Final steps for refining and upscaling the image to achieve a cohesive and polished final result.

Transcripts

play00:00

hello everyone keyboard Alchemist here

play00:03

and welcome back to another stable

play00:04

diffusion tutorial I always try to

play00:07

review and answer any comments left by

play00:09

my viewers and a lot of times people

play00:11

will leave some fun ideas for me to try

play00:14

such as I see that you can inpaint

play00:16

something that already exists in the

play00:18

image but what if I want to inpaint a

play00:20

parrot on the girl's

play00:21

shoulder the answer is yes of course you

play00:25

can do that or can I use luras to

play00:27

inpaint a specific part of an image for

play00:30

example changing the girl's arm into a

play00:32

cyborg arm the answer is yes you can do

play00:36

that as well then you might ask okay but

play00:40

how do you actually do it today instead

play00:42

of explaining in words alone I'm going

play00:44

to show you how to use some inpainting

play00:46

techniques to achieve these fun ideas

play00:49

now there are a lot of great ideas that

play00:51

are left in the comments and I can't

play00:53

possibly cover them all in one video but

play00:56

if you like this type of content let me

play00:58

know in the comments and I will I'll try

play01:00

to cover more of them in due time now

play01:02

let's go to the main course for today

play01:05

first let's make the parrot on shoulder

play01:07

picture we need to download an extension

play01:10

called photopia I know it's spelled like

play01:12

Photo NP but people call it photopia I

play01:15

don't know why in any case this is a

play01:17

great photo editing tool for automatic

play01:20

1111 it's just like having Photoshop or

play01:23

built directly in your web UI and

play01:26

you can pass an image back and forth

play01:27

from image to image to photop

play01:30

or vice

play01:32

versa thank you to viewer Steve Warner

play01:34

for pointing me to the extension a few

play01:36

months back here are the steps to

play01:38

install photopia go to extensions then

play01:41

click on the install from URL tab copy

play01:45

the photopia GitHub link I'll leave it

play01:48

in the video descriptions and paste it

play01:51

into the first field here then click

play01:53

install and wait for the installation to

play01:56

finish once the installation is finished

play01:58

go back to the installed tab

play02:00

I like to keep my extensions up to date

play02:02

at all times yes I know it's a disease

play02:04

so I'll click check for updates then

play02:07

apply and restart UI once the web UI

play02:10

restarts you will see the photopia tab

play02:13

at the top okay now let's import the

play02:16

original image from PNG info into image

play02:18

to image we are going to get rid of the

play02:21

positive prompt and only keeping the

play02:22

negative

play02:28

prompts

play02:32

here I'm just trying to regenerate the

play02:34

image with original

play02:37

settings setting the denoising strength

play02:39

very low to 0.1 because I just want the

play02:42

image to be regenerated again with

play02:43

almost no change at

play02:45

[Music]

play02:48

all once the image is regenerated click

play02:51

on this red bird icon to send the image

play02:53

to

play02:54

photopia you can do the following steps

play02:57

in Photoshop or if you are more

play02:59

familiar with those tools but I think

play03:02

photopia is just as easy and when you

play03:05

are done you can click this button to

play03:07

transfer the image back to image to

play03:11

image in photopia what I want to do is

play03:14

to just select the parrot and cut out

play03:16

the background in this image there's

play03:18

more than one way to skin this cat but

play03:20

I'm going to use the magnet selection

play03:22

tool it's okay if the edges are a bit

play03:25

rough right now we don't need to get it

play03:27

perfect when you are done with SEL in

play03:30

the parrot go to select then

play03:32

inverse then do a cut or control X this

play03:36

warning message is telling me that the

play03:37

image needs to be rasterized first so

play03:40

then we can go to layer then

play03:42

rasterize now we can do edit cut again

play03:44

to get rid of the background of the bird

play03:46

image then let's clean this up by

play03:49

erasing some of these Jagged edges

play03:51

deselect or press contrl D then select

play03:54

the Eraser tool you don't have to be

play03:57

super careful or neat about it closeing

play03:59

enough would be just

play04:01

fine oh and don't worry about this piece

play04:04

of wood here in painting we'll take care

play04:07

of all of these little

play04:09

imperfections once you are done with the

play04:11

cleanup move the parrot to a location on

play04:13

her

play04:22

shoulder then we can send this image

play04:24

back to image to

play04:26

image after getting back to the web UI

play04:29

click on inpaint to send it to the

play04:30

inpainting interface let's cover up the

play04:33

parrot with a

play04:34

mask notice that I am leaving some

play04:38

amount of padding on the edges of the

play04:39

parrot meaning my mask is larger than

play04:41

the parrot this is done such that we are

play04:43

giving the AI model some context with

play04:45

the surrounding pixels I am using the

play04:47

dream shaper 7 model to generate the

play04:49

parrot and I will add MAA parrot to the

play04:51

positive prompt the inpaint settings are

play04:54

mostly default settings but pay special

play04:56

attention to the following settings

play04:58

masked content should be set to original

play05:01

because we want the inpainting to stick

play05:03

fairly close to what's underneath the

play05:04

mask we are going to use the whole

play05:07

picture setting for inpaint area this

play05:09

doesn't mean that we will inpaint the

play05:11

whole picture it just means that the

play05:12

model will use the entire picture as

play05:14

reference when it is generating the new

play05:18

image I will generate a batch of four

play05:20

images with random seeds be sure to set

play05:23

the denoising strength to something a

play05:25

bit

play05:26

higher I'm using an arbitrary number of

play05:28

0. 75 here for the first batch but in a

play05:32

little bit I will show you how to pick

play05:34

the appropriate denoising strength value

play05:37

when you are done with all your

play05:38

parameters click

play05:40

generate out of this first batch of

play05:42

images I can tell that we don't have the

play05:44

right seed for our image here because I

play05:46

don't want the parrot to face away from

play05:47

the viewer so let's roll

play05:55

this out of this second batch the first

play05:58

image at least have the parrot facing

play05:59

the right direction so let's use this

play06:01

seed by clicking on the recycle icon and

play06:04

continue on to the next

play06:05

steps I'm going to use the XYZ plot

play06:08

script to test out a range of denoising

play06:10

strength values and pick out the best

play06:12

one for this image oops I forgot to

play06:15

reset the batch count back to one so I

play06:17

interrupted the image generation set

play06:19

batch count to one and then restarted

play06:22

the

play06:23

generation now if you recall from my

play06:26

previous videos a low denoising strength

play06:28

means fewer changes from the original

play06:29

image and the higher the denoising

play06:31

strength the more changes you will see

play06:34

in this case we can see that denoising

play06:36

from 0.15 to 0.35 were not enough to

play06:38

merge the parrot into the image we can

play06:40

still see remnants of the wooden Branch

play06:42

under the parrot's Talons but as the

play06:44

denoising strength increased the wooden

play06:46

branch is gone and the parrot started to

play06:48

look like it is a part of the picture

play06:50

and not just a simple cut and paste job

play06:51

within Photoshop then as we increase the

play06:54

denoising strength past 0.65 we are

play06:57

starting to see distortions in the

play06:58

parrot so this basically means that we

play07:01

can pick a denoising strength value that

play07:02

is somewhere around 0.45 to

play07:07

0.55 in this case I picked

play07:10

0.45 turned off the XYZ plot script then

play07:14

generated another batch of four images

play07:15

with random

play07:17

seeds here I would say if you liked the

play07:19

image that you had with the previous

play07:21

seed you don't have to generate again

play07:23

with a random seed you can just reuse

play07:25

the previous seed and generate your

play07:27

image with 0.45 denois strength but here

play07:30

I just wanted to see what another seed

play07:32

would look like and it turned out pretty

play07:34

good as

play07:36

well I'm going to show you what inpaint

play07:38

area only masked setting looks

play07:44

[Music]

play07:47

like you can see that while in the only

play07:49

mask mode the model is only referencing

play07:51

a portion of the area around the mask to

play07:54

generate the new images as opposed to

play07:56

referencing the whole

play07:57

picture sometimes this will have some

play07:59

drawbacks but in this case because we

play08:02

already have a solid image of the parrot

play08:04

underneath the masked area the result

play08:06

will not stray far from it in fact I see

play08:09

that the parrot's tailin are a bit

play08:10

better with the only masked mode so I'm

play08:13

going to use one of these images for my

play08:15

next

play08:16

steps for this next part we are going to

play08:19

use a different method to impt something

play08:20

new into the picture here is our lady

play08:22

with a pirate on her shoulder but let's

play08:24

say that she is a pirate captain and a

play08:26

pirate Captain will need a hat befitting

play08:28

of her status

play08:30

first send this image with the parrot to

play08:32

inpaint sketch then I'll use a brown

play08:34

color to draw the pirate hat or at least

play08:36

a general shape of the Hat because I

play08:38

suck at drawing with a mouse note the

play08:40

area of your sketch will influence what

play08:42

the inpainted Hat will look like also I

play08:44

didn't do it here but you can totally

play08:46

add some additional patterns or colors

play08:48

to this sketch to Define it a bit

play08:50

more for this method here are the

play08:53

important notes and settings put in

play08:55

pirate hat in your positive prompt for

play08:58

the masked content setting choose the

play09:01

fill option and not the original option

play09:03

since we want to add something

play09:05

completely new to the picture when using

play09:07

the fill option your denoising strength

play09:09

need to be set to a higher value

play09:11

otherwise you will just get some noise

play09:14

here is a XY plot of denoising strength

play09:16

on the x-axis and sampling steps on the

play09:19

Y AIS to illustrate my point we can see

play09:22

that is the denoising strength is too

play09:23

low you will just get this blur in the

play09:26

shape of our sketched hat only when the

play09:28

denoising rength is 055 or higher does

play09:31

the Hat start to materialize we can also

play09:33

see that the sampling steps should not

play09:35

be too low at 20 sampling steps we are

play09:38

not getting enough details in the

play09:42

Hat I like the image at 80 steps and

play09:45

0.75 denoising

play09:47

strength so these were the values that I

play09:50

went with in order to make my picture

play09:53

more cohesive and fix some of the minor

play09:55

imperfections in it I will usually do a

play09:57

latent upscaling in image to image it's

play10:01

fast and easy and it takes care of minor

play10:03

issues in the image and this also

play10:06

answers another question that I got

play10:08

previously someone said after inpainting

play10:11

the skin tone is different doing the

play10:13

latent upscaling would fix any

play10:16

inconsistencies that were introduced by

play10:18

all the inpainting steps and will make

play10:21

sure the skin tone of the body matches

play10:22

the

play10:24

face if you like my videos please click

play10:27

the like And subscribe buttons to help

play10:29

support this channel your likes and

play10:31

subscriptions Are Much appreciated and

play10:33

help me to grow this Channel and

play10:35

continue making quality content thank

play10:39

you okay now let's talk about how to

play10:42

inpaint a specific part of an image like

play10:45

changing the girl's arm into a robotic

play10:47

arm using

play10:48

luras a Laura is short for low rank

play10:51

adaptation it is a Training Method to

play10:53

fine-tune a stable diffusion checkpoint

play10:56

it is a lot smaller in size compared to

play10:58

a checkpoint point and it can be trained

play11:00

relatively quickly ideal for generating

play11:03

consistent Styles objects characters and

play11:05

in our case robot

play11:07

arms to imp paint the robot arm we are

play11:10

going to download this real mechanical

play11:12

Parts Laura from civit AI I will leave a

play11:15

link in the

play11:16

descriptions after downloading the Laura

play11:18

go to your automatic 1111 install folder

play11:21

then the models folder and click on the

play11:23

Laura subfolder if you don't see the

play11:25

Laura subfolder for some reason you can

play11:27

just create a new folder and rename itur

play11:29

Laura then put the real Mech safe tensor

play11:31

file into the Laura

play11:34

folder come back to your web UI and

play11:37

click refresh to see the newly

play11:39

Incorporated Laura we are going to do a

play11:41

few quick things here to make using the

play11:43

Laura a bit easier click on the hammer

play11:45

and wrench icon here and let's add a

play11:48

short description to the Laura

play11:49

properties

play11:53

page usually in order to use a Laura you

play11:56

will need to type a keyword or

play11:57

activation word into your prompt

play11:59

this is not always the case but a lot of

play12:01

lauras do need a keyword to

play12:03

work for this Laura the keyword is real

play12:06

Mech this was noted in the civit AI

play12:09

download page we are adding the keyword

play12:12

in this field so that we don't have to

play12:13

remember to add it to our prompts every

play12:15

time we want to use this Laura there are

play12:17

a lot of lauras out there and this

play12:19

little feature is such a timesaver now

play12:21

click

play12:23

save to use the Laura simply place your

play12:25

cursor in the positive prompt field then

play12:28

click on the icon for the real Mech

play12:29

Laura as we can see the Laura and the

play12:31

keyword we just saved are now both added

play12:33

to our prompt now it is good to

play12:35

go one additional tip before we move on

play12:38

you will likely download a ton of

play12:39

different lauras down the line so in

play12:41

order to organize your collection better

play12:44

I recommend adding a preview image to

play12:45

your Laura here is one method to do it

play12:48

right click on an image that is

play12:49

representative of the Laura then choose

play12:51

save image as in the save image window

play12:54

navigate to your stable diffusion Laura

play12:56

folder the same folder where you have

play12:58

saved this Laura then rename the image

play13:00

using the exact same name as your Laura

play13:02

file here I just copied the name of the

play13:04

original Laura file but changed the file

play13:06

extension to. preview.png note the image

play13:10

has to be saved as a PNG file otherwise

play13:12

it won't work go back to your web UI and

play13:14

click the refresh button to see the

play13:16

preview

play13:17

image okay now back to our main

play13:19

objective I will upload the image of the

play13:21

lady in the blue dress and send it to

play13:22

image to image in paint get rid of the

play13:25

previous positive prompts and add the

play13:27

real Mech Laura and the words robot arm

play13:31

draw a mask at the location where the

play13:32

arm should be as you can see I am just

play13:34

defining the general region so it

play13:36

doesn't have to be very precise to begin

play13:37

with you can always refine it later

play13:40

which is what I did here I didn't like

play13:42

the initial in painting results so I

play13:44

enlarge the mask a bit keep in mind the

play13:47

size and shape of the inpainting Mask

play13:49

will impact how your inpainting results

play13:51

will look the important parameters for

play13:54

this task are as follows set the masked

play13:57

content to fill and set inpaint area to

play14:00

whole picture set resize mode to resize

play14:04

and fill use the width and height of the

play14:07

original image use a random seed and set

play14:10

the denoising strength to a higher

play14:12

value once your parameters are set click

play14:15

generate it's quite interesting if we

play14:17

look at the snapshots of the image

play14:19

generation process here on the right

play14:21

hand side we can see that the AI model

play14:24

is generating a new image that is

play14:25

similar to our original image and then

play14:28

merging the portion of the new image

play14:30

that we have defined with the inpainting

play14:32

mask to our original image therefore if

play14:35

the newly generated image has a

play14:37

different posture or stance than our

play14:39

original image then the inpainting will

play14:41

look a bit off such as in the case of

play14:43

image number two here but if we look at

play14:45

image number three here we can see that

play14:47

the new and the old images matched up

play14:48

pretty well so in this case we want to

play14:50

recycle this seed and try to tweak our

play14:53

other parameters a

play14:56

bit I generated a XY plot of denoising

play14:59

strength versus sampling steps to see

play15:01

which combination provided the best

play15:02

results and in this case I think that 20

play15:05

steps and a denoising strength of 0.85

play15:07

or higher was

play15:11

good taking a look at the other images

play15:14

with higher sampling steps even though

play15:16

the robotic arms looked good the robotic

play15:18

hands were a bit

play15:26

wacky so I went with with 20 sampling

play15:29

steps and one denoising strength now

play15:32

that we have a good robot arm how do we

play15:34

get rid of all this random stuff that

play15:35

was in the background well I must say I

play15:38

was a tad too aggressive with the

play15:39

masking initially so maybe a Slimmer

play15:41

mask would have prevented having so much

play15:43

junk in the background but never fear we

play15:46

can get rid of it just as easily with

play15:47

some more inpainting first we will

play15:50

carefully create a mask to cover all the

play15:52

stuff that we don't want to get to the

play15:54

smaller areas in the image we can zoom

play15:56

in by holding down the alt ke key and

play15:59

scrolling with the mouse wheel thank you

play16:01

to quite a few viewers for telling me

play16:03

about this setting the default key is

play16:06

alt but this can be changed in the

play16:08

settings menu under the canvas hotkeys

play16:11

category plus there are some other

play16:13

hotkeys that are useful in there since

play16:15

the background in this image is a white

play16:17

sandy beach I'm going to change the

play16:19

prompt to white sandy beach then change

play16:22

resize mode to resize and fill batch

play16:25

count to four and seed to random and

play16:27

generate we can see that image number

play16:29

four here did a pretty good job with the

play16:31

beach background but while the in

play16:33

painting did change the background it

play16:35

also cut off a part of the palm tree so

play16:37

I'm going to add that back using inpaint

play16:40

sketch let's send our newly inpainted

play16:43

image to inpaint sketch and sketch out

play16:45

the tree

play16:49

trunk then change the positive prompt to

play16:52

Palm Tree make sure we are using a high

play16:55

enough step count I think 60 steps

play16:57

should do fine

play16:59

make sure we are using the same width

play17:01

and height as the original image and a

play17:04

higher denoising strength such as

play17:07

0.85 then generate a batch of four

play17:10

images with the random

play17:12

[Music]

play17:19

seed we see that image number four is

play17:22

doing a pretty good job of generating

play17:24

the tree trunk so we will take this

play17:26

image and do a final l upscaling to

play17:29

finish the job send this image to image

play17:33

to image and get rid of all positive

play17:35

prompts we can reduce the number of

play17:37

sampling steps to 40 then increase the

play17:39

width and height of the image by about

play17:42

1.2x we don't need the increase to be

play17:44

very large then Den noising strength to

play17:48

0.3 which should be good enough but you

play17:50

can always try out different values with

play17:52

an XY plot and that's it the final image

play17:56

looks pretty good I hope the inpainting

play17:59

techniques that we covered today were

play18:01

helpful for you don't forget to leave a

play18:03

like And subscribe thanks for watching

play18:06

and I will see you in the next

play18:09

video

Rate This
★
★
★
★
★

5.0 / 5 (0 votes)

Étiquettes Connexes
InpaintingImage EditingStable DiffusionPhotopiaLorasTutorialAI ArtPhotoshop AlternativeAutomatic1111Creative Tips
Besoin d'un résumé en anglais ?