Updated on 2025-07-10 GMT+08:00

(Advanced) Enabling WebUI Authentication

WebUI authentication is disabled by default for Stable Diffusion applications deployed in the application center. To prevent functions from being abused due to domain name leakage, configure function environment variables to enable WebUI authentication. For details, see Configuring Environment Variables.

Enabling WebUI Authentication

  1. 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.
  2. Choose Configuration > Environment Variables, click Edit Environment Variable. In the dialog box that is displayed, click Add, add the information in the following table, and click OK.

    Table 1 Environment variables for enabling WebUI authentication

    Key

    Value

    Description

    EXTRA_ARGS

    --gradio-auth user1:password1

    Enter the username in user1 and the password in password1.

  3. After the setting is complete, you need to enter the username and password to access the WebUI.