Explains how to download and use checkpoints, which can be considered the brain of image generation AI.
>>>What is a model?
The word model has various meanings, but in Stable Diffusion, the model refers to a machine learning model. This model can be said to be the knowledge and brain of artificial intelligence that has learned the characteristics and structures of all kinds of images uploaded to the Internet around the world.
The model consists of a huge bundle called '.safetensors' that stores the values of weights and biases acquired during the learning process.
The so-called 'base models', Stable Diffusion 1.5, Stable Diffusion 2.1, and Stable Diffusion XL, have a very wide learning range, learning photos and images from all over the world, the styles of old masters, layouts, and aesthetics, as well as the relationship between images and language, so their capacity reaches several gigabytes.
It is difficult to output the image you want to create by simply entering a prompt. For example, if you give a simple instruction such as 'animation-style girl', various animation pictures such as cartoon-style animation or Japanese animation will be output. Therefore, in order to output the image you want to create, you need a setting that controls complex prompts or uncertain elements.
There are several settings and methods to control uncertainty factors, one of which is fine tuning. Chapter 6 explains the contents related to family learning including fine tuning. Here, let's find a model that has been trained in a form that is closer to the image you want to create and use it.
The models distributed by Civitai and Hugging Face are largely divided into the 1.5 series and the SDXL series. The SD 1.5 side seems to consume less memory and has many unique models and LoRAs, but each model is not compatible.
In the case of licenses, not only the model developer but also the user may be responsible. Some model developers are considering model mergers (creating new models by merging the models themselves) and are providing them under different licenses, so please use them in compliance with the usage rules and ethics.
>>>Download the model
First, I will explain the download procedure for a general model. Let's download the Stable Diffusion XL, commonly known as SDXL, which is the base model currently being developed by Stability Ai.
stabilityai/stable-diffusion-xl-base-1.0 https://huggingface.co/stabilityai/stable-diffusion-x1-base-1.0 |
>>>Check the license
Before using a model, check the license. Since the usage rules differ depending on the model being distributed, be sure to check them when downloading. The usage rules for each model can be found on the page where each model is distributed.
SDXL License LICENSE.md - stabilityai/stable-diffusion-xl-base-1.0 at main (huggingface.co) https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md |
SDXL is a high-quality model of Stable Diffusion developed by Stability AI, which has had an explosive impact around the world. SDXL shows excellent performance in depicting three-dimensional space, light, and shadows much more than the existing SD, but it requires larger VRAM. SDXL works without problems on professional computing GPUs with more than 12GB as desktop GPUs, but it is difficult to handle on gaming laptops with less than 8GB of VRAM. It works without problems on GPUs provided by Google Colab, so let's compare and confirm by actually testing it.
How to install a model in Colab or local environment
How to install a model in Colab environment
Open Google Drive and
sd > stable-diffusion-webui > models > Stable-diffsion / Upload the downloaded model file
How to install a model in a local environment
Root StableDiffusion folder / > Data > Models > StableDiffusion / Move or copy the downloaded model file
>>>Download the model from Civitai
I have previously downloaded the model from Hugging Face, but I will introduce how to download the model from another famous site called Civitai. Civitai is a web platform where users can share and download models for Stable Diffusion that they have created themselves.
Civitai
Open Civitai in your browser, select Models on the left side of the top menu, and you will see the models available for download.
Clicking on a model will take you to a detailed page for that model. Here you can see a detailed description of the model.
If you look at the model page of Citvai, there is an icon indicating that there are special restrictions in addition to the general license at the bottom right of the model menu. If you click on it, you can check the content permitted for the model. For example, if you look at the license notation in the photo on the right, it says commercial use allowed, no credit required, no sales of merged models, etc. You must check the scope of use and follow the rules.
>>>There is a link in the top right corner to download the model.
>>> Select the model you want to use
Let's restart the WebUI and check if the model you downloaded and installed is available. You can switch models using the drop-down menu called Stable DIffusion checkpoint in the upper left of the WebUI. Open the drop-down menu and click on the downloaded model name, and the selected model will be loaded.
If the model is large, it may take a long time to load, so please wait without doing any other tasks.
Let's make an image to check if it's loaded normally. If there's no problem, you can freely switch models with this. You can use the model introduced here, or you can find the model you want to use and proceed to the next step.
댓글 없음:
댓글 쓰기