Stable Diffusion - Setup and Run Fooocus on Google Colab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hey everyone, Rodney here at Kleebz  Tech. Today, I'm going to show you   how to get started using Fooocus on Google  Colab. Fooocus is a great and easy-to-use   interface for stable diffusion, and for those  who may not have a powerful enough computer,   Google Colab allows you to use it for  free. I have many videos on using Fooocus,   covering everything from prompting to poses and  inpainting. If you're interested, check those out. Now, I will mention that using the free  tier of Google Colab has limitations.   There are no exact limitations, and it could  stop working at any time. When that happens,   it will reset for the next day, and you'll  be able to use it again. There is, of course,   the option to pay for Colab, which  will give you more resources to use. Okay, let's set things up. You will need a  Google account for this, and you'll need to   be signed in. Once you're ready, we're going  to go to the GitHub page for Fooocus. Here,   we start by scrolling down to the Colab section.  I recommend reading the information here. I   don’t use Fooocus on Colab much myself,  so I can't give a detailed experience on   using it in Colab. From my understanding,  it's gotten much better recently. I haven't   run into any issues myself, except for the  obvious disconnect when I run out of usage. Since I don’t have a ton of  experience using it on Colab,   if anybody else does and wants to give  any tips, leave those in the comments. Or,   if there's a better or easier way of doing what  I do, definitely mention it in the comments, as   there are several different ways of doing  certain things that I've found, and I don't   know if what I'm doing is the best. But this  will get you up and running, and it does work. The first thing we want to do after we've gone  over everything is click on the 'Open in Colab'   link. Once you do this, it will open it  up in Colab, but we don't want to just   use it from here. You could, but if we make any  changes, which I'm going to show you how to do,   they won't save, and you'll have to keep putting  those in. The best way is to click on 'Copy   to Drive'. Now, it may ask you to open it  in a new window; mine didn't this time,   but it did previously. Now we can close that  original one because we're not going to be   using that one. If you want to name it, you can  name it. If I go into my drive here and refresh,   you'll see it's now in my drive. I can  come in here and just click on that. If   we close that up there and boom, just click  on that, and now we're up and running again. At this point, we can just go ahead, hit  the 'Run' button, and everything would run,   and we'd be running Fooocus. I'm going  to show you more information on what   you can do to customize or change some  of those things because you're probably   going to want to do that at some point,  maybe not the first time you run it. The first thing to understand is how this works.  When you hit that 'Run' button, these first four   lines tell it to set up the environment and  it clones Fooocus from GitHub into the folder   on Colab. Every time you go to use this, it  has to go through that process of cloning,   bringing everything in, downloading any models  or anything like that. It doesn't save all that,   so just remember, any folders, any files, those  things will be destroyed, but when it's completely   done, when you're done using it, they won't be  there. The last line tells it to launch Fooocus   with the settings that it has here in the flags.  If you want to change those, if you want to use   just the built-in presets, all you need to do  is go from the GitHub page, you can use these.   For the anime, I'd use the anime one. I'd come in  here, Ctrl+V, I can paste it in there, and now if   I were to launch it, it would launch it with the  anime presets. But even there, what if you want to   use something different? That's what I'm going  to show you how to change this so you can have   it download exactly what you want ahead of time  and not download things that you don't need to. One thing I will mention that I'm  not going to be covering here but if   you wanted to do it so you could set it up  exactly like this and have it just start is   you could set up your own on GitHub,  set up your own Fork of Fooocus with your own presets and everything else, and have it  clone that, and then you wouldn't have to do some   of the steps that I do. But I don't use it enough  to go through that, and I'm not going to cover how   to do that, but that is an option, just to let you  know. I know that is something that can be done. Now, the first thing I do in here is I add a  couple of extra lines. If you up here, you have   the code if I click on that, it'll add multiple  sections of code. I usually start off with about   three. I'm going to copy this, or actually cut  it out of there, and then I'll paste it down in   the bottom one that way I can have it do other  things between here and then I can run that when   I'm ready. When it's done, all that, now the other  thing you can do as well is if you find yourself   using the different presets and you want to have  them set up, you could come in here, grab those,   and I could add another section, put it in here,  paste it, and now, depending on which one I   want to run, when it comes time, I could run the  standard one, or I could run the anime one here. Before I go too far into some of the other  things, let's say I'm going to cover doing   individual things first. So, a lot of the  questions I see people asking is how do   you get a specific checkpoint onto Colab. The  easiest way to do that is to have it download.   You put the code in to download it and to save  it into your folder in Colab when you run it. So,   on this one, I'm going to have it on this line  here is the way I prefer to do it. I've already   got the code set up here from my other account  because you can have multiple Google accounts,   of course. So, in here, I have just the  comment to start off with, and then you,   this is the format that you're going to want,  !wget -O,   then we're going to be putting where we want to  save it. So, if you go into here, well, we haven't   run it yet, so it's not going to show it, but  you'll see it's putting it in the content folder   then Fooocus is where we're cloning it, so in  here, we want it in the content folder in Fooocus,   then in the models folder, then in checkpoints,  and then the file name. That's how you'd set up   the saving of the file, where it's going to  save it, and the name. Then you put a space,   and then we're going to have the actual address  for where we're going to download from. Now,   each one is different. I'm going to cover from  Civit AI. You can do the same from Hugging Face   as well. So, where you get this from, from  Civit AI, so let's go to the Juggernaut page. Now, we're on here, you do not copy just the  address from up top because that's not the address   that you want. If we look here, you'll notice  they're totally different. So, the easiest way   to do this that I find, if you first want to get  the file name to use, you can just click on here,   click download, copy that, hit cancel because  we don't want to download it onto our computer,   and we can go into here, and that's where I would  paste in the file name. I could just paste it in   there, or you can just type it in, up to you. And  then in here, we go on the download button, we   can right-click and copy link address, and we go  in here, I would just go ahead and paste it, and   that's it. Now, when we run that, it's going to go  ahead and download that. So, I'll show you. Let's   get started on here. So, I'm going to go ahead  and start cloning Fooocus to start off with first. Now, remember, each time we do this and run this,  if I come back the next day, I'm going to have to   do this again, and it's going to have to go  through this process again. Now, this usually   only takes maybe 15 to 30 seconds to do in my  experience. Okay, it's completed. So now, Fooocus   has been cloned and it's set up on Colab. If we  go over to our folders here, you'll see there's   a Fooocus folder. See, we're in the content folder  already, and in the Fooocus folder, you have all   the standard stuff for Fooocus in here. And I  will show you, you can interact with these files. Okay, so now that we have it cloned,  if we were to start it now just by clicking on one of these, it'll go ahead and  download what we need for that and download   the default models. But the default models are not  necessarily what we want. So, let's say we wanted   to have other models available to us. Well, we've  now set up this checkpoint, so I can go ahead,   hit run on here. Now, I could add that line  to the initial line as well. That's entirely   up to you. I prefer to have these on separates  because I don't always use the same models. So,   on my other account that I have set up, I  have different checkpoints set up depending on   which one I want to use, and this will take a few  minutes to do because these are very large files. Okay, so it's done downloading. At this point,  it took a few minutes. Now, I'm going to go ahead   and launch this, but I'm going to do it to show  something because even though we have downloaded   our own models, it's still going to go ahead and  download whatever the standard preset model is   set to because that's just how it's set up. But  I'm going to show you how you can avoid that,   but I'm going to show you first what ends up  happening so you understand it because the main   primary preset still has the default preset model  as the Juggernaut version 8, I believe, at the   moment when I'm doing this. So, that's still going  to go and grab that because we haven't changed   that preset. But at this point, it's going to go  ahead and install all the requirements that aren't   on there already. If you want to change, you can  leave this if you want to; it's not going to hurt   it to go through there, but it's going to take  more time to go through downloading everything. Now everything is started and running at the  moment. Looks like now once you have this   up and running, there's going to be multiple  links on here. The link you want to click on   is whatever this link is here, the running  on public URL. So, when we click on that,   and it's going to be the same one that's down  here as well, so we can click on either one   of those. If you have any errors or anything,  you'll see those in here. You'll also notice   this is everything that it did. It went  through and it downloaded everything it   needs, and some of these things,  it will have to do no matter what. Okay, so let's go ahead, and I'll show you what  this looks like when you have it up and running,   just to show that it does work. Okay, we have  Fooocus set up. Go into our advanced Tab,   and now in here, you'll see the models. So, we  still have the version 8 because that was what's   in the preset. We can click on here and change  over now because we also downloaded the other   one. And if we go back into our Colab into the  folders, you'll notice in here, under models,   checkpoints, you have your checkpoints in  here. Now, in theory, I guess, you can,   I don't know if you can upload. I've never tried  uploading a checkpoint by putting it into the   folder. You can actually do that with LoRA.  I'll show you that after that. It doesn't seem   to be a problem. But checkpoints are pretty  large files, so I don't think those easily   will work in my experience by just dropping  them into the folders, but you can edit the   stuff in the folders, and that's what I'm going  to show you after to change a couple of things. So now that I've shown you how this works when  you run it, I'm going to show you how to stop it,   and then I'll go and show you some more  things that you can edit and change to   make it a little bit easier when using it.  So, to stop this while this is running,   you'll notice this circle keeps on going  because that means that code is still running.   So, we can just hit the stop button here, and  it'll go ahead and stop that. So, that's done.   I like to clean that up. I'll close those. Oh,  I know that's already been done, so I don't need   that in there anymore, and we can close that up  at the moment because we don't need to see that. Okay, now for LoRAs, how do you install those?  Well, it's the same idea. I sometimes get errors   where it won't allow it, unauthorized, so I'll  show you two ways of doing the LoRAs. One way   is the same way as the checkpoints. So, you  could have you download the LoRAs that you   need by clicking on the button. That's one  way that I do it because a lot of times I'm   not using all the different LoRAs, so there's  no reason to download them, as you know. So, I put them on different lines, so whichever  ones I need, I can just click on the button   and go ahead and install those for that  session because between each session,   you have to go through and download each thing. Now, the same idea, the same format where  you're going to save it, is going to be   slightly different because you're putting it in  the LoRA folder. You go into the download, you   right-click on it, and copy the link address, and  then you come in here, and you'd paste it in here.   You can do that from Hugging Face as well. Now, I  do run into sometimes it doesn't. It gives errors   that it didn't download it, but then it ends up  downloading it. So, I'm not entirely sure what   the issue is with that, but worst case, if that  doesn't work, the other option you have, so I'm   going to go into there, and then I want to go into my  models folder, and we're going to find the LoRAs   folder here, and that's where we're going to drag.  We can go in and click on this, and hit upload,   and select the file. The other option is to drag  the LoRA over. So, I could take this, as you can   see down at the bottom, it says, 'drop files to  upload', and OB sessum storage. So, I find the   LoRA folder, I drop, drop it in there, it warns me  that those will be deleted when the runtime when   I stop using it, that's fine, I'm going to hit  okay. Now, this depends on your upload speed. If   you do not have a very fast upload speed, it could  take a while because those files are, you know,   decent size. They're not gigabytes in size as  the checkpoints are, but they are, you know,   decent size, and you can see down here, you'll  see the thing rotating. Now, I do find sometimes   when you drop something in here, you get the  red circle. If that happens, I don't think it's   uploading. That's what happens when I try to put  the checkpoints. I think they're too large. So,   it just won't upload them, and if you don't have  a fast upload, you wouldn't want to do it that way   because it would take forever. So, you're always  better off with checkpoints doing it the way I   showed here. LoRA, if you have your own LoRA,  obviously, you don't have a download link unless   you post it online, then you could do it that way,  but then you'd have to otherwise put them in here. Okay, so ours is now in there, even though it  still says it's uploading. So, we'd have to wait   for that. But those are the two ways you can do  the LoRAs, as I said here, or you can just drop   them into the folder. Now, the other thing that I  do as well, and this is entirely up to you on how   you want to do it, I there's another reason I have  it set up not start Fooocus when I do all this,   and that is because I wanted to clone all these  things before I start it. So, if I wanted to add   wild cards, I could put them in here. If I have  my own custom wild cards now, or any styles,   you want to put those in there before  you start Fooocus because if you don't,   if you put them in there afterward, it won't see  them, and you'll have to restart Fooocus. Now,   that doesn't apply with LoRAs and things. Once  you have the LoRAs or anything in those folders,   you can have it refresh your models, and that  will show up in there, but for the other ones,   they do have to be in there when you start  Fooocus; otherwise, it's not going to see those. So, what I do is I have a preset, my I've  changed the default one that way. I don't   have it download the default models. So, I've  gone in and edited my, I have a specific one,   um, default that I put in here, and so  it's telling it, for example, in this one,   I want to use juggernaut X, the new one, as my default  model, and I don't have the downloads in here,   so it won't download those when I run it,  um, it will download the this one here,   this LoRA because I do want it to download  that, but the other ones I don't. Now, you,   you could put your, your stuff in here as  well, that's up to you how you do it. So,   at this point, all I do is I drop my preset in  here, and that'll replace. If I go into here,   double click on it, open it, I'll see that  it's now replaced the original one, and now my default is going to be the X1. So, now I've  already cloned it, I put in anything like my   presets or anything like that, I want in here, I  put any custom wild cards that I'd like to put in,   any custom Styles. I've changed the preset to use  the X model. So, if I were to Just Launch Fooocus,   the moment this wouldn't work because, well, it  would work, but it wouldn't find that X model. So,   that would be an issue. So, I do need to download  that first before I start Fooocus, and also,   I would need to download any LoRAs that I need  as well. So, I'm going to go ahead and do that. Okay, now I've downloaded the checkpoint,  I've cloned it, I've put in my, my custom   stuff that I want before launching it. Now, if  I wanted to let's say get this LoRA as well,   I could go ahead and do that, or if you have any  other LoRAs, you could add them at this point to   the folders by uploading them as well. And once  that's done, now everything else, those steps are   already complete, and then I go ahead, and I'll  launch the one that I want to launch. As I said,   you can change how you do all this stuff;  it's entirely up to you. I'm just showing you,   this is how I do it. I have a separate folder for  all the stuff I drop in here. It takes me about 30   seconds to put everything in and get everything  up and running, and then I just go ahead,   and I'll launch Fooocus at this point. I do want  to stress it's every time you start a new session,   it is going to have to go through and get all  those requirements that it needs. It does take a,   you know, it can take a few minutes  depending on what it needs to download. Now, if you're ever curious what's going on and  how much your resources are being used, you can   click up here, and it'll show you the resource  usage in here. And when you start hitting those,   maxing those out, you can start having issues.  But I really I've, I've used Fooocus with plenty   of the face swap image prompts, everything else,  all, and I've yet to have it have issues. Now,   in the past, when I tried it, I did have issues,  so I think they've done a lot to improve how it   runs on Colab. And of course, you do have the  option to upgrade to Colab Pro if you want to go   that way as well. I know there are people that  use it on Colab, and there are other services   that run it as well. I like it because it's a free  service I can use on occasions when I need to. Okay, so it looks like it's up and running.  I'll go ahead. I'm going to click on that. Now,   the one thing to keep in mind when you're doing  this is whenever you do this, you have to remember   it's a new session, so if anything hasn't  been already downloaded in the background,   it is going to have to download any of that  stuff while it's doing it. It usually will   tell you down here on the bar that it's actually  downloading something, but the other option as   well is you can always go into your Colab here  and see what's happening in the background. See,   it will show you any of that sort of stuff,  anything that's going on, will be in this window,   and you'll see the resources as you can see  here as it uses more resources. Of course,   you never know when this is going to stop working  when you're going to use up your runtime. So,   do keep that in mind. If you run into issues, go  into here. It'll tell you that it got disconnected   because of your session, you've used Too Much.  Come back the next day, and it should be able you   should be able to use it again. I do have a couple  of Google accounts, so I can always switch between   them, but I don't use in a massive amount,  so I don't usually run into that too often. So now, we have our images now. So, I'll show  you how this works. So, let's say we were to,   um, do the inpainting. What'll happen  is when we go to actually running it,   you're going to see downloading inpainter. So, in  the background, we can see that it's downloading   all those things. Now, that'll only happen  once per session because once it's downloaded,   same as before, they're in these folders.  But when you close the session out,   those will all be deleted. So, the next  time you use it, when you go to IM in   paint or anything else, it will have to  do that again, but it usually only takes a few seconds for those. Now, the one other thing to remember when you're  using in Colab, you can just download the images   as you generate them by clicking up here and  then downloading them. That's the other option,   of course, is to go into here. You want to  remember this because every time you're done   with your session, these folders are going to get  deleted, so you can't come back in here later and   find your images. So, we can go into our output  folder just like you would on a local system,   and you'll find all your images in here. So,  you could go in here and download the individual   files. That's where your outputs are put if  you're ever looking for those. It's the same   as the normal one, um, focus in that regard,  but you can also just click on each image here   and download them as well. And I should get  you started using Fooocus on Google Colab at   this point. You can use Fooocus as you would  normally, and I do have lots of other videos   and different topics related to Fooocus, so  check those out if you have not. Hopefully,   you found the video helpful and hit that like  button. And, of course, I always appreciate   anyone buying me a cup of coffee or donating.  Thanks for watching, and have fun creating.
Info
Channel: Kleebz Tech AI
Views: 2,484
Rating: undefined out of 5
Keywords: stable diffusion tutorial, stable diffusion, stable diffusion secrets, fooocus tutorial, foocus, stable diffusion ai, stable diffusion xl, stable diffusion video, fooocus ai tutorial, inpainting denoise strength, inpainting stable diffusion, fooocus ai, fooocus colab, fooocus colab tutorial, fooocus colab setup, fooocus colab free, fooocus colab pro, install focccus on colab, install fooocus on google colab, stable diffusion colab, colab stable diffusion, public link colab
Id: 07elsLQU6ho
Channel Id: undefined
Length: 22min 33sec (1353 seconds)
Published: Mon Apr 22 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.