Skip to content
,

ComfyUI Command Line Arguments: Every Launch Flag Explained (2026 Cheat Sheet)

11โ€“17 minutes

ComfyUI has more than 100 command line arguments, and most guides still list flags that have changed meaning or no longer do anything. This cheat sheet covers every launch flag that matters in the current ComfyUI, grouped by what it does: memory and VRAM, precision, attention, caching, network access, folders, previews, custom nodes and debugging. It also shows how to add flags on the Windows portable build, a manual install and the Desktop app, and gives copy-paste presets for 6 to 8 GB, 12 GB, 16 GB and 24 GB GPUs, Macs, AMD cards and remote access.

TL;DR

  • Where to add flags: at the end of the python main.py line, or in run_nvidia_gpu.bat on the Windows portable build.
  • Modern NVIDIA cards need few flags. ComfyUI now manages VRAM on its own (“Dynamic VRAM”), so --lowvram does nothing on most NVIDIA setups.
  • Most useful flags: --use-sage-attention (speed), --reserve-vram 1.5 (stop OOM when other apps use VRAM), --listen (use from another device), --preview-method auto (live previews).
  • Out of memory: try --reserve-vram, then --cache-none, then --novram. Smaller model files (fp8 or GGUF) help more than any flag.
  • A custom node broke ComfyUI? Start with --disable-all-custom-nodes.

How to Add Launch Flags

Windows portable build

Open the ComfyUI portable folder, right-click run_nvidia_gpu.bat and choose Edit (or open it in Notepad). The first line looks like this:

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build

Add your flags to the end of that line, separated by spaces, then save and run the file:

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --use-sage-attention --reserve-vram 1.5

Tip: copy the file to something like run_custom.bat first, so an update does not overwrite your changes.

Manual install (Windows, Linux, macOS)

Activate your virtual environment, go to the ComfyUI folder and add the flags after main.py:

cd ComfyUI
python main.py --listen --port 8188 --preview-method auto

ComfyUI Desktop app

The Desktop app does not use a .bat file. Open Settings and look for the Server-Config section, which exposes the common launch options (listen address, port, VRAM mode, previews, attention and more) as switches. Restart the app after changing them.

Check that a flag worked

The console prints the active settings at startup, for example the VRAM state, the attention method (“Using sage attention”) and the device name. If a flag is misspelled, ComfyUI stops with “unrecognized arguments”, which tells you exactly which one is wrong. To see the full list for your version, run:

python main.py --help

Copy-Paste Presets

Start with the preset closest to your setup and add or remove flags from there. These assume a current ComfyUI on PyTorch 2.8 or newer.

Situation Flags Why
NVIDIA 16 to 24 GB (RTX 4080, 5080, 4090, 5090) --use-sage-attention --preview-method auto Faster attention, live previews. Memory is handled automatically.
NVIDIA 8 to 12 GB --use-sage-attention --reserve-vram 1 --preview-method latent2rgb Keeps 1 GB free for Windows and the browser; cheap previews.
NVIDIA 6 GB or less --reserve-vram 0.8 --cache-none --preview-method none Frees memory between runs; add --novram only if you still run out.
Gaming or streaming while generating --reserve-vram 3 Leaves room for the game or OBS.
Older ComfyUI or Dynamic VRAM disabled, low VRAM --lowvram Runs text encoders on the CPU to save VRAM.
Use from phone, laptop or another PC on your network --listen 0.0.0.0 --port 8188 Opens ComfyUI on your local network. Do not expose it to the internet without a login.
Apple Silicon Mac --preview-method auto (and --force-fp16 if you see errors on older macOS) Uses the MPS backend automatically.
Troubleshooting a broken install --disable-all-custom-nodes --verbose DEBUG Starts clean and prints detailed logs.
Fully offline / private --offline --disable-metadata No outside requests from the frontend; no workflow saved inside output images.

Memory and VRAM Flags

Only one of the first five flags can be used at a time.

Flag What it does When to use it
--gpu-only Stores and runs everything, including text encoders, on the GPU Big cards (24 GB+) that can hold the whole workflow
--highvram Keeps models in VRAM after use instead of moving them to system RAM Large cards, to skip reload time between runs
--lowvram No effect when Dynamic VRAM is active. Otherwise runs the text encoders on the CPU Older installs, AMD or other setups without Dynamic VRAM
--novram Most aggressive offloading, for when lowvram is not enough Very small GPUs; much slower
--cpu Runs everything on the CPU No usable GPU; very slow
--reserve-vram 1.5 Keeps this many GB of VRAM free for your OS and other apps Out-of-memory errors when a browser, game or second app uses the GPU
--vram-headroom 1 Extra free VRAM that Dynamic VRAM keeps unused, counting other apps Dynamic VRAM setups that still hit OOM
--disable-smart-memory Moves models to system RAM after each use instead of keeping them in VRAM when possible Sharing the GPU with other AI apps
--async-offload [N] / --disable-async-offload Streams weights between RAM and VRAM in the background (default 2 streams, on by default on NVIDIA) Disable only if you suspect it causes crashes
--fast-disk / --disable-fast-disk Loads and offloads from disk instead of unpinned RAM Fast NVMe drive and limited system RAM
--disable-pinned-memory Turns off pinned (page-locked) RAM Low system RAM or driver problems
--disable-mmap Reads safetensors files fully instead of memory-mapping them Network drives or slow first loads on some systems
--cpu-vae Runs the VAE on the CPU OOM at the very end (during VAE decode); slow, try a tiled VAE decode node first

What Dynamic VRAM Changed

Older guides tell everyone with 8 GB to add --lowvram. That advice is outdated. Current ComfyUI includes Dynamic VRAM, which loads only the parts of a model that are needed and streams the rest from system RAM as it runs. According to the ComfyUI source:

  • It is on by default on NVIDIA GPUs, and on AMD with ROCm 7.14 or newer.
  • It needs PyTorch 2.8 or later (2.12+ is recommended) and the comfy-aimdo package. If either is missing, ComfyUI prints a warning and falls back to the old loader.
  • It is turned off if you use --highvram, --gpu-only, --novram or --cpu, or --disable-dynamic-vram.
  • While it is on, --lowvram does nothing.

Look for the line “DynamicVRAM support detected and enabled” in the console at startup. If you see “Falling back to legacy ModelPatcher” instead, update PyTorch and run pip install -r requirements.txt in the ComfyUI folder.

For real numbers on what fits in 16 GB, see our ComfyUI VRAM test.

Precision Flags (fp8, fp16, bf16)

These force a data type. In most cases ComfyUI picks the right one from the model file, so only use them to fix a problem or save memory.

Flag Effect
--force-fp32 / --force-fp16 Force all models to fp32 or fp16
--bf16-unet / --fp16-unet / --fp32-unet Run the diffusion model in bf16, fp16 or fp32
--fp8_e4m3fn-unet / --fp8_e5m2-unet / --fp8_e8m0fnu-unet Store diffusion model weights in fp8, roughly halving their VRAM use
--fp16-vae / --bf16-vae / --fp32-vae Set VAE precision. fp16 VAE can cause black images on some models
--fp8_e4m3fn-text-enc / --fp8_e5m2-text-enc / --fp16-text-enc / --bf16-text-enc / --fp32-text-enc Set text encoder precision
--fp16-intermediates Experimental: fp16 for data passed between nodes
--supports-fp8-compute Tell ComfyUI the GPU supports fp8 maths even if it is not detected
--force-upcast-attention / --dont-upcast-attention Fix (or debug) black images caused by attention precision

A simpler way to save memory is to download an fp8 or GGUF version of the model instead of forcing it at load time. Our GGUF quantization guide explains which file to pick, and the bf16 speed guide for RTX 30 and 40 covers precision and speed on older cards.

Attention Flags (Sage, Flash, xformers)

Attention is the slowest part of most image and video models, so this is where flags make the biggest speed difference.

Flag What it uses Notes
(none) PyTorch’s built-in attention (SDPA) on most setups Safe default
--use-sage-attention SageAttention Often the fastest on NVIDIA, especially for video models. Install the sageattention package (and Triton) into ComfyUI’s Python first
--use-flash-attention FlashAttention Needs the flash-attn package built for your PyTorch and CUDA
--use-pytorch-cross-attention PyTorch 2 SDPA explicitly Useful to override other choices
--use-ck-attention Comfy Kitchen attention Newer built-in option
--use-split-cross-attention / --use-quad-cross-attention Memory-saving attention For very low VRAM or old GPUs; slower
--disable-xformers Stops ComfyUI using xformers even if installed Fixes crashes from an xformers build that does not match your PyTorch

To install SageAttention on the Windows portable build, run pip with the embedded Python from the portable folder, for example .\python_embeded\python.exe -m pip install sageattention. Windows also needs a matching Triton build (the triton-windows package). If the package is missing, remove the flag or ComfyUI will fail when it tries to use it.

Estimate for a 16 GB card like the RTX 5080: SageAttention can cut video generation time by roughly 20 to 40 percent compared with the default attention, with smaller gains for short image jobs. This is an estimate, not a measured result.

Caching Flags

ComfyUI caches node results so that changing one setting does not rerun the whole workflow. These flags change how much it keeps.

Flag Behaviour
--cache-ram [GB] [GB] The default. Caches results until system RAM gets tight. The first value is the active-cache headroom (default 10% of RAM, between 2 and 10 GB); the optional second value is for inactive caches
--cache-classic The old, aggressive caching
--cache-lru 10 Keeps the last N node results. Faster when you switch between workflows, uses more memory
--cache-none Caches nothing. Lowest RAM and VRAM use, but every node reruns every time
--high-ram Can help a little on machines with lots of RAM, or where using the pagefile is better than reloading models

Network and Remote Access Flags

Flag What it does
--listen With no value, listens on all addresses (IPv4 and IPv6) so other devices can connect. Default is 127.0.0.1 (this PC only)
--listen 192.168.1.20 Listens on one address; separate several with commas
--port 8190 Changes the port from 8188. Use a different port for each copy if you run two instances
--tls-keyfile key.pem --tls-certfile cert.pem Serves ComfyUI over HTTPS. Both are needed
--enable-cors-header [ORIGIN] Allows other web pages to call the API; with no value it allows all origins
--max-upload-size 500 Upload limit in MB (default 100). Raise it for long videos
--enable-compress-response-body Compresses API responses
--multi-user Separate settings and workflows per user
--auto-launch / --disable-auto-launch Open (or do not open) the browser on start

ComfyUI has no password of its own. If you use --listen, keep it on your home network or behind a VPN or tunnel with authentication. Never forward port 8188 on your router.

Folder and Path Flags

Flag What it sets
--base-directory PATH The base folder for models, custom_nodes, input, output, temp and user
--models-directory PATH Just the models folder, for example a big second drive
--extra-model-paths-config FILE Loads extra_model_paths.yaml files, to share models with Forge, A1111 or another ComfyUI
--output-directory, --input-directory, --temp-directory, --user-directory, --previews-directory Each folder separately; these override the base directory
--database-url Where ComfyUI keeps its database (default comfyui.db in the user folder)
--front-end-version Comfy-Org/ComfyUI_frontend@latest Downloads and uses a specific frontend version (needs internet)
--front-end-root PATH Uses a frontend from a local folder

Not sure which subfolder a file belongs in? Our ComfyUI model folder cheat sheet lists every one.

Preview Flags

By default, current ComfyUI shows no live preview while sampling. --preview-method sets the default:

  • none: no preview (the default, fastest).
  • latent2rgb: a quick, blurry colour preview with almost no cost.
  • taesd: a sharper preview using small TAESD decoders. Put the decoder files (for example taesd_decoder.pth, taesdxl_decoder.pth, taef1_decoder.pth) in ComfyUI/models/vae_approx/.
  • auto: uses TAESD when the decoder is present, otherwise latent2rgb.

--preview-size 512 sets the maximum preview size. The preview mode can also be changed in the ComfyUI settings menu without restarting.

Custom Nodes, Manager and Offline Flags

Flag What it does
--disable-all-custom-nodes Starts without loading anything from custom_nodes. The first step when ComfyUI will not start
--whitelist-custom-nodes ComfyUI-GGUF With the flag above, still loads the listed folders
--disabled-nodes-config FILE A YAML file listing node IDs to disable
--enable-manager Turns on the built-in ComfyUI-Manager. Needs pip install -r manager_requirements.txt first
--enable-manager-legacy-ui / --disable-manager-ui Use the old Manager interface, or hide the Manager interface while background tasks still run
--offline Stops the frontend talking to the internet and disables the paid partner (API) nodes
--disable-partner-nodes Only hides the paid API nodes
--disable-metadata Does not save the workflow inside output PNGs (useful before sharing images)
--disable-product-tips Hides Comfy-Org product tips in the console

If a node pack broke your install, our ComfyUI errors and fixes guide walks through the usual causes.

The –fast Flag and Other Speed Options

--fast turns on experimental optimizations that may reduce quality or crash some workflows. With no value it enables all of them; you can also list the ones you want:

  • fp16_accumulation: faster fp16 matrix maths on supported NVIDIA cards, with a small accuracy cost.
  • fp8_matrix_mult: uses fp8 maths on GPUs that support it (RTX 40 and 50 series) for fp8 models.
  • cublas_ops: uses cuBLAS operations where available.
  • autotune: lets PyTorch benchmark and pick faster kernels.
python main.py --fast fp16_accumulation fp8_matrix_mult

Related flags: --enable-triton-backend / --disable-triton-backend for the Comfy Kitchen Triton backend, --disable-cuda-graphs and --disable-comfy-compiler if the built-in model compiler causes trouble, --force-channels-last, and --deterministic for slower but more repeatable results.

Estimate for a 16 GB card like the RTX 5080: --fast fp8_matrix_mult with an fp8 model may speed up sampling by around 10 to 30 percent. This is an estimate, not a measured result. Compare images before and after, because quality changes differ by model.

GPU Selection, AMD, Intel and Mac

Flag Use
--cuda-device 1 Use only the GPU with this ID (or a list like 0,1). Run one ComfyUI per GPU with different ports
--default-device 1 Make this GPU the default while keeping others visible
--cuda-malloc / --disable-cuda-malloc Turn the CUDA async allocator on or off (on by default). Disable it if you see allocator errors
--directml [ID] Windows DirectML backend for AMD or Intel GPUs without ROCm
--oneapi-device-selector Choose Intel GPUs through oneAPI
--force-non-blocking May help performance on some non-NVIDIA systems

On Apple Silicon, ComfyUI uses the MPS backend with no flag. Because Macs share memory between CPU and GPU, VRAM flags matter less; keep enough free RAM and close other heavy apps.

Logging and Debugging Flags

  • --verbose DEBUG: more detailed console logs. You can also add a log file, for example --verbose DEBUG comfy.log.
  • --log-stdout: send output to stdout instead of stderr.
  • --dont-print-server: hide server messages.
  • --debug-hang: print stack traces when you press Ctrl+C, to find where ComfyUI is stuck.
  • --default-hashing-function sha256: hash used to compare duplicate files (md5, sha1, sha256 or sha512).
  • --feature-flag KEY=VALUE and --list-feature-flags: set or list server feature flags.

FAQ

Should I use –lowvram on an 8 GB NVIDIA card?

Usually no. On a current install with Dynamic VRAM, it has no effect. Use --reserve-vram 1 and smaller model files instead. It is still useful on older installs or AMD setups without Dynamic VRAM.

What is the difference between –lowvram and –novram?

--lowvram moves the text encoders to the CPU. --novram offloads much more and is for when lowvram is not enough. Both are slower than keeping models on the GPU.

How do I open ComfyUI from my phone?

Start it with --listen, find your PC’s local IP address (for example 192.168.1.20) and open http://192.168.1.20:8188 on the phone while on the same Wi-Fi.

How do I run two ComfyUI instances?

Give each one a different port, and on a multi-GPU PC a different --cuda-device, for example --port 8188 --cuda-device 0 and --port 8189 --cuda-device 1.

Why did ComfyUI say “unrecognized arguments”?

The flag is misspelled or does not exist in your version. Check with python main.py --help and update ComfyUI if it is missing.

Do flags work in the ComfyUI Desktop app?

Yes, through Settings, Server-Config, which sets the same options.

Final Thoughts

On a modern NVIDIA card, ComfyUI needs very few launch flags. The ones worth knowing are --use-sage-attention for speed, --reserve-vram to stop out-of-memory errors when other apps share the GPU, --listen for remote use, --preview-method for live previews and --disable-all-custom-nodes for troubleshooting. Old advice to add --lowvram everywhere no longer applies on current installs.

More ComfyUI reference guides:

Sources