Deploying and Using the Stable Diffusion Application
Use the Stable-Diffusion template to create an application and configure the required agency. After the application is created, you can use the built-in default models and temporary domain names.
Step 1: Creating a Cloud Service Agency for FunctionGraph
To deploy a Stable Diffusion application, you need to configure an agency for FunctionGraph to allow it to use other cloud services.
- Log in to the IAM console. In the navigation pane, choose Agencies. On the Agencies page that is displayed, click Create Agency in the upper right corner.
- Set the following parameters:
- Agency Name: Enter serverless_trust.
- Agency Type: Select Cloud service.
- Cloud Service: Select FunctionGraph.
- Validity Period: Select Unlimited.
- (Optional) Description: Enter Stable Diffusion.
- Click OK. The system displays a message indicating that the creation is successful. Click Authorize.
- On the Select Policy/Role page, search for the policies listed in Table 1 as required, select them, and click Next.
Table 1 Policies and related description Policy
Description
Mandatory
SWR Admin
SoftWare Repository for Container (SWR) administrator with full permissions.
Yes
VPC Administrator
(The system will select the Server Administrator system role that the system role depends on. You do not need to manually cancel the selection.)
VPC Administrator: administrator of the VPC service.
Server Administrator: server administrator.
Mandatory for uploading and using a custom model.
SFS FullAccess
Full permissions for SFS
Mandatory for mounting an SFS file system.
SFS Turbo FullAccess
Full permissions for SFS Turbo.
Mandatory for mounting an SFS file system.
- On the Select Scope page shown in Figure 1, select Region-specific projects, select cn-east-3 [CN East-Shanghai1], and click OK.
- After the authorization is successful, click Finish to view the authorization record.
Step 2: Buying a Dedicated Gateway
- Region: CN East-Shanghai1
- AZ: The AZ must be the same as that of the created subnet. In this example, AZ 1 is used.
- Public Inbound Access: In this example, enable the public inbound access. Select the bandwidth as required.
Step 3: Creating an Application Using the Stable Diffusion Template
- Log in to the FunctionGraph console and select CN East-Shanghai1 region. In the navigation pane on the left, choose Applications. In the upper right corner, click Create. The page for selecting a template is displayed.
- As shown in Figure 2, find the AI Drawing Stable-Diffusion template and click Create Application. Read the displayed description carefully, select the check box, and click Agree and Continue.
If the Service Subscription dialog box is displayed, read the description and click Enable Now.
- On the Configure Application page, set application parameters as shown in Figure 3. After setting the parameters, click Create Now in the lower right corner of the page.
- Application Name: Enter a custom name or use the default name.
- Agency: Select the serverless_trust agency created in Step 1: Creating a Cloud Service Agency for FunctionGraph.
- APIG Instance: Select the gateway created in Step 2: Buying a Dedicated Gateway.
- Wait until the application is created. The application contains resources such as functions, API gateways, and triggers, as shown in Figure 4. For details about the key resources of FunctionGraph, see Table 2.
To make it easier for you to experience the feature, a temporary domain name is allocated to you. The temporary domain name can be used only for testing and is valid for 30 days. To allow long-term access to applications, bind a custom domain name. For details, see (Optional) Binding a Custom Domain Name.
Step 3: Using the Default Model and Temporary Domain Name for AI Drawing
- On the application details page shown in Figure 5, click Access Application. The Stable Diffusion WebUI page is displayed. The first cold start takes about 30 seconds. If the loading times out, refresh the page.
- On the txt2img tab page, enter the corresponding prompt word and reverse prompt (in both Chinese and English), and click Generate on the right. An image that matches the prompt word description is generated.
Figure 6 Stable Diffusion WebUI
The application created in the preceding steps can only use the default model built in the application for AI drawing. If you want to use more custom models, you need to mount an external file system to the application. For details, see (Optional) Uploading a Custom Model.
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