Skip to main content
ComfyUI supports numerous command line arguments to customize server behavior, hardware configuration, memory management, and performance optimizations.

Running ComfyUI with Arguments

Pass arguments when launching ComfyUI:

Server Configuration

string
default:"127.0.0.1"
Specify the IP address to listen on. Use 0.0.0.0 to listen on all IPv4 addresses, or provide a comma-separated list.
Using --listen without an argument defaults to 0.0.0.0,:: (all IPv4 and IPv6 addresses).
integer
default:"8188"
Set the listen port for the web server.
string
Path to TLS (SSL) key file. Enables HTTPS access. Requires --tls-certfile.
string
Path to TLS (SSL) certificate file. Enables HTTPS access. Requires --tls-keyfile.
string
default:"*"
Enable CORS (Cross-Origin Resource Sharing) with optional origin.
float
default:"100"
Set the maximum upload size in MB.
boolean
Automatically launch ComfyUI in the default browser on startup.
boolean
Disable auto-launching the browser (overrides --auto-launch).
boolean
Suppress server output messages.
boolean
Enable response body compression to reduce bandwidth usage.

Directory Configuration

string
Set the ComfyUI base directory for models, custom_nodes, input, output, temp, and user directories.
string
Set the output directory for generated images. Overrides --base-directory.
string
Set the input directory for source images. Overrides --base-directory.
string
Set the temporary files directory. Overrides --base-directory.
string
Set the user directory with an absolute path. Overrides --base-directory.
string
Load one or more extra_model_paths.yaml files. Can be specified multiple times.

GPU and Device Configuration

integer
Set the CUDA device ID to use. Makes all other devices invisible.
integer
Set the default device ID while keeping other devices visible.
integer
default:"-1"
Use torch-directml for AMD/Intel GPUs on Windows.
string
Sets the oneAPI device selector for Intel GPUs.
boolean
Disables ipex.optimize when loading models with Intel’s Extension for PyTorch.
boolean
Force ComfyUI to act as if the device supports FP8 compute.

VRAM Management

boolean
Store and run everything (text encoders, CLIP, VAE, etc.) on the GPU. Requires high VRAM.
boolean
Keep models in GPU memory after use instead of unloading to CPU. Requires ~12GB+ VRAM.
boolean
Force normal VRAM usage mode (used if lowvram is automatically enabled).
boolean
Split the UNet model to use less VRAM. For GPUs with 4-8GB VRAM.
boolean
Extreme memory saving mode. Use when lowvram isn’t enough.
boolean
Run everything on the CPU. Very slow but works without a GPU.
float
Reserve amount of VRAM (in GB) for OS/other software.
boolean
Force aggressive offloading to RAM instead of keeping models in VRAM when possible.
boolean
Disable dynamic VRAM management and use estimate-based model loading.
integer
default:"2"
Use async weight offloading with specified number of streams. Enabled by default on NVIDIA.
boolean
Disable async weight offloading.

Precision and Data Types

Global Precision

boolean
Force FP32 precision globally. Use if your GPU has issues with FP16.
boolean
Force FP16 precision globally.

UNet/Diffusion Model Precision

boolean
Run the diffusion model in FP32 precision.
boolean
Run the diffusion model in FP16 precision.
boolean
Run the diffusion model in BF16 precision.
boolean
Run the diffusion model in FP64 precision (very slow, for debugging).
boolean
Store UNet weights in FP8 E4M3FN format.
boolean
Store UNet weights in FP8 E5M2 format.
boolean
Store UNet weights in FP8 E8M0FNU format.

VAE Precision

boolean
Run the VAE in FP16. May cause black images on some GPUs.
boolean
Run the VAE in full precision FP32. Use if you get black images.
boolean
Run the VAE in BF16 precision.
boolean
Run the VAE on the CPU instead of GPU. Slower but uses less VRAM.

Text Encoder Precision

boolean
Store text encoder weights in FP8 (E4M3FN variant).
boolean
Store text encoder weights in FP8 (E5M2 variant).
boolean
Store text encoder weights in FP16.
boolean
Store text encoder weights in FP32.
boolean
Store text encoder weights in BF16.

CUDA Configuration

boolean
Enable cudaMallocAsync (enabled by default for PyTorch 2.0+).
boolean
Disable cudaMallocAsync. Use if you get CUDA errors.
boolean
Force channels-last memory format when inferencing models.
boolean
Force non-blocking operations for all tensors. May improve performance on non-NVIDIA systems.
boolean
Disable pinned memory usage.

Attention Mechanisms

boolean
Use split cross attention optimization. Ignored when xformers is used.
boolean
Use sub-quadratic cross attention optimization. Ignored when xformers is used.
boolean
Use PyTorch 2.0+ native cross attention function.
boolean
Use Sage Attention implementation.
boolean
Use FlashAttention for faster attention computation.
boolean
Disable xformers optimization.
boolean
Force enable attention upcasting. Use if you get black images.
boolean
Disable all attention upcasting. For debugging only.

Caching Strategies

boolean
Use the old-style aggressive caching (default behavior).
integer
default:"0"
Use LRU caching with maximum N node results cached. May use more RAM/VRAM.
boolean
Disable caching to reduce RAM/VRAM usage. Executes every node for each run.
float
default:"4.0"
Use RAM pressure caching with specified headroom threshold (in GB). Removes large items when RAM is low.

Preview Configuration

enum
default:"none"
Default preview method for sampler nodes. Options: none, auto, latent2rgb, taesd.
integer
default:"512"
Set the maximum preview size for sampler nodes.

File Loading Optimizations

boolean
Use memory mapping when loading .ckpt/.pt files.
boolean
Don’t use memory mapping when loading safetensors files.
enum
default:"sha256"
Hash function for duplicate filename/contents comparison. Options: md5, sha1, sha256, sha512.

Performance Optimizations

string[]
Enable experimental optimizations that may reduce quality. Use without arguments to enable all, or specify individual features.Available optimizations:
  • fp16_accumulation - Use FP16 accumulation
  • fp8_matrix_mult - Use FP8 matrix multiplication
  • cublas_ops - Use cuBLAS operations
  • autotune - Enable autotuning
These are experimental features that may crash ComfyUI or reduce image quality.
boolean
Make PyTorch use slower deterministic algorithms when possible.
This may not make images fully deterministic in all cases.

Custom Nodes

boolean
Disable loading all custom nodes.
string[]
Specify custom node folders to load even when --disable-all-custom-nodes is enabled.
boolean
Disable loading all API nodes. Also prevents the frontend from communicating with the internet.

ComfyUI Manager

boolean
Enable the ComfyUI-Manager feature.
boolean
Disable only the ComfyUI-Manager UI and endpoints. Background tasks still operate. Requires --enable-manager.
boolean
Enable the legacy UI of ComfyUI-Manager. Requires --enable-manager.

Frontend Configuration

string
default:"comfyanonymous/ComfyUI@latest"
Specify the frontend version to use. Format: [owner]/[repo]@[version]
string
Local filesystem path to frontend directory. Overrides --front-end-version.

Multi-User and Database

boolean
Enable per-user storage.
string
default:"sqlite:///user/comfyui.db"
Specify the database URL.
boolean
Disable asset scanning on startup for database synchronization.
string
default:"https://api.comfy.org"
Set the base URL for the ComfyUI API.

Metadata and Output

boolean
Disable saving prompt metadata in output files.

Logging

enum
default:"INFO"
Set the logging level. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL.
boolean
Send process output to stdout instead of stderr.

Development and Testing

boolean
Quick test mode for continuous integration.
boolean
Enable features for Windows standalone build (auto-launch, etc.).

Example Configurations

Low VRAM Setup (4GB GPU)

High Performance (24GB+ GPU)

CPU Only

Remote Server

Development Mode

Shared Models with A1111

Intel Arc GPU

AMD ROCm