(Advanced) Mounting an SFS File System to Multiple Users
Application Scenario
Storing model files for each user uses too much space. Mount the same SFS file system to users' applications so that they can share model file resources. To avoid inference results of different users from affecting each other, you can change the result save path on the Stable Diffusion WebUI.
Prerequisites
- Each user must have the SWR Admin, VPC Administrator, Server Administrator, SFS FullAccess, and SFS Turbo FullAccess permissions in their agencies.
- Each user must complete the steps in Deploying and Using the Stable Diffusion Application to create an application.
- Each user must use the same SFS file system to initialize the mounted file system of the custom model. For details, see Step 3: Initializing a Custom Model. The sd directory already exists in the mounted SFS file system.
Step 1: Creating a Multi-user Configuration File
This example uses two users user1 and user2. You can add or delete users as required.
- Select a user, go to the details page of the Stable Diffusion application whose custom model has been initialized, click Upload Model, and log in to the file system.
- Go to the sd directory, as shown in Figure 1.
- As shown in Figure 2, find the config.json file, select it, and copy it to any directory. In this case, the file is still stored in the sd directory and renamed config_user1.json. As shown in Figure 3, copy the file for user2 and rename it config_user2.json.
Step 2: Modifying Environment Variables and Using the New Configuration File
- Go to the Stable Diffusion application details page, find the function resource whose logic name is stable_diffusion in the Resource tab, and click the link to go to the function details page.
- On the Configuration > Environment Variables tab page, click Edit Environment Variable. In the dialog box that is displayed, click Add. Set the environment variable for user1 based on Table 1 and user2 based on Table 2 and click OK.

To enable (Advanced) Enabling WebUI Authentication and (Advanced) Accessing Applications Using APIs at the same time, you can set environment variables at the same time. For details, see Table 2.
Step 3: Changing the Result Save Path
After the preceding configurations are complete, the two users can share the model files in the same SFS file system. To further isolate the inference results of different users, you can change the result save path in the settings.
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