Command Line Arguments

April 7, 2026 ยท View on GitHub

Most settings are configurable entirely via UI (or the Settings.fds file) and generally most users never need to touch the CLI - however a few key settings intended for automated or dev usage are provided by command line instead (notably the path to the settings file itself for example). Additionally, some settings in the UI can be overridden by command line (eg host/port).

Usage

An example for a personal developmental launch configuration on a home Windows PC would be .\launch-windows-dev.ps1 --host * --port 7850 --environment development --launch_mode web

Note that if your inputs are invalid, the program will refuse to start, with an error message indicating what value is wrong.

Details

ArgumentDefaultDescription
--data_dirDataOverride the default data directory.
--settings_fileData/Settings.fdsIf your settings file is anywhere other than the default, you must specify as a command line arg. The default value is relative to your --data_dir.
--backends_fileData/Backends.fdsIf your backends file is anywhere other than the default, you must specify as a command line arg. The default value is relative to your --data_dir.
--environmentProductionCan be development or production to set what ASP.NET Web Environment to use. Development gives detailed debug logs and errors, while Production is optimized for normal usage.
--hostlocalhostCan be used to override the 'Network.Host' server setting.
--port7801Can be used to override the 'Network.Port' server setting.
--asp_loglevelwarningSets the minimum log level for ASP.NET web logger, as any of: Trace, Debug, Information, Warning, Error, Critical, None. Note 'information' here spams debug output.
--loglevelInfoMinimum SwarmUI log level, as any of: Debug, Info, Init, Warning, Error, None. 'Info' here is the normal usage data.
--user_idlocalSet the local user's default UserID (for running in single-user mode, not useful in shared mode).
--lock_settingsfalseIf enabled, blocks in-UI editing of server settings by admins. Settings cannot be modified in this mode without editing the settings file and restarting the server.
--ngrok_path(None)If specified, will be used as the path to an ngrok executable, and will automatically load and configure ngrok when launching, to share your UI instance on a publicly accessible URL.
--cloudflared_path(None)If specified, will be used as the path to an cloudflared executable, and will automatically load and configure TryCloudflare when launching, to share your UI instance on a publicly accessible URL.
--proxy_region(None)If specified, sets the proxy (ngrok/cloudflared) region. If unspecified, defaults to closest.
--proxy_added_args(None)If specified, adds additional args to the proxy launch. Use a . as the first symbol (parser hackaround). For example, --proxy_added_args ".--my-arg --arg -argy arg"
--ngrok_basic_auth(None)If specified, sets an ngrok basic-auth requirement to access.
--launch_modenoneCan be used to override the 'LaunchMode' server setting.
--require_control_within(None)If specified, give a number of minutes within which a remote API server must send a AdminTakeControl API request, or presume the launch is bad. This is useful for auto-managed instances, such as via the AutoScalingBackend.
--no_persistfalseIf enabled, tells most systems in Swarm to avoid saving data (eg session handler will not save session data). Useful for instances with overlapping data storage especially. This may cause wasteful redundant data filling, running at least once without this set is recommended.
--ci_testfalseSpecial handler, runs basic validation tests and closes quickly.
--ci_test_extensionsfalseSpecial handler, in CI-Test mode, download and test-compile common extensions.
--helpfalseDisplays an in-CLI shortlist of CLI args and some usage hints, and stops early before running Swarm.

Environment Variables (EnvVars)

Swarm itself does not use any environment variables for almost anything.

If you need to set environment variables for the Comfy backend - just set them before launching Swarm. Any envvars set for Swarm will be automatically transferred down to the backend process when it's launched.

On Linux, export SWARM_NO_VENV=true to tell Swarm when installing the comfy backend to not add a venv. By default, a venv will be used. This is only normally intended for certain containerized install setups, such as Google Colab.