Open-Source Wikis

/

ComfyUI

/

Reference

/

Configuration

comfyanonymous/ComfyUI

Configuration

Everything you can tune at runtime — CLI flags, environment variables, and the extra_model_paths.yaml file. The authoritative source is comfy/cli_args.py.

CLI flags by category

Network and TLS

Flag Default Purpose
--listen [IP[,IP]] 127.0.0.1 Listen address. Without arg → 0.0.0.0,::
--port N 8188 Listen port
--tls-keyfile, --tls-certfile - Enable HTTPS
--enable-cors-header [ORIGIN] - CORS. Without arg → *
--enable-compress-response-body off Gzip JSON/text responses
--max-upload-size MB 100 Max upload size in MB

Directories

Flag Purpose
--base-directory PATH Set the base for models/, custom_nodes/, input/, output/, temp/, user/
--output-directory PATH Override output directory
--temp-directory PATH Override temp directory
--input-directory PATH Override input directory
--user-directory PATH Override user directory
--extra-model-paths-config PATH... Load one or more extra_model_paths.yaml files

Devices

Flag Purpose
--cpu Run everything on CPU
--cuda-device DEVICE_ID Restrict to a single CUDA device
--default-device DEFAULT_DEVICE_ID Default device while keeping all visible
--directml [DEVICE] Use torch-directml on Windows for AMD/Intel
--oneapi-device-selector STR oneAPI device selector for Intel XPU
--disable-ipex-optimize Disable Intel IPEX optimizations
--cuda-malloc / --disable-cuda-malloc Force enable / disable cudaMallocAsync

Memory

Flag Purpose
--gpu-only Keep everything (text encoders, CLIP, etc.) on GPU
--highvram Don't unload to CPU after use
--normalvram Force NORMAL_VRAM state
--lowvram Split-load the unet
--novram When --lowvram isn't enough
--reserve-vram GB Reserve GPU memory for OS/other apps
--async-offload [N] Async weight offload with N streams (default 2). Default on for NVIDIA
--disable-async-offload Disable async offload
--enable-dynamic-vram / --disable-dynamic-vram Force enable/disable DynamicVRAM
--disable-smart-memory Aggressively offload to CPU between models

Dtypes

Flag Purpose
--force-fp32 / --force-fp16 Coarse override
--fp32-unet / --fp16-unet / --bf16-unet / --fp64-unet Diffusion model dtype
--fp8_e4m3fn-unet / --fp8_e5m2-unet / --fp8_e8m0fnu-unet FP8 storage dtypes for the unet
--fp16-vae / --fp32-vae / --bf16-vae VAE dtype
--cpu-vae Run VAE on CPU
--fp16-text-enc / --fp32-text-enc / --bf16-text-enc / --fp8_e4m3fn-text-enc / --fp8_e5m2-text-enc Text encoder dtype
--fp16-intermediates Use fp16 for inter-node tensors
--force-channels-last Channels-last memory layout
--supports-fp8-compute Pretend the device supports FP8 compute

Attention

Flag Purpose
--use-pytorch-cross-attention torch SDPA
--use-flash-attention FlashAttention
--use-sage-attention Sage attention
--use-split-cross-attention Chunked attention
--use-quad-cross-attention Sub-quadratic
--disable-xformers Don't use xformers even if installed
--force-upcast-attention / --dont-upcast-attention Override attention upcasting heuristics

Caching

Flag Purpose
--cache-classic Aggressive cache (drop ASAP)
--cache-lru N Bounded LRU
--cache-ram [GB] RAM-pressure cache; default 25% of system RAM (4-32 GB)
--cache-none No cache

Performance

Flag Purpose
--fast [features...] Enable experimental optimizations: fp16_accumulation, fp8_matrix_mult, cublas_ops, autotune. With no args, all are enabled.
--mmap-torch-files mmap when loading ckpt/pt files
--disable-mmap Don't mmap safetensors
--disable-pinned-memory Disable pinned host memory pool
--deterministic Use deterministic torch algorithms
--force-non-blocking Use non-blocking tensor ops everywhere

Frontend / manager

Flag Purpose
--front-end-version OWNER/REPO@VERSION Resolve a specific frontend release. Default comfyanonymous/ComfyUI@latest (uses bundled)
--front-end-root PATH Use a pre-extracted frontend bundle
--enable-manager Enable ComfyUI-Manager
--disable-manager-ui Hide the Manager UI but keep background features
--enable-manager-legacy-ui Use the legacy Manager UI
--auto-launch / --disable-auto-launch Open the browser at startup

Custom nodes

Flag Purpose
--disable-all-custom-nodes Skip loading custom nodes
--whitelist-custom-nodes NAME... Re-enable specific custom nodes
--disable-api-nodes Disable comfy_api_nodes/

Database / assets

Flag Purpose
--database-url URL SQLAlchemy URL. Default sqlite:///<repo>/user/comfyui.db. sqlite:///:memory: works
--enable-assets Turn on the assets API + DB sync + scanner

Previews

Flag Purpose
--preview-method none|auto|latent2rgb|taesd Preview style during sampling
--preview-size N Max preview size in pixels (default 512)

Misc

Flag Purpose
--disable-metadata Don't embed prompt metadata in saved files
--multi-user Per-user storage
--default-hashing-function md5|sha1|sha256|sha512 Hash for duplicate detection. Default sha256
--comfy-api-base URL API base for paid integrations. Default https://api.comfy.org
--verbose [LEVEL] Logging level. Default INFO. With no arg → DEBUG
--log-stdout Send logs to stdout instead of stderr
--dont-print-server Suppress server output
--quick-test-for-ci Exit immediately after init (CI smoke)
--windows-standalone-build Behavior tweaks for the Windows portable build

Environment variables

main.py sets these before importing torch:

Variable Set when
HF_HUB_DISABLE_TELEMETRY=1 Always
DO_NOT_TRACK=1 Always
MIMALLOC_PURGE_DELAY=0 On Windows
TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 Always (ROCm AOT Triton experimental)
CUBLAS_WORKSPACE_CONFIG=:4096:8 When --deterministic and not already set
CUDA_VISIBLE_DEVICES, HIP_VISIBLE_DEVICES, ASCEND_RT_VISIBLE_DEVICES When --cuda-device or --default-device is set
ONEAPI_DEVICE_SELECTOR When --oneapi-device-selector is set
OCL_SET_SVM_SIZE=262144 On ROCm (per AMD's request)

User-set env vars also matter:

Variable Effect
HSA_OVERRIDE_GFX_VERSION AMD: spoof gfx version for unsupported cards
PYTORCH_TUNABLEOP_ENABLED=1 AMD: enable TunableOp (slow first run, faster after)

extra_model_paths.yaml

Copy extra_model_paths.yaml.example to extra_model_paths.yaml (or pass via --extra-model-paths-config) and edit. Each entry adds search paths for a folder type:

a1111:
  base_path: /path/to/stable-diffusion-webui/
  checkpoints: models/Stable-diffusion
  vae: models/VAE
  loras: |
    models/Lora
    models/LyCORIS

The runtime merges these into folder_paths.folder_names_and_paths at startup. See utils/extra_config.py for the loader.

comfy.options

comfy/options.py is a tiny module with one boolean: args_parsing. Setting it to True (which main.py does) lets comfy.cli_args parse sys.argv. Tests import comfy.options and leave args_parsing False to get default args.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Configuration – ComfyUI wiki | Factory