Skip to playerSkip to main content
Go beyond standard inpainting! In this tutorial, I demonstrate how to use the "Inpaint Anything" extension for Stable Diffusion. This powerful tool leverages segment-anything models to automatically create precise masks, making complex edits like changing clothes, altering backgrounds, or swapping faces significantly easier.

I walk you through the entire workflow—from segmenting the image and refining your masks to applying specific LoRAs and tuning denoising strength for perfect results.

Original YouTube Tutorial: https://youtu.be/8Fcwhgvqeyk

Video Details:
* Original Publish Date: February 28, 2024
* Focus: Inpaint Anything Extension / Advanced Masking / Segmentation
* Test using RTX 4060 TI 16 GB of VRAM

Follow lordcaocao2025 on Dailymotion for more technical AI research and generative workflow guides!

---
Connect with me:
📺 YouTube: https://www.youtube.com/@CaoCao2025
📱 TikTok: https://www.tiktok.com/@caocao20250
💎 Patreon: https://www.patreon.com/cw/Caocao2025

#StableDiffusion #InpaintAnything #AIArt #Segmentation #ImageEditing #lordcaocao2025
Transcript
00:00hello guys welcome back with me ciao ciao 2025 today we're going to learn
00:04about in-painting anything you can get them from plugin here the extension
00:11simply search for anything here write it and you will find in-painting anything
00:17here not segment anything but in-painting anything simply install it
00:23okay it's still unloaded that is a stwebpin in-painting anything check for
00:29updates if you want
00:32I'll plan to try the UI if it's not showing up try reload UI
00:36okay it's finally showing up in-painting anything okay this thing has ability to
00:46like the usual in-painting but it's so much more let's see the example okay
00:54currently I have this five image I'm going to try this first image first
01:00put it here using the models that is this has a lot of models we need just to
01:07download the model first the difference in this thing is that it help segment the
01:14picture okay download all the models here and already do segment anything here and
01:22the result is this thing for each and every models I used to check what it's going to be so
01:33a segment thing so we just need to decide which of this picture that we're going to use and it's
01:40it's going to automatically mask the thing that we choose so the in-painting will
01:46done automatically but after that we can still edit it the regular way and using in-painting anything we
01:54could actually add and decrease or trim the current mask which you cannot do that in the regular in-painting
02:04I'm going to change the picture into a suit because you know when you see this suit it's
02:15kind of a mess up so we're going to use the sound feed being on wind 5 here yes and
02:22I'm going to make
02:23a new suit and remove this thing because yeah this thing it's stupid so let's run segment anything with
02:34the models that we choose
02:39okay we're done here
02:42so yeah we already have this mask actually
02:48but if you're just creating masks like this it's not going to check anything what you need to do
02:54is to sell it so you could zoom in using as here just click as in your keyboard and check
03:04what you're going to use you simply click only once in every color so for example if I choose this
03:10then
03:11it's gonna select all the color in here but we have different thing here that we want to use here
03:21here here here here here here here and here here
03:32you're going to be part of the new color you don't need to check all these things you know simply
03:39every color just take a line that you're going to use so after you sell it all press r to
03:48zoom out
03:48and then spread the mask now it's gonna block all here but now it's time to expand mask region so
03:58it's gonna spread out and you will see that some area actually also clean we don't want that so use
04:07the
04:07regular mask here select the place let's zoom out
04:20press as zoom out sorry zoom in and then block anything that you don't want to use now let's do
04:27the magic
04:34stream mask
04:35stream mask by its cats and it's going to remove
04:40this something that you cannot do on irregular in painting now we're done with this let's create
04:50the prompt white suit we're going to make it a white suit and then we're going to add advanced option
05:00mask area only so it changes the mask area we can set up the sampler
05:05we're going to make it a little something step don't need to be large you know and i don't forget
05:13to
05:13expand more remember it's better to have some more area that are not
05:19you want to change instead of having less because the ai will know what to change and even if you
05:31like out
05:32of once they will know and will decide what to do sometimes we just not change it into anything
05:42so better to have more than less so expand mass area more after that it is just the same guidance
05:51scale and stuff
05:55and see it you could i do random now let's run in painting and oh yeah let's get download the
06:07models i
06:07forgot to change the model that i use this this model is bad i should use in separate in painting
06:15so
06:16yeah we're going to change the model it's going to download in painting model is better than the regular
06:22model for in painting so in this case they prepare us many in painting models but what we're going to
06:31use
06:32is to separate in painting so wait okay it's done okay still division two in painting it's pretty bad so
06:40we're going to use in separate and fold it's turn out better okay see it's better way better
06:50we could always prepare this maybe run again to have a better randoms or we could send it to in
07:04painting again
07:08okay we could use this let's see it and stuff yeah that's how it works
07:15now we could uh try other image that we have let's add this car
07:24and that was segment let's change this thing we reload you know we remove this no that's all we're
07:35going to do so let's create a mask it's very simple right just the signal expands mass area
07:47and let's remove snow here and we're going to add road try and painting again
08:01your image location will be saving this thing this pc does so simple description whatever ui
08:08output input anything and the date so this is all the thing that we are generating
08:15and we're going to save by clicking this button here download okay we're going to edit more of
08:23this car so let's take the generated image here and put it back to stable diffusion in painting anything
08:35we're going to run segment anything again and this time we're going to change it for 90 days so yeah
08:44we're going to change it for 90 days so yeah
08:56we're going to change it for 90 days so yeah
08:57okay
09:00let's create a mask
09:04but you will expand it you know
09:11there's a lot of empty spot here i guess so expand more
09:21and you could edit manually here
09:26don't worry about getting on the phone on the tree here
09:35they are gonna do something about them
09:42okay let's add knights
09:48and we're going to remove the knight and going to
09:54change it into the blue sky
10:00i don't know it sounds good let's see
10:07yeah it's using the blue sky
10:13and that's that let's do other picture now let's try this
10:20we have to look picture here let's try this thing
10:24one second anything
10:27we could change for example
10:31your hair
10:38let's change the hair hair color that is
10:43so check it check it
10:49let's create a mask
10:52you know in regular thing it's really hard to
10:57get the hair right so this is nice to be very good
11:05yes
11:09add mask here
11:12turn mask region
11:14but if you want you could remove the one below here i guess this is not right
11:23it's not right
11:25yeah
11:28black hair i guess we could do this let's run in painting and see the result
11:34okay we can't wait here i like it but okay it's it's rolling it so yeah we need to remove
11:41this actually
11:44so let's zoom out again we need to remove this
11:52line
11:53let's run the painting again
11:56yeah i know it's better let's do let's do something else with with her
12:03okay this is the other picture
12:05uh second anything
12:09okay this is a bad thing
12:13let's try mobile sim i want to take all the bodies
12:20yeah this is better
12:22we're going to take all the body here and change
12:27her clutch
12:29into something else
12:33but what it is that we're going to use let's brightness first
12:38okay like usual
12:42you know let's expand it like usual
12:46i'm going to change her clutch into something else
12:49this spider woman costume spider black spider man costume yeah
12:56wherever you could use this and let's see the result
13:03yeah it works
13:07now let's edit this black spider man costume
13:11let's edit the background
13:14you know we're going to sell it anything
13:17now like usual expand it maybe we could manually add this
13:23and change the background into rooftop new york city
13:36yeah it's changing all right
13:42okay let's do the last image i guess
13:46aspect to this model again
13:48but it's now we're going to change the face
13:54just select the face here
13:57let's create the mask
14:00let's expand expand and expand
14:05let's change it into any lore that we have
14:08and run in painting here
14:16let's not work like a long tattoo
14:19in painting cannot learn of
14:22i cannot use lore so we use in painting web ui here
14:28instead of the regular in painting the first is just the same
14:32which is using the same mask here
14:36i already added the mask a little and changed the module here to use the
14:39in painting tool we're going to use our lore here
14:45and the setting is like the regular in painting
14:47you could increase or decrease this
14:49like let's use
14:53this thing
14:55and we think i don't scale
14:57seed
14:59and the model is following what you saw on the upper
15:03so let's run in painting here
15:07and yeah the face is changing so it's not that great
15:10but it's working
15:15it's still not great
15:16it's just have big head i don't like the the head it's too big
15:22okay this is great
15:27and we could actually increase the iteration so it more and more looks like what we want
15:33this is great we could also increase the hair you know
15:41so you added the hair too
15:44and maybe eight a little hair here and there
15:58okay hope that helped thank you for watching don't forgot to like and comment
16:01and
16:01you
16:02you
16:04you
16:06you
16:06you
16:06you
16:06you
Comments

Recommended