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:
python main.py --listen 0.0.0.0 --port 8288 --disable-auto-launch --lowvram

Network & Server

FlagDefaultDescription
--listen [IP]127.0.0.1IP address to listen on. Comma-separated list supported (e.g. 127.2.2.2,127.3.3.3). If provided without a value, defaults to 0.0.0.0,:: (all IPv4 and IPv6 interfaces).
--port8188Port to listen on.
--tls-keyfile PATHPath to TLS (SSL) key file. Enables HTTPS. Requires --tls-certfile.
--tls-certfile PATHPath to TLS (SSL) certificate file. Enables HTTPS. Requires --tls-keyfile.
--enable-cors-header [ORIGIN]disabledEnable CORS. Optional origin, or * for all origins when no value is given.
--max-upload-size100Maximum upload size in MB.
--enable-compress-response-bodydisabledEnable compressing the HTTP response body.
# Listen on all interfaces (LAN access)
python main.py --listen

# Listen on a specific IP
python main.py --listen 0.0.0.0

# Custom port with HTTPS
python main.py --port 8443 --tls-keyfile key.pem --tls-certfile cert.pem

Directories

FlagDefaultDescription
--base-directory PATHComfyUI rootBase directory for models, custom_nodes, input, output, temp, and user directories.
--extra-model-paths-config PATHLoad one or more extra_model_paths.yaml files. Can be specified multiple times.
--output-directory PATHOutput directory. Overrides --base-directory.
--temp-directory PATHTemp directory. Overrides --base-directory.
--input-directory PATHInput directory. Overrides --base-directory.
--user-directory PATHUser directory (absolute path). Overrides --base-directory. Path must exist and be readable.

Launch & Browser

FlagDefaultDescription
--auto-launchdisabledAutomatically open ComfyUI in the default browser on startup.
--disable-auto-launchdisabledDisable auto-launching the browser.
--windows-standalone-builddisabledWindows portable build convenience mode. Enables auto-launch on startup (equivalent to --auto-launch).
--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.
# Run server without opening browser
python main.py --disable-auto-launch

Devices & CUDA

FlagDefaultDescription
--cuda-device DEVICE_IDCUDA device IDs to use, comma-separated (e.g. 0 or 0,1). Other devices are hidden.
--default-device IDDefault device ID. All other devices remain visible.
--cuda-mallocauto (torch 2.0+)Enable cudaMallocAsync. Mutually exclusive with --disable-cuda-malloc.
--disable-cuda-mallocDisable cudaMallocAsync. Mutually exclusive with --cuda-malloc.
--directml [DEVICE]Use torch-directml. Optional device index; defaults to -1 when no value is given.
--oneapi-device-selector STRINGoneAPI device selector string for Intel devices.

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

FlagDescription
--force-fp32Force fp32 globally. Report if this improves GPU performance.
--force-fp16Force fp16 globally. Also sets --fp16-unet.

UNET precision

FlagDescription
--fp32-unetRun the diffusion model in fp32.
--fp64-unetRun the diffusion model in fp64.
--bf16-unetRun the diffusion model in bf16.
--fp16-unetRun the diffusion model in fp16.
--fp8_e4m3fn-unetStore UNet weights in fp8 (e4m3fn).
--fp8_e5m2-unetStore UNet weights in fp8 (e5m2).
--fp8_e8m0fnu-unetStore UNet weights in fp8 (e8m0fnu).

VAE precision

FlagDescription
--fp16-vaeRun the VAE in fp16. May cause black images.
--fp32-vaeRun the VAE in full precision fp32.
--bf16-vaeRun the VAE in bf16.
--cpu-vaeRun the VAE on the CPU (not mutually exclusive with VAE precision flags).

Text encoder precision

FlagDescription
--fp8_e4m3fn-text-encStore text encoder weights in fp8 (e4m3fn).
--fp8_e5m2-text-encStore text encoder weights in fp8 (e5m2).
--fp16-text-encStore text encoder weights in fp16.
--fp32-text-encStore text encoder weights in fp32.
--bf16-text-encStore text encoder weights in bf16.

Other inference options

FlagDefaultDescription
--fp16-intermediatesdisabledExperimental: use fp16 for intermediate tensors between nodes instead of fp32.
--force-channels-lastdisabledForce channels-last memory format during inference.
--supports-fp8-computedisabledAct as if the device supports fp8 compute.
--enable-triton-backenddisabledEnable Triton backend in comfy-kitchen. Disabled by default at launch.

Preview

FlagDefaultDescription
--preview-methodnonePreview method for sampler nodes. Choices: none, auto, latent2rgb, taesd.
--preview-size512Maximum preview image size in pixels.

Cache

Cache mode flags are mutually exclusive. Only one of --cache-ram, --cache-classic, --cache-lru, or --cache-none should be used.
FlagDefaultDescription
--cache-ram [GB] [GB]enabled (default mode)RAM pressure caching. First value: active-cache threshold in GB. Optional second value: inactive-cache/pin threshold in GB. When no values given: active = 10% of system RAM (min 2 GB, max 10 GB); inactive = 100% of system RAM (max 96 GB). Accepts at most two values.
--cache-classicUse the old aggressive caching style.
--cache-lru N0 (disabled)LRU caching with a maximum of N node results cached. May use more RAM/VRAM.
--cache-noneReduced RAM/VRAM usage; re-executes every node on each run.

Attention

Cross-attention method flags are mutually exclusive. Split and quad attention are ignored when xformers is used.
FlagDescription
--use-split-cross-attentionUse split cross attention optimization.
--use-quad-cross-attentionUse sub-quadratic cross attention optimization.
--use-pytorch-cross-attentionUse PyTorch 2.0 cross attention.
--use-sage-attentionUse Sage attention.
--use-flash-attentionUse FlashAttention.
--disable-xformersDisable xformers.
--force-upcast-attentionForce attention upcasting. Report if this fixes black images. Mutually exclusive with --dont-upcast-attention.
--dont-upcast-attentionDisable all attention upcasting. For debugging only.

VRAM & Memory

VRAM mode flags (--gpu-only, --highvram, --lowvram, --novram, --cpu) are mutually exclusive.
FlagDefaultDescription
--gpu-onlyStore and run everything on the GPU (text encoders, CLIP, etc.).
--highvramKeep models in GPU memory instead of unloading to CPU after use.
--lowvramNo effect when dynamic VRAM is enabled. Otherwise, runs text encoders on CPU.
--novramMinimal VRAM usage when --lowvram is not enough.
--cpuUse CPU for everything (slow).
--reserve-vram GBOS-dependentVRAM in GB to reserve for the OS and other software.
--async-offload [NUM_STREAMS]enabled on NvidiaAsync weight offloading. Optional stream count (default: 2).
--disable-async-offloadDisable async weight offloading.
--disable-dynamic-vramDisable dynamic VRAM; use estimate-based model loading.
--enable-dynamic-vramauto on NvidiaEnable dynamic VRAM on systems where it is not enabled by default.
--fast-diskdisabledPrefer disk-backed dynamic loading over unpinned RAM. Useful with fast NVMe.
--force-non-blockingdisabledForce non-blocking tensor operations. May help on non-Nvidia systems; can break some workflows.
--disable-smart-memorydisabledAggressively offload to RAM instead of keeping models in VRAM.
--disable-pinned-memorydisabledDisable pinned memory use.
--mmap-torch-filesdisabledUse mmap when loading ckpt/pt files.
--disable-mmapdisabledDo not use mmap when loading safetensors.

Performance & Debugging

FlagDefaultDescription
--fast [OPT...]disabledEnable experimental optimizations that may affect quality or stability. --fast alone enables all. Specific options: fp16_accumulation, fp8_matrix_mult, cublas_ops, autotune.
--deterministicdisabledUse slower deterministic PyTorch algorithms where possible. Does not guarantee identical images in all cases.
--default-hashing-functionsha256Hash function for duplicate filename/content comparison. Choices: md5, sha1, sha256, sha512.
# Enable all fast optimizations (experimental)
python main.py --fast

# Enable specific optimizations only
python main.py --fast fp16_accumulation cublas_ops

ComfyUI Manager

See ComfyUI-Manager Installation for setup instructions.
FlagDescription
--enable-managerEnable ComfyUI-Manager.
--disable-manager-uiDisable Manager UI and endpoints only. Background tasks (scheduled installs, etc.) continue. Requires --enable-manager.
--enable-manager-legacy-uiUse the legacy Manager UI. Requires --enable-manager.

Custom Nodes & API Nodes

FlagDefaultDescription
--disable-all-custom-nodesdisabledDisable loading all custom nodes.
--whitelist-custom-nodes FOLDER...Custom node folders to load even when --disable-all-custom-nodes is set.
--disable-api-nodesdisabledDisable API nodes and prevent the frontend from communicating with the internet.
--disable-metadatadisabledDisable saving prompt metadata in output files.
# Troubleshoot custom node issues
python main.py --disable-all-custom-nodes

# Allow only specific custom nodes
python main.py --disable-all-custom-nodes --whitelist-custom-nodes ComfyUI-Manager

Frontend & API

FlagDefaultDescription
--front-end-versioncomfyanonymous/ComfyUI@latestFrontend version in [owner]/[repo]@[version] format. Requires internet to download from GitHub releases. Version can be latest or a semver (e.g. 1.0.0).
--front-end-root PATHLocal filesystem path to the frontend directory. Overrides --front-end-version.
--comfy-api-basehttps://api.comfy.orgBase URL for the ComfyUI API.
--database-urlsqlite:///<ComfyUI>/user/comfyui.dbDatabase URL. Use sqlite:///:memory: for in-memory.
--enable-assetsdisabledEnable the assets system (API routes, database sync, background scanning).
--feature-flag KEY[=VALUE]Set a server feature flag. Bare KEY sets true. Can be repeated. Booleans and numbers are auto-converted.
--list-feature-flagsPrint known CLI-settable feature flags as JSON and exit.
# List available feature flags
python main.py --list-feature-flags

# Set feature flags
python main.py --feature-flag show_signin_button=true

Logging & Misc

FlagDefaultDescription
--verbose [LEVEL]INFOLogging level. Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL. --verbose alone sets DEBUG.
--log-stdoutdisabledSend normal process output to stdout instead of stderr.
--dont-print-serverdisabledDo not print server output to the console.
--multi-userdisabledEnable per-user storage.
--quick-test-for-cidisabledQuick startup test for CI. Exits immediately after initialization.

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.