Skip to content

Stable Diffusion Google Colab Continue Directory Transfer Clone Custom Models CKPT SafeTensors

FurkanGozukara edited this page Oct 26, 2025 · 1 revision

Stable Diffusion Google Colab, Continue, Directory, Transfer, Clone, Custom Models, CKPT SafeTensors

Stable Diffusion Google Colab, Continue, Directory, Transfer, Clone, Custom Models, CKPT SafeTensors

image Hits Patreon BuyMeACoffee Furkan Gözükara Medium Codio Furkan Gözükara Medium

YouTube Channel Furkan Gözükara LinkedIn Udemy Twitter Follow Furkan Gözükara

Our Discord : https://discord.gg/HbqgGaZVmr. This is the video where you will learn how to use Google Colab for Stable Diffusion. If I have been of assistance to you and you would like to show your support for my work, please consider becoming a patron on 🥰 https://www.patreon.com/SECourses

Playlist of Stable Diffusion Tutorials, #Automatic1111 and Google #Colab Guides, DreamBooth, Textual Inversion / Embedding, #LoRA, AI Upscaling, Pix2Pix, Img2Img:

https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3

Google colab notebook link: https://colab.research.google.com/github/FurkanGozukara/Stable-Diffusion/blob/main/DreamBooth/ShivamShriraoDreamBooth.ipynb

Transform Your Selfie into a Stunning AI Avatar with Stable Diffusion - Better than Lensa for Free

https://youtu.be/mnCY8uM7E50

Zero To Hero Stable Diffusion DreamBooth Tutorial By Using Automatic1111 Web UI - Ultra Detailed

https://youtu.be/Bdl-jWR3Ukc

Official Stable Diffusion 1.5 Repo : https://huggingface.co/runwayml/stable-diffusion-v1-5

Easiest Way to Install & Run Stable Diffusion Web UI on PC by Using Open Source Automatic Installer

https://youtu.be/AZg6vzWHOTA

How to use Stable Diffusion V2.1 and Different Models in the Web UI - SD 1.5 vs 2.1 vs Anything V3

https://youtu.be/aAyvsX-EpG4

00:00:00 Introduction and the layout of the best Google Colab tutorial

00:00:42 Best settings of Shivam Google Colab Dreambooth training quick-recap

00:01:50 What is Google Colab Stable Diffusion Dreambooth output directory

00:03:24 How to setup Shivam Google Colab DreamBooth training concepts options

00:04:00 Instance data directory setup Shivam Google Colab DreamBooth

00:04:31 Class data directory setup Shivam Google Colab DreamBooth

00:05:02 Used training dataset and how it should be

00:05:13 Training script setup Shivam Google Colab DreamBooth

00:06:26 How to properly set Weights Directory path in Shivam Google Colab DreamBooth

00:08:14 How to generate a ckpt file from Google Colab DreamBooth and download it

00:09:55 Google Colab Stable Diffusion inference, image generation

00:12:27 How to clone / transfer / copy Stable Diffusion Google Colab training into another Gmail account to continue using there

00:19:05 How to use custom ckpt / safetensors files in Google Colab training and image generation

00:23:05 How to indefinitely generate images in Shivam Google Colab and save them in Google Drive

00:24:20 How to use Hugging Face Stable Diffusion directories directly on Google Colab

00:27:14 What are Stable Diffusion diffusers files and how to use them

Generative AI and its Applications

Generative AI is a rapidly growing field in artificial intelligence that focuses on creating new and original data using machine learning algorithms.

Text Transformers:

Text transformers are deep learning models that are trained to generate text. They are based on the transformer architecture, which was introduced in the paper “Attention is All You Need”. Text transformers are trained on large amounts of text data and can be used for various tasks such as machine translation, summarization, and text generation.

UNet:

UNet is a deep learning architecture used for semantic segmentation of images. It was originally developed for biomedical image segmentation but has since been applied to other domains as well. UNet is known for its efficient use of memory and its ability to maintain a high level of accuracy even with limited training data.

Image Generation:

Image generation is a task in generative AI where a model is trained to generate new images based on a given set of input images. This can be used for various applications such as generating realistic images of objects or people, creating new and original art, or enhancing the quality of low-resolution images.

Stable Diffusion:

Stable Diffusion is a generative AI method that creates stable, high-quality results from small amounts of data. It uses a diffusion process to generate new data that is similar to the input data but with variations.

DreamBooth:

DreamBooth is a generative AI platform that allows users to upload a photo and have it transformed into a unique, stylized image. It uses a deep learning model that has been trained on large amounts of data to generate new images that are similar in style to the input image but with new and original details.

Google Colab:

Google Colab is a free, web-based platform for machine learning and data science. It provides users with access to powerful GPUs and TPUs, making it a great resource for training and testing generative AI models. Colab also provides a user-friendly interface, making it easy for anyone to get started with machine learning, regardless of their technical expertise.

In conclusion, generative AI is a rapidly growing field with a wide range of applications. From text generation to image creation, generative AI is changing the way we interact with and create digital data. With platforms like Google Colab, it is easier than ever to get started with generative AI explore its many possibilities.

Video Transcription

  • 00:00:01 Greetings. Everyone, in this video, I am  going to cover the following topics that  

  • 00:00:05 are frequently asked of me. You see the topics  here. So please take a moment, pause the video  

  • 00:00:09 and read them if you want. Let's quickly begin  with the first topic. Quickly remembering the  

  • 00:00:14 best settings for Dreambooth training on  Shivam Google Collab and how to continue  

  • 00:00:18 using previously trained Google Colab model  after a session restart e.g. terminate session,  

  • 00:00:23 close your browser or reconnect later  by setting correct path and executing  

  • 00:00:28 necessary scripts. So you see this is a Google  Colab notebook that I did training yesterday  

  • 00:00:33 by using this tutorial video. This is awesome  tutorial video still up to date and make sure  

  • 00:00:39 that you watched it if you haven't watched  yet. OK so let's begin with reconnecting.  

  • 00:00:47 OK after reconnecting, make sure that you click  here and check whether you have GPU or not because  

  • 00:00:52 Google will provide the GPU for a certain time  for every day. Then let's begin with click install  

  • 00:01:00 requirements. This is something that you have to  do every time that you are going to use Google  

  • 00:01:05 Colab for Stable Diffusion. OK all got installed  and we have no errors and the messages are here.  

  • 00:01:11 You don't need to log in the Hugging Face anymore.  Just skip that part and click xformers. This is  

  • 00:01:16 pretty important to speed up our both training  and image generation and use lesser VRAM. OK it is  

  • 00:01:24 also done. Now it is very important here. We are  checking save to G drive. If you don't check this  

  • 00:01:30 checkbox, then the files won't be saved on your G  drive, Google Drive and you won't be able to use  

  • 00:01:36 them. And this is the model name that we are going  to use. This will download this model from Hugging  

  • 00:01:42 Face official repository. So it will download  the necessary files from this repository from the  

  • 00:01:47 main branch and these files. And this is important  output directory. This is defining where the files  

  • 00:01:56 will be saved. Now I am opening my Google Drive.  Make sure that you are logged into your correct  

  • 00:02:01 email by checking here as you can see. And you see  I have defined Stable diffusion weights OHWX and  

  • 00:02:09 when I open my Google Drive I am going to see that  folder exists in here. You see stable diffusion  

  • 00:02:15 weights. I am entering inside it and you see I am  seeing OHWX. I am entering inside it and there is  

  • 00:02:22 zero and 960. Zero means that initial training  files and 960 means the step that it was trained  

  • 00:02:30 up until the checkpoint saved. So inside here  we will see a bunch of folders. I will explain  

  • 00:02:37 them. OK. Also in the bottom it shows that where  will be this weight saved. This is how you are  

  • 00:02:46 setting your G-Drive path. It starts with content  drive and my drive. This will always be there to  

  • 00:02:57 access your Google Drive folder and this is the  folder it is saved in. So I am clicking this. It  

  • 00:03:02 is important. It will ask me to allow permission  to connect and I will allow and then I will click  

  • 00:03:09 allow and we will see a green check mark here and  it will tell us that we are able to access Google  

  • 00:03:17 Drive files in this Google Colab notebook and  yes, we got a green check mark. So how did I set  

  • 00:03:25 up? instance prompt = photo of OHWX man. OHWX my  rare token, man is my class and these two are my  

  • 00:03:33 auxiliary words and my class prompt is photo of a  man. You should watch transform your selfie into a  

  • 00:03:40 stunning AI avatar video. It is using this Google  Colab and explaining a lot of details and if you  

  • 00:03:46 are wondering and if you want to learn even more  technical details, then you should watch zero to  

  • 00:03:51 hero Stable Diffusion Dreambooth tutorial. It uses  Automatic1111 but I am explaining even more depth  

  • 00:03:57 of Dreambooth training. Instance data directory.  This is the directory where our uploaded training  

  • 00:04:05 data images will be saved. You see this starts  with content instead of starting with content  

  • 00:04:11 drive my drive. Therefore these directory will be  saved in the runtime directory in here and they  

  • 00:04:21 will get erased once we terminate our session.  If you want them to be saved in your Google Drive  

  • 00:04:27 then you should set them like this. I haven't  tried, but it should work actually and the class  

  • 00:04:35 data directory. So this is the directory where the  classification images will be saved. So you can  

  • 00:04:40 also change this like this and it should be saved  in your Google Drive and it should be permanent.  

  • 00:04:47 So this is the setting for training your  face. If you are a woman. Just use woman.  

  • 00:04:52 OK I'm just skipping that part and in here we are  clicking this button to upload our images. I have  

  • 00:04:59 used this image of myself as a training data  set. You see only 12 images. Different poses,  

  • 00:05:05 different clothes, different backgrounds. These  are extremely important to obtain good results.  

  • 00:05:10 And this is the setup for training. So in the  setup, what did I change. I have changed the  

  • 00:05:17 number of class images to 300, sample batch size  as 8 and max train steps as 960. You see this:  

  • 00:05:26 80 epochs, equal to 80 epochs and the same samples  prompt photo of OHWX man: it will save what it has  

  • 00:05:35 learned as a sample. Actually samples are saved  in here and these are the sample images out of  

  • 00:05:41 training. With proper prompting, you can obtain  awesome results based on the model it has learned.  

  • 00:05:48 So you see, you will see the downloading messages  in here and you are. You may get some warning  

  • 00:05:55 messages like here CUDA setup warning and you  can just ignore them. They are working just fine.  

  • 00:06:02 Also this repository is properly maintained by the  Shivam so he is updating whenever it gets broken.  

  • 00:06:08 OK. Now we are skipping the part for weight  training because it is already trained and now how  

  • 00:06:17 am I going to give the director path to generate  images after a restart after we have closed our  

  • 00:06:24 browser and we did start again. So this is weights  directory. In here I am going to enter the path of  

  • 00:06:32 my weights which is going to start with content  drive my drive. OK. I will just manually type for  

  • 00:06:39 you to understand. You are going to use this  path every time to access your Google Drive,  

  • 00:06:45 Google Drive folder and inside here where are  my weights are located. You see stable diffusion  

  • 00:06:53 weights in here. This is the folder weight we got.  I click it, rename and I copied its name. Then the  

  • 00:07:02 weights are saved inside where I am entering in  here. I am also copying this folder name with like  

  • 00:07:10 this. OK and in here the weights are saved in this  folder. This is nine hundred sixty step weights.  

  • 00:07:19 So after training, there happens nine hundred  sixty steps because I did set it like that and  

  • 00:07:25 it will save the weights at that moment because  the save interval is 10K. If you have a big Google  

  • 00:07:31 Drive like 50 gigabytes or one terabyte. Then you  can reduce this save interval to save multiple  

  • 00:07:39 checkpoints during your training and you can then  compare them and how they are working good or not.  

  • 00:07:47 So I am going to provide nine hundred  sixty step like this. Let me show you.  

  • 00:07:53 OK. This is the weights folder. Just click  it and it will set the weights folder like  

  • 00:07:58 this. And now when I click run generate a grid  preview of images from last saved weights it  

  • 00:08:04 should properly generate images. And yes,  it has generated new images. Actually I  

  • 00:08:10 wonder if you can change the prompt here.  OK. It's not necessary. OK. Now this is  

  • 00:08:14 also important. If you want to generate a CKPT  file then we are going to use this. Use this  

  • 00:08:22 and you don't need to check this out. Actually,  it will generate a four gigabyte file if you  

  • 00:08:28 have a space and they will be saved inside our  weights directory which is in here. Let's try it.  

  • 00:08:39 OK. It is done. As you can see there are several  messages and in the bottom we are seeing seeing a  

  • 00:08:45 message CKPT saved at this folder. Let's check it  out and then we will be able to download it. I am  

  • 00:08:53 just refreshing the folder to see it. OK. And it  is still not here. Let's check it out again. OK.  

  • 00:09:00 It should be here actually. Let's also refresh  again. Maybe it will take some time to arrive.  

  • 00:09:07 OK it shows that we are OK. You see it has  arrived. Now I can just right click and download  

  • 00:09:12 it and I can use it inside my Automatic1111 Web  UI by putting that inside the models folder. If  

  • 00:09:21 you don't know how to use automatic 1111 Web UI I  have excellent tutorials for that as well. Let me:  

  • 00:09:26 open the playlist and show you. So in here first  you can watch this easiest ways to install to  

  • 00:09:34 learn how to install it. You can also then watch  this video to learn how to use custom models. And  

  • 00:09:40 I also have other videos for training and other  things. You can check the entire playlist. OK.  

  • 00:09:46 Let's continue. So this is how we generate a CKPT  file to use in Web UI or in other Stable Diffusion  

  • 00:09:53 UIs. And now inference time. It should just  right away work. First we need to click this and  

  • 00:09:59 run this script to install necessary scripts and  you see it is also setting the model path as the  

  • 00:10:06 weights directory. And since we did set weights  directory here, it should just work fine. This  

  • 00:10:11 is how we are setting the weights directly.  This is really important because when we use  

  • 00:10:16 custom models or other things, we are going  to set it manually and then we clone our  

  • 00:10:23 training into a new Google Drive. Then this  is the way we are going to give its path. OK.  

  • 00:10:31 It is completed with a green check mark. It has  given some warnings but you can just ignore them.  

  • 00:10:37 It is working. And this is the seed. This is  something that I am going to hopefully explain  

  • 00:10:42 in the next video. How see it works, how stable  diffusion works, how all of these things are  

  • 00:10:48 working in technical details. So stay subscribed  to watch it. Now we can generate our images. Let's  

  • 00:10:55 just first type photo of OHWX man and let's  see what image we are going to get. This is  

  • 00:11:02 not stylized. This will be a default image. It is  also nice that now Google Colab is showing the GPU  

  • 00:11:09 RAM which is being used with exact values. This is  very nice. OK. It has generated four images of my  

  • 00:11:17 face. They are not very good quality because we  didn't provide any positive prompts and negative  

  • 00:11:22 prompts and let me show you them. Now I will  show you a stylized query and it started using  

  • 00:11:29 more VRAM obviously and it has generated four  samples because we did set it as a four. OK I  

  • 00:11:36 am generating another sample and you are seeing  one 1.5 it per second. Since we are generating  

  • 00:11:42 four samples simultaneously. It is actually 6  it/s which is a very decent speed actually if  

  • 00:11:49 you ask me. OK and if you increase this number,  it will increase your memory VRAM memory usage.  

  • 00:11:58 OK I have applied it by Tomer Hanuka style and  I didn't add any other you see prompts and I  

  • 00:12:06 have just typed some basic negative prompts and  you see it is extremely stylized so there is no  

  • 00:12:12 overtraining. And when you are working with stable  diffusion, you should generate hundreds of images  

  • 00:12:18 to pick the best ones that you like. Now we can  move to the next topic we are going to cover. So  

  • 00:12:24 far we have covered the first two topics. How to  clone your previously trained Google Colab model  

  • 00:12:29 into a different Gmail account to continue using  that if you wish. This is also a very frequently  

  • 00:12:35 asked thing to me. To do that go to the OHWX  and enter inside 960. It may be different in  

  • 00:12:46 you because this is the number of steps you have  trained your model and in here just click here and  

  • 00:12:52 click download. It will zip the files and download  them. Once the download has been completed,  

  • 00:13:00 you will see two files. One will start with  the step count the folder name in my case,  

  • 00:13:06 960 and then you are going to see the diffusion  pytorch model file. This is the UNET file. It is  

  • 00:13:13 not being added inside zip folder so totally you  are going to get like over 4 gigabytes file. Then  

  • 00:13:21 we are going to upload it into a new Google Drive.  First of all, I will just close this instance  

  • 00:13:30 because I will continue from there to do that. I  am just clicking disconnect and delete runtime.  

  • 00:13:38 Then I will log into my other Gmail Google  Drive to upload there. OK I have logged into  

  • 00:13:45 my new drive and how am I going to upload it here.  Now let me show you that. First you are going to  

  • 00:13:51 extract this zip file into a folder. OK I have put  them inside another folder for make it easier to  

  • 00:14:00 see for you. Right click and extract in here. If  you don't have winrar. Then you will have another  

  • 00:14:06 extraction option in Windows. Then we are also  going to put this binary file inside this folder  

  • 00:14:14 and inside here UNET. This is really important  because the Google Colab Shivam code will look  

  • 00:14:21 for this file inside this folder. Then you are  ready. Just upload this into your Google Drive.  

  • 00:14:28 How to do that. Go to your Google Drive and in  here right click and in here click folder upload.  

  • 00:14:36 When you click folder upload, it make you choose  the folder so it is inside here here 960 for me  

  • 00:14:43 and just click upload and it will upload all of  the files. It may take a while depending on your  

  • 00:14:49 uploads speed. OK upload has been completed. Now  let's check out the files. So we are seeing the  

  • 00:14:58 samples, scheduler, text encoder, tokenizer and  inside there we have other files inside UNET you  

  • 00:15:04 see we have the diffusion. Now we are ready to  use the Google Colab in this email. To do that  

  • 00:15:12 I went to the description of the initial video and  clicking the Google Colab in here it will open the  

  • 00:15:18 default. You see the default notebook and in here  I'm just going to file and save a copy in drive.  

  • 00:15:26 It will save a copy in the drive of my new logged  in email. OK now it is saved inside my new email,  

  • 00:15:35 Google Drive. When I check it inside here I should  see Google Colab and you see it is here. Now I  

  • 00:15:42 need to set the directory path as I have just  shown you. So the directory path will be like  

  • 00:15:49 this. Let me show. By the way, if you are going to  make a new training, you need to set it here. But  

  • 00:15:56 if you are not going to make new training, you  just need to set it here. Weights, directory,  

  • 00:16:01 content, my drive and let's copy paste the  path again. So if you put it inside a new path,  

  • 00:16:08 it is just fine. Just click 960. OK. Then yeah,  it is like that. Nothing else because currently  

  • 00:16:20 all of the weights are saved inside 960 folder and  that's it. Just click this button. Currently we  

  • 00:16:28 are not connected and then you will be able to  generate images. But first of course as usual,  

  • 00:16:35 you have to first click install requirements,  install xformers. You don't need these settings  

  • 00:16:40 because you are not going to make another training  or you don't need this concept list as well. You  

  • 00:16:46 just need to set the weights directory. Actually  let's make it to see to show you if it is working.  

  • 00:16:54 OK I am connected just checking I have GPU yes I  am clicking install requirements. OK it is done as  

  • 00:17:02 a next step we are clicking install xformers. It  takes only a couple of seconds. OK it is done. We  

  • 00:17:09 are just going directly to first. But there is one  important thing which is actually we need to click  

  • 00:17:17 this part because otherwise it won't be able to  access our Google Drive. So I am clicking save to  

  • 00:17:24 Google Drive when you double click here, it will  be closed like this and then I am clicking this to  

  • 00:17:30 allow it to access my Google Drive otherwise  you won't be able to. OK just click allow.  

  • 00:17:40 OK now we got a green checkmark and then  we are moving to weights directory. We are  

  • 00:17:46 setting it with clicking here and it is set as  content drive my drive weights directory where  

  • 00:17:52 I have uploaded the weights. Let's continue  to the inference tab. First clicking it here.  

  • 00:18:00 OK in the inference tab we got an error  because it is looking exactly the diffusion  

  • 00:18:06 pytorch model.bin. However, when it is  downloaded from the Google Drive it is  

  • 00:18:11 not exactly named like this. You see  there is also dash and 002. Therefore,  

  • 00:18:17 we need to rename this file. Just click, rename  and remove dash 002. Make it exactly like asked  

  • 00:18:26 in here so it is renamed and then it should  just work fine. I am clicking it again here.  

  • 00:18:35 OK no errors this time, just the same warnings.  Now we should be able to generate our own images.  

  • 00:18:42 Let's try photo of OHWX man, we are still  inside our cloned, new cloned gmail drive.  

  • 00:18:52 OK we got our sample image with just a simple  prompt so it is working exactly as we wanted in  

  • 00:18:58 our new cloned drive. Now we can move to the  next topic: how to generate a ckpt file we  

  • 00:19:05 already showed that and how to generate necessary  files from a ckpt or saved tensor files to upload  

  • 00:19:13 Google Drive and use in Shivam Google Colab. First  of all to doing that, we are going to need to use  

  • 00:19:20 Automatic1111. For demonstration purposes I am  going to use Cheese Daddy's is landscapes mix  

  • 00:19:27 from CIVIT AI .com I am going to download  the safe tensor file and I will generate  

  • 00:19:34 the necessary files by using this file. You can  also use ckpt file. It is just fine and working  

  • 00:19:40 the same way. It is getting downloaded. OK after  the safe tensor file downloaded I did just put it  

  • 00:19:48 inside the model stable diffusion folder in the  Automatic1111. Now we are ready to use it. Let's  

  • 00:19:54 open our Stable Diffusion and let's click refresh  and in here. I will just select that model file.  

  • 00:20:02 OK I just did a test with a simple prompt  beautiful garden. This is the image we got as  

  • 00:20:09 you can see and the model is selected. Then we are  going to use Dreambooth extension. You can install  

  • 00:20:14 it from extensions and in here we are going to  generate a new model to generate necessary files.  

  • 00:20:22 Let's say let's give it a name as gardens. OK and  the source checkpoints will be our new downloaded  

  • 00:20:31 safe tensor file. OK after I did click refresh  it is arrived cheese daddys 30 safetensors and  

  • 00:20:40 OK let's just click create. OK model has been  generated. You see converting UNET, VAE, text  

  • 00:20:47 encoder. So it has generated necessary diffusers  files to use them in our Google Colab. So where  

  • 00:20:53 it is saved. It is saved inside this folder. It  is showing you your installation folder. Models  

  • 00:20:59 Dreambooth, gardens and working. And then I  am entering inside there. So inside models  

  • 00:21:07 DreamBooth in here and in here it is gardens and  in here working. And these are the files that we  

  • 00:21:15 are going to upload into our Google Drive. So I am  going to open my Google Drive and I will just drag  

  • 00:21:21 and drop the folder so it should work like this.  OK it is going to upload everything to there.  

  • 00:21:30 OK so all the files have been uploaded into  working directory since this was the name,  

  • 00:21:36 I will just rename it as test1. OK then we will  restart our session because it is already closed.  

  • 00:21:45 Therefore, just click reconnect. Make sure  that you are using the same Gmail account of  

  • 00:21:52 the Google Drive that you have uploaded. OK  we got our GPU. First install requirements.  

  • 00:21:59 OK next we do install xformers the second step.  

  • 00:22:05 OK third we click settings and run to access  Google Drive otherwise it won't access there.  

  • 00:22:16 OK third step we are setting the directory so  it is inside now test1 directory like this.  

  • 00:22:24 So we are just going to type here test1 and  click hit and it will be saved as the weights  

  • 00:22:30 directory content/Drive/mydrive/test1.  OK inference is here. Just click it.  

  • 00:22:36 OK it is done. We got bunch of warnings but  it should work fine. Now I will execute the  

  • 00:22:42 same command as we did in here. Beautiful garden.  That's it and just hit run. OK we got our image  

  • 00:22:53 exactly same style as we got on Automatic1111  and it is working perfectly fine. Now the next  

  • 00:23:02 thing we are going to do. How to generate images  indefinitely with given prompt and save them in  

  • 00:23:08 a Google Drive folder when using Shivam Google  Colab. To do that, we are going to modify the  

  • 00:23:14 script here. To do that just double click on this  screen. It will open the script folder like this.  

  • 00:23:22 Then we are going to modify this part of script  with this. So it is going to import OS library  

  • 00:23:31 and this is the folder where we want to save.  Let's say OK saved images like this and it will  

  • 00:23:39 save all of the images inside this folder. We also  need to import uuid like this and it should work  

  • 00:23:49 fine. Just lets test it. By the way, this will  indefinitely generate images because it is inside  

  • 00:23:58 a while loop that never ends and let's go into our  drive. OK we got OK saved images in here and they  

  • 00:24:09 will appear there. OK. OK they started to appear.  You see they are getting saved like this. So with  

  • 00:24:16 this script modification, you can indefinitely  generate images and save them. It is so simple.  

  • 00:24:23 OK now the final one of the final things, how to  use Hugging Face Stable Diffusion repositories  

  • 00:24:30 directly on Shivam Google Colab. It is so  easy actually, both for training and both for  

  • 00:24:37 image generation. I will now show you for image  generation and for training. You just need to  

  • 00:24:42 change the model name that we set here. Let me  double click here OK just the setting here. So  

  • 00:24:51 let's open an example. For example, anything v3.  By the way, you have to be careful with that. The  

  • 00:24:58 repository on Hugging Face contains text encoder,  tokenizer, UNET. These are actually the Stable  

  • 00:25:07 Diffusion diffuser files the original training  files. Therefore, if there is only a ckpt file  

  • 00:25:14 or safetensors it may not work. But if there are  tokenizer, UNET and vae it will work. If there  

  • 00:25:20 is only ckpt file you can download it, run the  Automatic1111 and generate a training files and  

  • 00:25:26 upload that as just we did. So I'm just copying  for copy, click here. Let me show zoom. Then  

  • 00:25:34 go to here and paste it here. This will be used  as a base training model if you want to train. If  

  • 00:25:40 you don't want to train, but you need to change  it, go to the inference tab. Actually, go to the  

  • 00:25:47 weights directory tab here and just paste it like  this and I need to click this play button OK it  

  • 00:25:56 is set as this and then I need to click inference  because it will reload the model and you will see  

  • 00:26:04 it is downloading all of the files inside that  repository. This is extremely faster than you  

  • 00:26:11 are uploading your model files, the diffuser  files into your Google Drive and giving its  

  • 00:26:17 path as you can see this is much faster. OK it  is already done, the files are downloaded into  

  • 00:26:23 the temporary drive and then it is loaded. Now  we will be able to generate images based on the  

  • 00:26:33 anything v3 so let's set a another prompt here. OK  I did set as fantastic futuristic tank and you can  

  • 00:26:43 if you double click here it will close the script  part and you see images are now being generated  

  • 00:26:49 and saved in our folder by using anything v3 model  which is one of the very good models on the Stable  

  • 00:27:00 Diffusion right now. I didn't provide any other  negative prompt or positive prompt. Therefore,  

  • 00:27:05 the images are not that much better quality, but  this is certainly from anything v3 model and it  

  • 00:27:11 is working just fine. So as the last thing Stable  Diffusion diffusers actually the Stable Diffusion  

  • 00:27:17 diffusers are the files shown put in here. For  example, this tokenizer JSON and UNET file in here  

  • 00:27:27 it is binary file, it is the raw file or the let's  see vae file in here. As I said I will hopefully  

  • 00:27:35 make another video to explain to you what are vae  or tokenizer, the text encoder and other things.  

  • 00:27:45 OK these are all for today. We have covered all  of the topics here. I hope you have enjoyed and  

  • 00:27:50 learned new stuff. If you like subscribe, leave  a comment I would appreciate that very much. You  

  • 00:27:57 can also join our channel and support us also  if you support us on Patreon I would appreciate  

  • 00:28:03 that very much. Currently we have 15 patrons and  I appreciate them very much. Also I am open to  

  • 00:28:10 consulting services if you are interested in via  Patreon donation. Also, make sure that you join  

  • 00:28:18 our discord channel and ask any questions you have  from there. Hopefully see you in another video.

Clone this wiki locally