(Optional) Uploading a Custom Model
The Stable Diffusion application has default models. To use more custom models, initialize the file system mounted to the custom model in the created application and upload the custom models.
Prerequisites
- FunctionGraph cloud service agencies contain the SWR Admin, VPC Administrator, Server Administrator, SFS FullAccess, and SFS Turbo FullAccess permissions.
- The Stable Diffusion application has been deployed. For details, see Deploying and Using the Stable Diffusion Application.
Step 1: Creating a VPC and Subnet
- Log in to the VPC console and click Create VPC.
- On the Create VPC page, set parameters by referring to Table 1 and retain the default values for other parameters.
Table 1 Configuring the VPC and subnet Category
Parameter
Description
Example Value
Basic Information
Region
Mandatory
Region where the VPC and its subnets are deployed. Currently, the Stable Diffusion application can be deployed only in CN East-Shanghai1.
CN East-Shanghai1
Name
Mandatory.
VPC name. The following requirements must be met:
- Must contain 1 to 64 characters.
- Can contain letters, numbers, underscores (_), hyphens (-), and periods (.).
vpc-fg
IPv4 CIDR Block
Mandatory.
Set the IPv4 CIDR block of the VPC based on the suggestions on the page. When selecting the VPC CIDR block, consider the following two points:
- Number of IP addresses: Reserve sufficient IP addresses for subsequent business growth.
- IP address ranges: Avoid IP address conflicts if you need to connect a VPC to an on-premises data center or connect two VPCs.
192.168.x.x/16
Enterprise Project
Mandatory.
An enterprise project facilitates project-level management and grouping of cloud resources and users. The default project is default.
default
Subnet Setting 1
Subnet Name
Mandatory.
The subnet name. The following requirements must be met:
- Must contain 1 to 64 characters.
- Can contain letters, numbers, underscores (_), hyphens (-), and periods (.).
subnet-fg
AZ
Mandatory.
AZs in the same VPC can communicate with each other over the intranet. AZs are physically isolated from each other. If the service requirements are high, you are advised to select multiple AZs. In this example, one AZ is selected.
AZ1 (center)
IPv4 CIDR Block
Mandatory.
The IPv4 CIDR block of the subnet, which must be within the VPC CIDR block. The mask length of the subnet CIDR block ranges from the mask length of the VPC CIDR block to 29. You can select a value as required.
192.168.x.x/24
- Click Create Now.
Step 2: Creating an SFS Turbo File System
- Log in to Huawei Cloud SFS console, select SFS Turbo, and click Create File System.
- On the Create File System page, set parameters by referring to Table 2. Retain the default values for other parameters. For details about other parameters, see Creating an SFS Turbo file system.
Table 2 File system parameters Parameter
Description
Example Value
Billing Mode
Mandatory.
- Pay-per-use is suitable for flexible usage.
- Yearly/Monthly is ideal when your resource usage duration is predictable.
Select Pay-per-use.
Region
Mandatory.
Region where the file system is deployed. Currently, the AI drawing application can be deployed only in CN East-Shanghai1 and must be in the same VPC as the created VPC.
CN East-Shanghai1
Project
Mandatory.
Region where the project is deployed. Select the default synchronization settings based on the region.
CN East-Shanghai1 (default)
AZ
Mandatory.
The value must be the same as the AZ of the created subnet.
Select AZ1.
Type
Mandatory.
Select the file system type and performance based on the recommended scenario and actual situation. In this example, all file system types are supported. You are advised to select the 250 MB/s/TiB type that is suitable for most application scenarios.
250 MB/s/TiB
Capacity
Mandatory.
Maximum capacity of a single file system. Select a value based on the site requirements. The value must be an integer multiple of 1.2 and in the range from 1.2 to 1023.6.
1.2
Enterprise Project
Mandatory.
The value must be the same as that selected when the VPC is created.
default
VPC
Mandatory.
VPC and subnet to which the file system belongs. Select the VPC and subnet created in Step 1: Creating a VPC and Subnet.
vpc-fg;
subnet-fg(192.168.x.x/24)
Name
Mandatory.
Name of the file system. The following requirements must be met:
- Must start with a letter and contain 4 to 64 characters.
- Only letters, digits, underscores (_), and hyphens (-) are allowed.
sfs-turbo-fg
- After the parameters are configured, click Create Now. Confirm the information and click Submit. Wait until the file system creation task is submitted successfully.
Step 3: Initializing a Custom Model
- Log in to the FunctionGraph console and select CN East-Shanghai1 region. In the navigation pane on the left, choose Applications. Click the name of the application that is successfully created and needs to be initialized.
- On the application details page, click Initialize Custom Model as shown in Figure 1, read the description in the displayed dialog box, select the check box, and click OK.
- In the Initialize Custom Model dialog box, set the following parameters:
- VPC: Select vpc-fg (192.168.x.x/16).
- Subnet: Select subnet-fg (192.168.x.x/24).
- File System Type: Select SFS Turbo.
- File System: Select sfs-turbo-fg.
Retain the default values for other parameters, as shown in Figure 2. After the configuration is complete, click OK.
- Return to the application details page. If the Initialize Custom Model button changes to Upload Model, the initialization is successful. Click Access Application to go to the WebUI. The system automatically creates the directories and files required for application deployment in the file system.
You do not need to perform any operation after logging in to the Stable Diffusion WebUI. This operation is used to load directories and files in the file system for uploading custom models.
Step 4: Uploading and Loading a Custom Model
- Return to the application details page and click Upload Model. The file management page is displayed. The default username and password are admin. Change the password on the setting page after login to ensure data security.
- Table 3 lists some key directories related to the upload of custom models. You can upload model files to the corresponding directories.
- After the upload is complete, return to the Stable Diffusion WebUI. Click the refresh button to load the model or open the WebUI again. After the loading is successful, you can view and select the new model for AI drawing. The loading may take a long time.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot