You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
AI Application
Mounting Stable Diffusion Custom Models through NAS
Copy page
Download PDF
Mounting Stable Diffusion Custom Models through NAS
This article introduces to you how to upload custom models used by Stable Diffusion to the NAS directory mounted by functions for storage, and load these models in real time when starting the WebUI.​
Scenario introduction ​
Users may need to use custom models or WebUI plugins when using Stable Diffusion. Since these models are usually large, storing them in the NAS mount directory is a common choice to facilitate quick access.​
Prerequisites​
  • For Virtual Private Cloud (VPC)​
  • Permission for using Volcano Engine Virtual Private Cloud has been obtained.​
  • NAS file storage​
  • Permission for using Volcano Engine NAS has been obtained.​
  • A NAS file system has been created in the region where the function is to be deployed. For details, see Creating file systems.​
  • A mount point has been created in the VPC. For detailed operation, refer to Creating Mount Point.​
  • Function as a Service​
  • Permission for using veFaaS has been obtained.​
  • AI painting Stable Diffusion application has been deployed. ​
Procedure​
Step One: Configure NAS mount directory​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. On the function list page, select the Stable Diffusion function deployed in the Prerequisites, then click to enter the Basic information page of the current function.​
  1. In the VPC network area, click Edit icon to enable and configure the VPC network.​
  • Configure the VPC, subnet, and security groups to be bound to the function. The VPC configured in the function must be consistent with the VPC of the NAS mount point.​
  1. In the storage configuration area, click Edit icon to enable and configure the NAS mount directory.​
  • NAS file system: Select the NAS file system in the same region.​
  • Mount point: Select the NAS mount point that matches the VPC of the function.​
  • Remote directory: Configure the directory of the remote NAS to be accessed. For example, /.​
  • Local directory: Configure the local directory of the function operation environment. The local directory and the remote directory are in a mapping relationship. This example is: /mnt/nas.​
Step Two: Configure environment variables ​
Point the model that WebUI loads by default to the NAS mounted file path through configuring CLI_ARGS environment variable.​
  1. On the Basic information page, click Edit icon next to the information configuration area.​
  1. On the editing and configuration information panel, click + to add a new environment variable.​
  • key: fixed as CLI_ARGS.​
  • value: This example uses --ckpt to specify the Stable Diffusion model file to load when WebUI starts. Assuming the custom model is stored on NAS at /models/Stable-diffusion/sd_xl_base_1.0_0.9vae.safetensors, the corresponding local directory in the function operation environment is /mnt/nas/models/Stable-diffusion/sd_xl_base_1.0_0.9vae.safetensors. Therefore, the value is --ckpt /mnt/nas/models/Stable-diffusion/sd_xl_base_1.0_0.9vae.safetensors.​
tip​
For the startup parameters supported by CLI_ARGS, refer to Command Line Arguments and Settings documentation.​
Step Three: Release the function​
Release the latest function configuration online.​
  1. On the function details page, click Release in the upper right corner.​
  1. The function revision is set to Latest. Fill in the revision description as needed.​
  1. Click Confirm to start releasing the function.​
  • After the function is successfully released, access the Stable Diffusion WebUI through the public endpoint provided by the API Gateway Trigger.​
Last updated: 2026.08.19 14:06:07