[AI Drawing丨Stable_diffusion Series Tutorial III]—No need to configure the environment | Colab directly runs the Stable Diffusion web UI and imports the lora model from civitai

Table of contents

1. Basic introduction of Google Colab

2. Use of Google Colab

 2.1 Use Google browser to search Google drive

 2.2 Register a Google account, click to go to account login​

2.3 Enter Google drive, click to go to Google Drive

2.4 Create a new Google Colaboratory

2.5 Basic operation method of Google Colaboratory.

Basic operation 1: modify the file name, add code and text blocks, connect to the server

Basic operation 2: Click Modify, Laptop Settings, then you can choose the hardware you want to use, click Save

Basic operation 3: Click connect to reconnect colab

Basic operation 4: Connect Google colab to Google hard disk - Note: You can also use code to mount Google

3. Stable diffusion web ui deployment

4. Model import


1. Basic introduction of Google Colab

  • Google colab is a free Jupyter notebook environment that requires no setup to use and runs entirely in the cloud. and free access to Google's GPU (Tesla K80)'*

Tesla K80

  • 2. Google colab can store your Jupyter notebook in Google's cloud drive. With Google colab, you can write and execute code in the cloud, save and share analysis results, and use powerful computing resources, all of which can be accessed through the browser. Free to use.
  • Note: TZ is required if you want to use Google colab.

2. Use of Google Colab

 2.1 Use Google browser to search Google drive

 2.2 Register a Google account, click to go to account login
  

2.3 Enter Google drive, click to go to Google Drive

insert image description here

insert image description here

2.4 Create a new Google Colaboratory, open

2.5 Basic operation method of Google Colaboratory.

Basic operation 1: modify the file name, add code and text blocks, connect to the server

Basic operation 2: Click Modify, Laptop Settings, then you can choose the hardware you want to use, click Save


Basic operation 3: Click connect to reconnect colab

insert image description here


Basic operation 4: Connect Google colab to Google hard drive - Note: You can also use code to mount Google hard drive

The code is as follows: enter the code into the code box, then click the link that appears below to jump to the verification code. Then enter the verification code into the box below.

from google.colab import drive
drive.mount('/content/drive')

3. Stable diffusion web ui deployment

stable diffusion web ui address

https://github.com/AUTOMATIC1111/stable-diffusion-webui

Find Installation and Running in the project readme , you can use colab online without configuring the environment** (provided you can connect to Google)**
click List of Online Services

Jump to the colab online warehouse maintained by many different people

Online Services · AUTOMATIC1111/stable-diffusion-webui Wiki · GitHubhttps://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services 

Here we choose the second maintained by camenduru

Address:GitHub - camenduru/stable-diffusion-webui-colab: stable diffusion webui colab

 Pull down the readme, and you can see the following table. The differences between the lite, stable, and nightly versions are introduced above. Here, select the stable version in the first line , and click to jump into colab

 You can see the following code. There is only one code block. Before colab runs the code, you must log in to your Google account. If you don’t have an account, use your mobile phone to register one.

Don’t worry after logging in, you need to change the runtime type in the code execution program, so that you can run stable diffusion web ui 

Change to GPU 

 After the change, it can be run (the non-local file will be warned, just choose to still run)


After waiting for a few minutes, you can see that two links have been output. Click the suffix below. It will automatically jump after clicking. Wait for a while to load out

 You can see that the stable diffusion web  ui interface is displayed on the web page

Now you can start AI drawing~
 

4. Model import

 Before loading the lora model for drawing, download the base model ChilloutMix. Click on civitai in the navigation bar

insert image description here

The Stable Diffusion model is an image generation model based on stochastic differential equations. Its core idea is to iterate images through multiple time steps, and finally generate a high-resolution image. This model has good scalability and flexibility, and can generate very realistic images.

The Chilloutmix model is an image generation model based on deep learning, which can generate very beautiful and delicate images. The core idea of ​​this model is to generate images of great artistic value by learning image features and combining a variety of different image generation techniques.

DreamBooth

The Diffusion Model is a generative image generation model based on Generative Adversarial Networks (GANs). This model can take advantage of the competition between the generator and the discriminator to generate very artistic and aesthetic images. This kind of model can train very complex and highly detailed images, making the generated images very realistic and stunning.

The above models may depend on each other, and finally use a LORA training model for secondary training.

LORA training model, LoRA (Low-Rank Adaptation of Large Language Models). It is mainly based on the training results of the above model for secondary training. This model not only retains the language understanding and generation capabilities of the pre-trained model, but also better adapts to the target field or task that is more inclined to the content you want to express.

Some of the inappropriate content is mostly from chilloutmix and Lora [grinning].

 Fill in the information in the order of the following subscripts. What we want to download now is ChilloutMix . ChilloutMix belongs to the Checkpoint type. Check Search by term?, then enter ChilloutMix in the Search Term , and then click get list to search for the ChilloutMix model, and then select The desired version, and then select Model Filename. Both Trained Tags (if any) and Download Url are auto-filled.

insert image description here  

After filling in the information, click 4th - Download Model, and the model will be downloaded in the background, and you can switch back to the colab page to see the download progress.

After the download is complete, refresh and reload the model, and you can switch to the ChilloutMix model you just downloaded in the upper left corner of the page.

Downloading the lora model later is the same method, just change the type to lora, and then search for the term according to the model you want.
insert image description here
See the appropriate model in civitai, you can copy other people's prompt here

civitai website  https://civitai.com/

insert image description here

Paste all into the box where 1 is located, and then click 2 to parse the pasted text and fill it automatically. After filling, click generate to generate the desired picture~ 


Guess you like

Origin blog.csdn.net/baiyefenglin/article/details/130529454