Complete Stable Diffusion commands reference — 136 commands across 2 categories. Quick reference cheat sheet for Cross-platform.
| Shortcut | Action |
|---|---|
| PYTHON | Sets a custom path for Python executable |
| VENV_DIR | Specifies the path for the virtual environment. Default is venv. Special value - runs |
| COMMANDLINE_ARGS | Additional commandline arguments for the main program |
| IGNORE_CMD_ARGS_ERRORS | Set to anything to make the program not exit with an error if an unexpected commandline |
| REQS_FILE | Name of requirements.txt file with dependencies that will be installed when launch.py is run |
| TORCH_COMMAND | Command for installing PyTorch |
| INDEX_URL | --index-url parameter for pip |
| TRANSFORMERS_CACHE | Path to where transformers library will download and keep its files related to the CLIP model |
| CUDA_VISIBLE_DEVICES | Select GPU to use for your instance on a system with multiple GPUs. For example, if you want |
| SD_WEBUI_LOG_LEVEL | Log verbosity. Supports any valid logging level supported by Python's built-in logging module |
| SD_WEBUI_CACHE_FILE | Cache file path. Defaults to cache.json in the root directory if not set |
| SD_WEBUI_RESTAR | A value set by launcher script (like webui.bat webui.sh) informing Webui that restart function |
| SD_WEBUI_RESTARTING | A internal value signifying if webui is currently restarting or reloading, used for disabling |
| Shortcut | Action |
|---|---|
| --exit | Terminate after installation |
| --data-dir | base path where all user data is stored |
| --models-dir | base path where models are stored; overrides --data-dir |
| --config | Path to config which constructs model |
| --ckpt | Path to checkpoint of Stable Diffusion model; if specified, this checkpoint will be added |
| --ckpt-dir | Path to directory with Stable Diffusion checkpoints |
| --no-download-sd-model | Don't download SD1.5 model even if no model is found |
| --do-not-download-clip | do not download CLIP model even if it's not included in the checkpoint |
| --vae-dir | Path to Variational Autoencoders model |
| --vae-path | Checkpoint to use as VAE; setting this argument |
| --gfpgan-dir | GFPGAN directory |
| --codeformer-models-path | Path to directory with codeformer model file(s) |
| --gfpgan-models-path | Path to directory with GFPGAN model file(s) |
| --esrgan-models-path | Path to directory with ESRGAN model file(s) |
| --bsrgan-models-path | Path to directory with BSRGAN model file(s) |
| --realesrgan-models-path | Path to directory with RealESRGAN model file(s) |
| --scunet-models-path | Path to directory with ScuNET model file(s) |
| --swinir-models-path | Path to directory with SwinIR and SwinIR v2 model file(s) |
| --ldsr-models-path | Path to directory with LDSR model file(s) |
| --dat-models-path | Path to directory with DAT model file(s) |
| --lora-dir | Path to directory with Lora networks |
| --clip-models-path | Path to directory with CLIP model file(s) |
| --embeddings-dir | Embeddings directory for textual inversion (default: embeddings) |
| --textual-inversion-templates-dir | Directory with textual inversion templates |
| --hypernetwork-dir | hypernetwork directory |
| --localizations-dir | Localizations directory |
| --styles-file | Path or wildcard path of styles files, allow multiple entries |
| --ui-config-file | Filename to use for UI configuration |
| --no-progressbar-hiding | Do not hide progress bar in gradio UI |
| --ui-settings-file | Filename to use for UI settings |
| --allow-code | Allow custom script execution from web UI |
| --share | Use share=True for gradio and make the UI accessible through their site |
| --listen | Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests |
| --port | Launch gradio with given server port, you need root/admin rights for ports < 1024; defaults |
| --hide-ui-dir-config | Hide directory configuration from web UI |
| --freeze-settings | disable editing of all settings globally |
| --freeze-settings-in-sections | disable editing settings in specific sections of the settings page by specifying |
| --freeze-specific-settings | disable editing of individual settings by specifying a comma-delimited list like |
| --enable-insecure-extension-access | Enable extensions tab regardless of other options |
| --gradio-debug | Launch gradio with --debug option |
| --gradio-auth | Set gradio authentication like username:password; or comma-delimit multiple like |
| --gradio-auth-path | Set gradio authentication file path ex. /path/to/auth/file same auth format as --gradio-auth |
| --disable-console-progressbars | Do not output progress bars to console |
| --enable-console-prompts | Print prompts to console when generating with txt2img and img2img |
| --api | Launch web UI with API |
| --api-auth | Set authentication for API like username:password; or comma-delimit multiple like |
| --api-log | Enable logging of all API requests |
| --nowebui | Only launch the API, without the UI |
| --ui-debug-mode | Don't load model to quickly launch UI |
| --device-id | Select the default CUDA device to use |
| --administrator | Administrator privileges |
| --cors-allow-origins | Allowed CORS origin(s) in the form of a comma-separated list (no spaces) |
| --cors-allow-origins-regex | Allowed CORS origin(s) in the form of a single regular expression |
| --tls-keyfile | Partially enables TLS, requires --tls-certfile to fully function |
| --tls-certfile | Partially enables TLS, requires --tls-keyfile to fully function |
| --disable-tls-verify | When passed, enables the use of self-signed certificates |
| --server-name | Sets hostname of server |
| --no-gradio-queue | Disables gradio queue; causes the webpage to use http requests instead of websockets; was |
| --gradio-allowed-path | Add path to Gradio's allowed_paths; make it possible to serve files from it |
| --no-hashing | Disable SHA-256 hashing of checkpoints to help loading performance |
| --skip-version-check | Do not check versions of torch and xformers |
| --skip-python-version-check | Do not check versions of Python |
| --skip-torch-cuda-test | Do not check if CUDA is able to work properly |
| --skip-install | Skip installation of packages |
| --loglevel | log level; one of: CRITICAL, ERROR, WARNING, INFO, DEBUG |
| --log-startup | launch.py argument: print a detailed log of what's happening at startup |
| --api-server-stop | enable server stop/restart/kill via api |
| --timeout-keep-alive | set timeout_keep_alive for uvicorn |
| --xformers | Enable xformers for cross attention layers |
| --force-enable-xformers | Enable xformers for cross attention layers regardless of whether the checking code thinks you |
| --xformers-flash-attention | Enable xformers with Flash Attention to improve reproducibility |
| --opt-sdp-attention | Enable scaled dot product cross-attention layer optimization; requires PyTorch 2.* |
| --opt-sdp-no-mem-attention | Enable scaled dot product cross-attention layer optimization without memory efficient |
| --opt-split-attention | Force-enables Doggettx's cross-attention layer optimization. By default, it's |
| --opt-split-attention-invokeai | Force-enables InvokeAI's cross-attention layer optimization. By default, it's on when CUDA |
| --opt-split-attention-v1 | Enable older version of split attention optimization that does not consume all VRAM available |
| --opt-sub-quad-attention | Enable memory efficient sub-quadratic cross-attention layer optimization |
| --sub-quad-q-chunk-size | Query chunk size for the sub-quadratic cross-attention layer optimization to use |
| --sub-quad-kv-chunk-size | KV chunk size for the sub-quadratic cross-attention layer optimization to use |
| --sub-quad-chunk-threshold | The percentage of VRAM threshold for the sub-quadratic cross-attention layer optimization |
| --opt-channelslast | Enable alternative layout for 4d tensors, may result in faster inference only on Nvidia cards |
| --disable-opt-split-attention | Force-disables cross-attention layer optimization |
| --disable-nan-check | Do not check if produced images/latent spaces have nans; useful for running without |
| --use-cpu | Use CPU as torch device for specified modules |
| --use-ipex | Use Intel XPU as torch device |
| --no-half | Do not switch the model to 16-bit floats |
| --precision | Evaluate at this precision |
| --no-half-vae | Do not switch the VAE model to 16-bit floats |
| --upcast-sampling | Upcast sampling. No effect with --no-half. Usually produces similar results to --no-half |
| --medvram | Enable Stable Diffusion model optimizations for sacrificing a some performance for low VRAM |
| --medvram-sdxl | enable --medvram optimization just for SDXL models |
| --lowvram | Enable Stable Diffusion model optimizations for sacrificing a lot of speed for very low VRAM |
| --lowram | Load Stable Diffusion checkpoint weights to VRAM instead of RAM |
| --disable-model-loading-ram-optimization | disable an optimization that reduces RAM use when loading a model |
| --autolaunch | Open the web UI URL in the system's default browser upon launch |
| --theme | Open the web UI with the specified theme (light or dark). If not specified, uses the default |
| --use-textbox-seed | Use textbox for seeds in UI (no up/down, but possible to input long seeds) |
| --disable-safe-unpickle | Disable checking PyTorch models for malicious code |
| --ngrok | ngrok authtoken, alternative to gradio --share |
| --ngrok-region | The region in which ngrok should start |
| --ngrok-options | The options to pass to ngrok in JSON format, e.g.: {"authtoken_from_env":true |
| --update-check | On startup, notifies whether or not your web UI version (commit) is up-to-date with the current |
| --update-all-extensions | On startup, it pulls the latest updates for all extensions you have installed |
| --reinstall-xformers | Force-reinstall xformers. Useful for upgrading - but remove it after upgrading or you'll |
| --reinstall-torch | Force-reinstall torch. Useful for upgrading - but remove it after upgrading or you'll reinstall |
| --tests | Run test to validate web UI functionality, see wiki topic for more details |
| --no-tests | Do not run tests even if --tests option is specified |
| --dump-sysinfo | launch.py argument: dump limited sysinfo file (without information about extensions, options) |
| --disable-all-extensions | disable all extensions from running |
| --disable-extra-extensions | disable all non-built-in extensions from running |
| --skip-load-model-at-start | if load a model at web start, only take effect when --nowebui |
| --unix-filenames-sanitization | allow any symbols except '/' in filenames. May conflict with your browser and file system |
| --filenames-max-length | maximal length of filenames of saved images, longer filenames will be truncated. if overridden |
| --no-prompt-history | disable read prompt from last generation feature; disables --data-path/params.txt |
| --show-negative-prompt | No longer has an effect |
| --deepdanbooru | No longer has an effect |
| --unload-gfpgan | No longer has an effect |
| --gradio-img2img-tool | No longer has an effect |
| --gradio-inpaint-tool | No longer has an effect |
| --gradio-queue | No longer has an effect |
| --add-stop-route | No longer has an effect |
| --always-batch-cond-uncond | No longer has an effect, move into UI under Setting > Optimizations |
| --max-batch-count | No longer has an effect. moved to ui-config.json txt2img/Batch count/maximum img2img/Batch |
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"