Skip to main content
ComfyUI accepts command-line arguments when started with python main.py. This page documents every flag defined in comfy/cli_args.py.
Windows Portable users can add flags to the .bat launch files (for example, run_nvidia_gpu.bat). See the Windows Portable guide for details.
Run python main.py --help in your ComfyUI directory for the built-in help text. Combine multiple flags as needed:

Network & Server

Directories

Launch & Browser

--windows-standalone-build sets auto_launch to true. --disable-auto-launch overrides it. To run as a server without opening a browser, use --disable-auto-launch.

Devices & CUDA

On Windows, ComfyUI uses GPU 0 only by default. To restore all GPUs, pass --cuda-device all.

Precision & Inference

Flags in the Global, UNET, VAE, and Text Encoder groups below are mutually exclusive within each group. Only one flag per group can be used at a time.

Global floating point

UNET precision

Each FP8 flag suffix names an 8-bit float layout from the industry FP8 spec (ONNX / OCP):
  • e4m3fn: 4 exponent bits, 3 mantissa bits. Good balance of precision and range for model weights on NVIDIA Ada Lovelace and newer GPUs.
  • e5m2: 5 exponent bits, 2 mantissa bits. Wider dynamic range but lower precision than e4m3fn. Useful when weight magnitudes vary widely.
  • e8m0fnu: 8 exponent bits, 0 mantissa bits. Maximum dynamic range with no fractional precision. Typically used as a block scaling factor (powers of two only).

VAE precision

Text encoder precision

See the UNET precision section for the explanation of each FP8 format suffix.

Other inference options

Preview

Cache

Cache mode flags are mutually exclusive. Only one of --cache-ram, --cache-classic, --high-ram, --cache-lru, or --cache-none should be used.
ComfyUI reuses cached node results between runs in the same session, which is what makes repeat runs faster. Use --cache-none when you would rather every run start from a clean cache, for example while debugging a workflow or ruling out cached reuse between runs. Every node re-executes, so generations take longer. It is a startup flag, so restart ComfyUI for it to take effect.

Attention

Cross-attention method flags are mutually exclusive. Split and quad attention are ignored when xformers is used.

VRAM & Memory

Async weight offloading is on by default on Nvidia and AMD GPUs, and dynamic VRAM is enabled automatically where it is supported. The flags below override those defaults.
VRAM mode flags (--gpu-only, --highvram, --lowvram, --novram, --cpu) are mutually exclusive.

Performance & Debugging

ComfyUI Manager

See ComfyUI-Manager Installation for setup instructions.

Custom Nodes & API Nodes

--offline also changes what the browser is allowed to load. The flag adds a Content-Security-Policy that keeps the page on resources served by ComfyUI itself, so images, fonts, media, frames, and network requests from other origins are blocked, and Partner Nodes (API nodes) are not registered at all. If a preview or a thumbnail that normally loads goes missing after a restart, check the launch arguments for this flag before troubleshooting the node. --disable-partner-nodes only stops Partner Nodes from loading and leaves the rest of the frontend’s internet access intact.

Frontend & API

Logging & Misc


This reference is based on ComfyUI comfy/cli_args.py. When upgrading ComfyUI, run python main.py --help or compare your local cli_args.py against this page to check for new or changed flags.