Welcome to Kleebz Tech, and another video
in our Fooocus for Stable Diffusion series. In this video, I'll be going over the
basics of outpainting with Fooocus. Outpainting with Fooocus allows
you to take an image and expand it, think of it like zooming out from the original
image so you can see what is around the edges. Now, with this video, I will assume you
already have Fooocus installed and know the basic features. If you need information
on those things, I do have other videos in the series that cover all that, and
will include those in the description. I will also be running it with the default
run.bat and settings unless I show otherwise. So, the first thing I'm going to do is actually
just generate an image. I'm going to use quality settings 1024 x 1024, everything else is the basic
settings with the run.bat file. So, I'll go ahead, hit 'generate.' I have a prompt: 'a cat on a
couch in a living room.' I'll hit 'generate.' Okay, so we've got our two cats generated.
Now, one thing I do want to mention is, if you go to use these features for the first
time, it may take longer when you hit that 'generate' button to actually start working. The
reason for that is, it does download models in the background if you haven't used them before.
Fooocus doesn't actually install those right off; they are only downloaded once you go to
use them. So, just keep that in mind. You can always go into the command prompt window
and look to see what's going on there. If, for any reason, it doesn't seem to be doing
anything, go in there and see what's happening. I have my two images. I'm actually going to use
the one on the right, only because it looks like my cat I had as a kid. Once we're ready to do
that, we're going to hit the 'Input Image' down below here, and we're going to go to the
'Inpaint or Outpaint' tab. At this point, we're just going to drag that image down here
to the bottom. I do want to mention, you don't have to just drag from the top; you can bring
in other images you've already generated. Then, you have in the bottom the 'Outpaint Direction.'
These are the settings, the only settings, really, for the outpaint that you need to know.
Everything else in here is for inpainting. So, you have left, right, top, and bottom.
Left means it expands the image to the left, right to the right, top, and then bottom. Keep
in mind, this will change the resolution of the image. It actually adds to it; it doesn't change
the original image. So, when you add to the left, it actually will increase the width of the image,
and when you add to the right, the same thing. Top and bottom, one thing I do recommend is only
doing one of these at a time. You can do them all at once and expand it. My problem with that is,
you'll find that a lot of times you don't like the results of left, right, top, or bottom. So
let's say you do all four of them, and then you don't like two of them. Well, it's going to be
a lot easier if you just do one step at a time. And from my understanding, from what I've read—I
haven't tested this fully—people say that you get better results one at a time. So, let's go
ahead on this one. I'm just going to add to the left at the moment. I'll check off left, and
then I'm just going to go ahead back up here and generate. I could change the prompt if I wanted
to add something to that as well as it expands, but for this, I'm going to leave it the same
because I just want it to fill in the livingroom. Okay, so we have our two images generated.
It looks kind of funky with the tail; it may be confusing the tail with a leg, I'm
not sure, but I'm not going for perfection here. One thing I do want to point out, and
this is one of the important things to keep an eye on, is that you will, and this can
sometimes be fixed later in inpainting or with some other tools, but you will sometimes
see a seam on these images. So, for this one, for example, down here, I can actually see
the seam where it is. But now, of course, I also know where that was; normally, I might not
notice that if I was just looking at this image. This one's a little bit better; it doesn't have
the seam. Of course, the tail looks kind of weird. So, I'm actually going to use this one;
it's not bad. I don't really notice it that much. If I was doing this for more
of my own purposes, for a perfect picture, I probably would just generate more, but for the
video, I'm not going to go ahead and do that. So, we're going to use that image here. Now,
remember, you want to drag this one down, the new image, because if you forget to and
you hit 'generate' again, you're just going to generate new images. Now, we're going to
uncheck left; we're going to check right, because now I want to add to the right of this
image. And I'll go ahead and hit 'generate' again. Okay, so our right-hand side has now been
generated, and you can definitely see there's a difference in the pattern. This one, there is
a slight difference I can notice in a couple of spots, but it's much more difficult to notice, so
I'm going to use this one. I will demonstrate at this point just to give you an example to show
you this. But now you'll see that the actual resolution has been changed as we have widened the
image. So it's become... well, it hasn't changed the central image; it's just adding on to it. It's
not resizing, rescaling, or anything like that. With the outpainting, it's literally just adding
to one side, top, or bottom when you do that. Now, we'll go ahead, and I'm actually going
to now add to the top and the bottom at the same time on this one, just to show you that
it can be done. Yeah, okay, top and bottom, we're going to use this image here. You've
got to remember to drag it down; otherwise, you're going to just regenerate. Now, if you
were to do that, hit 'generate,' you can always go back, pull the image in from your folder, and
just drag it down there. It's not a total loss. Now, we're going to go ahead and
generate from this. Like I said, it's going to add to the top and bottom at this
point. Okay, so we've expanded the top and bottom, and this is actually going to show you
one of the things I want to explain here, why I don't like doing the top and bottom at
the same time. What can happen is, let's say you like the top but you don't like the bottom,
you'll have to regenerate or edit the photo. By doing one section at a time, you can pick and
choose. Now, as you can see on this image, see, there is a seam, there's also this down here,
it didn't get perfect, but you get the idea of how the outpaint works. Just like regular image
generation, you're going to have to do a bunch of different ones. It's not going to always come out
great. You will get images that do come out good, and then other ones that don't. A lot of
trial and error, and just keep generating. Okay, and just one last example I'm going to
show, just to give an idea of how it works. I feel that if I do the all-around, it gives a
more clear picture of how everything works. So, let's go ahead. I have this image that I created
before; we're going to do left, right, top, bottom, just for this example. Now in this, I'm
going to put 'an ancient soldier standing in a dungeon with chains on the wall.' Just want to
demonstrate how this will try to take what the image is and expand using the prompt that we've
added. So, let's go ahead and see what happens. Okay, so we have our images, and of course,
it didn't add chains to one of them, but that's what to expect from Stable
Diffusion; it doesn't always want to listen to what you tell it. But that gives
you an idea of how, by adding to the prompt, I was able to expand that and take that image and
create more with it. Well, that pretty much covers the basics of outpainting. Now, just for fun, I'm
going to go ahead and expand this one more time. If you found this video helpful, please do
consider clicking the like button because it does help. I will have a video on inpainting
coming out very soon. I've actually started working on it, and I was going to be combining
it with this video, but I've decided to break them into two different videos. And any
questions or suggestions for video ideas, please leave a comment. Thanks for
watching, and don't forget that I do have other videos on Fooocus, and I will
have more in the future. Have a great day.