mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
Update configuration
This commit is contained in:
parent
55b187768a
commit
4028c1663b
@ -23,7 +23,7 @@ args: Configuration
|
|||||||
_module_properties = create_module_properties()
|
_module_properties = create_module_properties()
|
||||||
|
|
||||||
|
|
||||||
def _create_parser() -> EnhancedConfigArgParser:
|
def _create_parser(enable_custom_nodes_configuration=True) -> EnhancedConfigArgParser:
|
||||||
parser = EnhancedConfigArgParser(default_config_files=['config.yaml', 'config.json', 'config.cfg', 'config.ini'],
|
parser = EnhancedConfigArgParser(default_config_files=['config.yaml', 'config.json', 'config.cfg', 'config.ini'],
|
||||||
auto_env_var_prefix='COMFYUI_',
|
auto_env_var_prefix='COMFYUI_',
|
||||||
args_for_setting_config_path=["-c", "--config"],
|
args_for_setting_config_path=["-c", "--config"],
|
||||||
@ -293,6 +293,7 @@ def _create_parser() -> EnhancedConfigArgParser:
|
|||||||
parser.add_argument("--workflows", type=str, action=FlattenAndAppendAction, nargs='+', default=[], help="Execute the API workflow(s) specified in the provided files. For each workflow, its outputs will be printed to a line to standard out. Application logging will be redirected to standard error. Use `-` to signify standard in.")
|
parser.add_argument("--workflows", type=str, action=FlattenAndAppendAction, nargs='+', default=[], help="Execute the API workflow(s) specified in the provided files. For each workflow, its outputs will be printed to a line to standard out. Application logging will be redirected to standard error. Use `-` to signify standard in.")
|
||||||
|
|
||||||
# now give plugins a chance to add configuration
|
# now give plugins a chance to add configuration
|
||||||
|
if enable_custom_nodes_configuration:
|
||||||
for entry_point in entry_points().select(group='comfyui.custom_config'):
|
for entry_point in entry_points().select(group='comfyui.custom_config'):
|
||||||
try:
|
try:
|
||||||
plugin_callable: ConfigurationExtender | ModuleType = entry_point.load()
|
plugin_callable: ConfigurationExtender | ModuleType = entry_point.load()
|
||||||
@ -311,13 +312,15 @@ def _create_parser() -> EnhancedConfigArgParser:
|
|||||||
|
|
||||||
|
|
||||||
def _parse_args(parser: Optional[argparse.ArgumentParser] = None, args_parsing: bool = False) -> Configuration:
|
def _parse_args(parser: Optional[argparse.ArgumentParser] = None, args_parsing: bool = False) -> Configuration:
|
||||||
if parser is None:
|
|
||||||
parser = _create_parser()
|
|
||||||
|
|
||||||
if args_parsing:
|
if args_parsing:
|
||||||
args, _, config_files = parser.parse_known_args_with_config_files()
|
args = sys.argv[1:]
|
||||||
else:
|
else:
|
||||||
args, _, config_files = parser.parse_known_args_with_config_files([])
|
args = []
|
||||||
|
if parser is None:
|
||||||
|
parser = _create_parser('--disable-all-custom-nodes' not in frozenset(arg.lower() for arg in args))
|
||||||
|
|
||||||
|
args, _, config_files = parser.parse_known_args_with_config_files(args)
|
||||||
|
|
||||||
|
|
||||||
if args.windows_standalone_build:
|
if args.windows_standalone_build:
|
||||||
args.auto_launch = True
|
args.auto_launch = True
|
||||||
|
|||||||
@ -39,22 +39,25 @@ usage: comfyui [-h] [-c CONFIG_FILE]
|
|||||||
[--disable-ipex-optimize] [--supports-fp8-compute]
|
[--disable-ipex-optimize] [--supports-fp8-compute]
|
||||||
[--preview-method [none,auto,latent2rgb,taesd]]
|
[--preview-method [none,auto,latent2rgb,taesd]]
|
||||||
[--preview-size PREVIEW_SIZE]
|
[--preview-size PREVIEW_SIZE]
|
||||||
[--cache-classic | --cache-lru CACHE_LRU | --cache-none]
|
[--cache-classic | --cache-lru CACHE_LRU | --cache-none | --cache-ram [CACHE_RAM]]
|
||||||
[--use-split-cross-attention | --use-quad-cross-attention | --use-pytorch-cross-attention | --use-sage-attention | --use-flash-attention]
|
[--use-split-cross-attention | --use-quad-cross-attention | --use-pytorch-cross-attention | --use-sage-attention | --use-flash-attention]
|
||||||
[--disable-xformers]
|
[--disable-xformers]
|
||||||
[--force-upcast-attention | --dont-upcast-attention]
|
[--force-upcast-attention | --dont-upcast-attention]
|
||||||
|
[--enable-manager]
|
||||||
|
[--disable-manager-ui | --enable-manager-legacy-ui]
|
||||||
[--gpu-only | --highvram | --normalvram | --lowvram | --novram | --cpu]
|
[--gpu-only | --highvram | --normalvram | --lowvram | --novram | --cpu]
|
||||||
[--reserve-vram RESERVE_VRAM] [--async-offload]
|
[--reserve-vram RESERVE_VRAM] [--async-offload [NUM_STREAMS]]
|
||||||
[--force-non-blocking]
|
[--disable-async-offload] [--force-non-blocking]
|
||||||
[--default-hashing-function {md5,sha1,sha256,sha512}]
|
[--default-hashing-function {md5,sha1,sha256,sha512}]
|
||||||
[--disable-smart-memory] [--deterministic] [--fast [FAST ...]]
|
[--disable-smart-memory] [--deterministic] [--fast [FAST ...]]
|
||||||
[--mmap-torch-files] [--disable-mmap] [--dont-print-server]
|
[--disable-pinned-memory] [--mmap-torch-files] [--disable-mmap]
|
||||||
[--quick-test-for-ci] [--windows-standalone-build]
|
[--dont-print-server] [--quick-test-for-ci]
|
||||||
[--disable-metadata] [--disable-all-custom-nodes]
|
[--windows-standalone-build] [--disable-metadata]
|
||||||
|
[--disable-all-custom-nodes]
|
||||||
[--whitelist-custom-nodes WHITELIST_CUSTOM_NODES [WHITELIST_CUSTOM_NODES ...]]
|
[--whitelist-custom-nodes WHITELIST_CUSTOM_NODES [WHITELIST_CUSTOM_NODES ...]]
|
||||||
[--blacklist-custom-nodes BLACKLIST_CUSTOM_NODES [BLACKLIST_CUSTOM_NODES ...]]
|
[--blacklist-custom-nodes BLACKLIST_CUSTOM_NODES [BLACKLIST_CUSTOM_NODES ...]]
|
||||||
[--disable-api-nodes] [--multi-user] [--create-directories]
|
[--disable-api-nodes] [--enable-eval] [--multi-user]
|
||||||
[--log-stdout]
|
[--create-directories] [--log-stdout]
|
||||||
[--plausible-analytics-base-url PLAUSIBLE_ANALYTICS_BASE_URL]
|
[--plausible-analytics-base-url PLAUSIBLE_ANALYTICS_BASE_URL]
|
||||||
[--plausible-analytics-domain PLAUSIBLE_ANALYTICS_DOMAIN]
|
[--plausible-analytics-domain PLAUSIBLE_ANALYTICS_DOMAIN]
|
||||||
[--analytics-use-identity-provider]
|
[--analytics-use-identity-provider]
|
||||||
@ -68,6 +71,7 @@ usage: comfyui [-h] [-c CONFIG_FILE]
|
|||||||
[--otel-service-version OTEL_SERVICE_VERSION]
|
[--otel-service-version OTEL_SERVICE_VERSION]
|
||||||
[--otel-exporter-otlp-endpoint OTEL_EXPORTER_OTLP_ENDPOINT]
|
[--otel-exporter-otlp-endpoint OTEL_EXPORTER_OTLP_ENDPOINT]
|
||||||
[--force-channels-last] [--force-hf-local-dir-mode]
|
[--force-channels-last] [--force-hf-local-dir-mode]
|
||||||
|
[--enable-video-to-image-fallback]
|
||||||
[--front-end-version FRONT_END_VERSION]
|
[--front-end-version FRONT_END_VERSION]
|
||||||
[--panic-when PANIC_WHEN [PANIC_WHEN ...]]
|
[--panic-when PANIC_WHEN [PANIC_WHEN ...]]
|
||||||
[--front-end-root FRONT_END_ROOT]
|
[--front-end-root FRONT_END_ROOT]
|
||||||
@ -81,6 +85,7 @@ usage: comfyui [-h] [-c CONFIG_FILE]
|
|||||||
[--block-runtime-package-installation]
|
[--block-runtime-package-installation]
|
||||||
[--database-url DATABASE_URL]
|
[--database-url DATABASE_URL]
|
||||||
[--workflows WORKFLOWS [WORKFLOWS ...]]
|
[--workflows WORKFLOWS [WORKFLOWS ...]]
|
||||||
|
[--disable-requests-caching]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
@ -207,6 +212,11 @@ options:
|
|||||||
COMFYUI_CACHE_LRU]
|
COMFYUI_CACHE_LRU]
|
||||||
--cache-none Reduced RAM/VRAM usage at the expense of executing
|
--cache-none Reduced RAM/VRAM usage at the expense of executing
|
||||||
every node for each run. [env var: COMFYUI_CACHE_NONE]
|
every node for each run. [env var: COMFYUI_CACHE_NONE]
|
||||||
|
--cache-ram [CACHE_RAM]
|
||||||
|
Use RAM pressure caching with the specified headroom
|
||||||
|
threshold. If available RAM drops below the threhold
|
||||||
|
the cache remove large items to free RAM. Default 4GB
|
||||||
|
[env var: COMFYUI_CACHE_RAM]
|
||||||
--use-split-cross-attention
|
--use-split-cross-attention
|
||||||
Use the split cross attention optimization. Ignored
|
Use the split cross attention optimization. Ignored
|
||||||
when xformers is used. [env var:
|
when xformers is used. [env var:
|
||||||
@ -233,6 +243,15 @@ options:
|
|||||||
Disable all upcasting of attention. Should be
|
Disable all upcasting of attention. Should be
|
||||||
unnecessary except for debugging. [env var:
|
unnecessary except for debugging. [env var:
|
||||||
COMFYUI_DONT_UPCAST_ATTENTION]
|
COMFYUI_DONT_UPCAST_ATTENTION]
|
||||||
|
--enable-manager Enable the ComfyUI-Manager feature. [env var:
|
||||||
|
COMFYUI_ENABLE_MANAGER]
|
||||||
|
--disable-manager-ui Disables only the ComfyUI-Manager UI and endpoints.
|
||||||
|
Scheduled installations and similar background tasks
|
||||||
|
will still operate. [env var:
|
||||||
|
COMFYUI_DISABLE_MANAGER_UI]
|
||||||
|
--enable-manager-legacy-ui
|
||||||
|
Enables the legacy UI of ComfyUI-Manager [env var:
|
||||||
|
COMFYUI_ENABLE_MANAGER_LEGACY_UI]
|
||||||
--gpu-only Store and run everything (text encoders/CLIP models,
|
--gpu-only Store and run everything (text encoders/CLIP models,
|
||||||
etc... on the GPU). [env var: COMFYUI_GPU_ONLY]
|
etc... on the GPU). [env var: COMFYUI_GPU_ONLY]
|
||||||
--highvram By default models will be unloaded to CPU memory after
|
--highvram By default models will be unloaded to CPU memory after
|
||||||
@ -247,11 +266,17 @@ options:
|
|||||||
COMFYUI_CPU]
|
COMFYUI_CPU]
|
||||||
--reserve-vram RESERVE_VRAM
|
--reserve-vram RESERVE_VRAM
|
||||||
Set the amount of vram in GB you want to reserve for
|
Set the amount of vram in GB you want to reserve for
|
||||||
use by your OS/other software. By default some amount
|
use by your OS/other software. Defaults to 0.0, since
|
||||||
is reserved depending on your OS. [env var:
|
this isn't conceptually robust anyway. [env var:
|
||||||
COMFYUI_RESERVE_VRAM]
|
COMFYUI_RESERVE_VRAM]
|
||||||
--async-offload Use async weight offloading. [env var:
|
--async-offload [NUM_STREAMS]
|
||||||
|
Use async weight offloading. An optional argument
|
||||||
|
controls the amount of offload streams. Default is 2.
|
||||||
|
Enabled by default on Nvidia. [env var:
|
||||||
COMFYUI_ASYNC_OFFLOAD]
|
COMFYUI_ASYNC_OFFLOAD]
|
||||||
|
--disable-async-offload
|
||||||
|
Disable async weight offloading. [env var:
|
||||||
|
COMFYUI_DISABLE_ASYNC_OFFLOAD]
|
||||||
--force-non-blocking Force ComfyUI to use non-blocking operations for all
|
--force-non-blocking Force ComfyUI to use non-blocking operations for all
|
||||||
applicable tensors. This may improve performance on
|
applicable tensors. This may improve performance on
|
||||||
some non-Nvidia systems but can cause issues with some
|
some non-Nvidia systems but can cause issues with some
|
||||||
@ -274,6 +299,9 @@ options:
|
|||||||
ones. Current valid optimizations: fp16_accumulation
|
ones. Current valid optimizations: fp16_accumulation
|
||||||
fp8_matrix_mult cublas_ops autotune [env var:
|
fp8_matrix_mult cublas_ops autotune [env var:
|
||||||
COMFYUI_FAST]
|
COMFYUI_FAST]
|
||||||
|
--disable-pinned-memory
|
||||||
|
Disable pinned memory use. [env var:
|
||||||
|
COMFYUI_DISABLE_PINNED_MEMORY]
|
||||||
--mmap-torch-files Use mmap when loading ckpt/pt files. [env var:
|
--mmap-torch-files Use mmap when loading ckpt/pt files. [env var:
|
||||||
COMFYUI_MMAP_TORCH_FILES]
|
COMFYUI_MMAP_TORCH_FILES]
|
||||||
--disable-mmap Don't use mmap when loading safetensors. [env var:
|
--disable-mmap Don't use mmap when loading safetensors. [env var:
|
||||||
@ -300,8 +328,11 @@ options:
|
|||||||
Specify custom node folders to never load. Accepts
|
Specify custom node folders to never load. Accepts
|
||||||
shell-style globs. [env var:
|
shell-style globs. [env var:
|
||||||
COMFYUI_BLACKLIST_CUSTOM_NODES]
|
COMFYUI_BLACKLIST_CUSTOM_NODES]
|
||||||
--disable-api-nodes Disable loading all api nodes. [env var:
|
--disable-api-nodes Disable loading all api nodes. Also prevents the
|
||||||
COMFYUI_DISABLE_API_NODES]
|
frontend from communicating with the internet. [env
|
||||||
|
var: COMFYUI_DISABLE_API_NODES]
|
||||||
|
--enable-eval Enable nodes that can evaluate Python code in
|
||||||
|
workflows. [env var: COMFYUI_ENABLE_EVAL]
|
||||||
--multi-user Enables per-user storage. [env var:
|
--multi-user Enables per-user storage. [env var:
|
||||||
COMFYUI_MULTI_USER]
|
COMFYUI_MULTI_USER]
|
||||||
--create-directories Creates the default models/, input/, output/ and temp/
|
--create-directories Creates the default models/, input/, output/ and temp/
|
||||||
@ -376,6 +407,10 @@ options:
|
|||||||
argument instead of models/huggingface_cache with the
|
argument instead of models/huggingface_cache with the
|
||||||
"cache_dir" argument, recreating the traditional file
|
"cache_dir" argument, recreating the traditional file
|
||||||
structure. [env var: COMFYUI_FORCE_HF_LOCAL_DIR_MODE]
|
structure. [env var: COMFYUI_FORCE_HF_LOCAL_DIR_MODE]
|
||||||
|
--enable-video-to-image-fallback
|
||||||
|
Enable fallback to convert video frames to images for
|
||||||
|
models that do not natively support video inputs. [env
|
||||||
|
var: COMFYUI_ENABLE_VIDEO_TO_IMAGE_FALLBACK]
|
||||||
--front-end-version FRONT_END_VERSION
|
--front-end-version FRONT_END_VERSION
|
||||||
Specifies the version of the frontend to be used. This
|
Specifies the version of the frontend to be used. This
|
||||||
command needs internet connectivity to query and
|
command needs internet connectivity to query and
|
||||||
@ -442,6 +477,9 @@ options:
|
|||||||
to a line to standard out. Application logging will be
|
to a line to standard out. Application logging will be
|
||||||
redirected to standard error. Use `-` to signify
|
redirected to standard error. Use `-` to signify
|
||||||
standard in. [env var: COMFYUI_WORKFLOWS]
|
standard in. [env var: COMFYUI_WORKFLOWS]
|
||||||
|
--disable-requests-caching
|
||||||
|
Disable requests caching (useful for testing) [env
|
||||||
|
var: COMFYUI_DISABLE_REQUESTS_CACHING]
|
||||||
|
|
||||||
Args that start with '--' can also be set in a config file (config.yaml or
|
Args that start with '--' can also be set in a config file (config.yaml or
|
||||||
config.json or config.cfg or config.ini or specified via -c). Config file
|
config.json or config.cfg or config.ini or specified via -c). Config file
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user