mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-25 10:36:57 +08:00
Compare commits
9 Commits
matt/opena
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 63bcaec5d1 | |||
| b30e980a20 | |||
| 39f963b4b0 | |||
| ea62dc11c9 | |||
| 32a7092c52 | |||
| 08d809d128 | |||
| 0af123022d | |||
| d80fcafee7 | |||
| 187442cca4 |
@ -433,7 +433,7 @@ See also: [https://www.comfy.org/](https://www.comfy.org/)
|
|||||||
|
|
||||||
## Frontend Development
|
## Frontend Development
|
||||||
|
|
||||||
As of August 15, 2024, we have transitioned to a new frontend, which is now hosted in a separate repository: [ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend). This repository now hosts the compiled JS (from TS/Vue) under the `web/` directory.
|
As of August 15, 2024, we have transitioned to a new frontend, which is now hosted in a separate repository: [ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend). The compiled JS files (from TS/Vue) are published to [pypi](https://pypi.org/project/comfyui-frontend-package) and installed as a dependency in ComfyUI.
|
||||||
|
|
||||||
### Reporting Issues and Requesting Features
|
### Reporting Issues and Requesting Features
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,40 @@ import logging
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
ANSI_NAMED_COLORS = {
|
||||||
|
'black': '\033[30m',
|
||||||
|
'red': '\033[31m',
|
||||||
|
'green': '\033[32m',
|
||||||
|
'yellow': '\033[33m',
|
||||||
|
'blue': '\033[34m',
|
||||||
|
'magenta': '\033[35m',
|
||||||
|
'cyan': '\033[36m',
|
||||||
|
'white': '\033[37m',
|
||||||
|
}
|
||||||
|
|
||||||
|
ANSI_LEVEL_COLORS = {
|
||||||
|
'DEBUG': ANSI_NAMED_COLORS['cyan'],
|
||||||
|
'INFO': ANSI_NAMED_COLORS['green'],
|
||||||
|
'WARNING': ANSI_NAMED_COLORS['yellow'],
|
||||||
|
'ERROR': ANSI_NAMED_COLORS['red'],
|
||||||
|
'CRITICAL': ANSI_NAMED_COLORS['magenta'],
|
||||||
|
}
|
||||||
|
|
||||||
|
ANSI_RESET = '\033[0m'
|
||||||
|
ANSI_BOLD = '\033[1m'
|
||||||
|
|
||||||
|
|
||||||
|
class ColoredFormatter(logging.Formatter):
|
||||||
|
def format(self, record):
|
||||||
|
color = ANSI_LEVEL_COLORS.get(record.levelname, '')
|
||||||
|
bold = ANSI_BOLD if record.levelno >= logging.WARNING else ''
|
||||||
|
level_tag = f"{bold}{color}[{record.levelname}]{ANSI_RESET} "
|
||||||
|
message = super().format(record)
|
||||||
|
line_color = ANSI_NAMED_COLORS.get(getattr(record, 'color', ''), '')
|
||||||
|
if line_color:
|
||||||
|
return f"{level_tag}{line_color}{message}{ANSI_RESET}"
|
||||||
|
return level_tag + message
|
||||||
|
|
||||||
logs = None
|
logs = None
|
||||||
stdout_interceptor = None
|
stdout_interceptor = None
|
||||||
stderr_interceptor = None
|
stderr_interceptor = None
|
||||||
@ -68,8 +102,10 @@ def setup_logger(log_level: str = 'INFO', capacity: int = 300, use_stdout: bool
|
|||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(log_level)
|
logger.setLevel(log_level)
|
||||||
|
|
||||||
|
formatter = ColoredFormatter("%(message)s")
|
||||||
|
|
||||||
stream_handler = logging.StreamHandler()
|
stream_handler = logging.StreamHandler()
|
||||||
stream_handler.setFormatter(logging.Formatter("%(message)s"))
|
stream_handler.setFormatter(formatter)
|
||||||
|
|
||||||
if use_stdout:
|
if use_stdout:
|
||||||
# Only errors and critical to stderr
|
# Only errors and critical to stderr
|
||||||
@ -77,7 +113,7 @@ def setup_logger(log_level: str = 'INFO', capacity: int = 300, use_stdout: bool
|
|||||||
|
|
||||||
# Lesser to stdout
|
# Lesser to stdout
|
||||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||||
stdout_handler.setFormatter(logging.Formatter("%(message)s"))
|
stdout_handler.setFormatter(formatter)
|
||||||
stdout_handler.addFilter(lambda record: record.levelno < logging.ERROR)
|
stdout_handler.addFilter(lambda record: record.levelno < logging.ERROR)
|
||||||
logger.addHandler(stdout_handler)
|
logger.addHandler(stdout_handler)
|
||||||
|
|
||||||
|
|||||||
@ -111,7 +111,7 @@ parser.add_argument("--preview-method", type=LatentPreviewMethod, default=Latent
|
|||||||
parser.add_argument("--preview-size", type=int, default=512, help="Sets the maximum preview size for sampler nodes.")
|
parser.add_argument("--preview-size", type=int, default=512, help="Sets the maximum preview size for sampler nodes.")
|
||||||
|
|
||||||
cache_group = parser.add_mutually_exclusive_group()
|
cache_group = parser.add_mutually_exclusive_group()
|
||||||
cache_group.add_argument("--cache-ram", nargs='*', type=float, default=[], metavar="GB", help="Use RAM pressure caching with the specified headroom thresholds. This is the default caching mode. The first value sets the active-cache threshold; the optional second value sets the inactive-cache/pin threshold. Defaults when no values are provided: active 25%% of system RAM (min 4GB, max 32GB), inactive 75%% of system RAM (min 12GB, max 96GB).")
|
cache_group.add_argument("--cache-ram", nargs='*', type=float, default=[], metavar="GB", help="Use RAM pressure caching with the specified headroom thresholds. This is the default caching mode. The first value sets the active-cache threshold; the optional second value sets the inactive-cache/pin threshold. Defaults when no values are provided: active 10%% of system RAM (min 2GB, max 10GB), inactive 100%% of system RAM (max 96GB).")
|
||||||
cache_group.add_argument("--cache-classic", action="store_true", help="Use the old style (aggressive) caching.")
|
cache_group.add_argument("--cache-classic", action="store_true", help="Use the old style (aggressive) caching.")
|
||||||
cache_group.add_argument("--cache-lru", type=int, default=0, help="Use LRU caching with a maximum of N node results cached. May use more RAM/VRAM.")
|
cache_group.add_argument("--cache-lru", type=int, default=0, help="Use LRU caching with a maximum of N node results cached. May use more RAM/VRAM.")
|
||||||
cache_group.add_argument("--cache-none", action="store_true", help="Reduced RAM/VRAM usage at the expense of executing every node for each run.")
|
cache_group.add_argument("--cache-none", action="store_true", help="Reduced RAM/VRAM usage at the expense of executing every node for each run.")
|
||||||
|
|||||||
@ -741,12 +741,12 @@ optimized_attention = attention_basic
|
|||||||
if model_management.sage_attention_enabled():
|
if model_management.sage_attention_enabled():
|
||||||
logging.info("Using sage attention")
|
logging.info("Using sage attention")
|
||||||
optimized_attention = attention_sage
|
optimized_attention = attention_sage
|
||||||
elif model_management.xformers_enabled():
|
|
||||||
logging.info("Using xformers attention")
|
|
||||||
optimized_attention = attention_xformers
|
|
||||||
elif model_management.flash_attention_enabled():
|
elif model_management.flash_attention_enabled():
|
||||||
logging.info("Using Flash Attention")
|
logging.info("Using Flash Attention")
|
||||||
optimized_attention = attention_flash
|
optimized_attention = attention_flash
|
||||||
|
elif model_management.xformers_enabled():
|
||||||
|
logging.info("Using xformers attention")
|
||||||
|
optimized_attention = attention_xformers
|
||||||
elif model_management.pytorch_attention_enabled():
|
elif model_management.pytorch_attention_enabled():
|
||||||
logging.info("Using pytorch attention")
|
logging.info("Using pytorch attention")
|
||||||
optimized_attention = attention_pytorch
|
optimized_attention = attention_pytorch
|
||||||
|
|||||||
@ -1217,7 +1217,7 @@ def get_aimdo_cast_buffer(offload_stream, device):
|
|||||||
def get_pin_buffer(offload_stream):
|
def get_pin_buffer(offload_stream):
|
||||||
pin_buffer = STREAM_PIN_BUFFERS.get(offload_stream, None)
|
pin_buffer = STREAM_PIN_BUFFERS.get(offload_stream, None)
|
||||||
if pin_buffer is None:
|
if pin_buffer is None:
|
||||||
pin_buffer = comfy_aimdo.host_buffer.HostBuffer(0, 0, pinned_hostbuf_size(8 * 1024**3))
|
pin_buffer = comfy_aimdo.host_buffer.HostBuffer(0, 0, pinned_hostbuf_size(8 * 1024**3), mark_cold=False)
|
||||||
STREAM_PIN_BUFFERS[offload_stream] = pin_buffer
|
STREAM_PIN_BUFFERS[offload_stream] = pin_buffer
|
||||||
elif offload_stream is not None:
|
elif offload_stream is not None:
|
||||||
event = getattr(pin_buffer, "_comfy_event", None)
|
event = getattr(pin_buffer, "_comfy_event", None)
|
||||||
|
|||||||
@ -265,7 +265,6 @@ def _calc_cond_batch(model: BaseModel, conds: list[list[dict]], x_in: torch.Tens
|
|||||||
input_shape = [len(batch_amount) * first_shape[0]] + list(first_shape)[1:]
|
input_shape = [len(batch_amount) * first_shape[0]] + list(first_shape)[1:]
|
||||||
cond_shapes = collections.defaultdict(list)
|
cond_shapes = collections.defaultdict(list)
|
||||||
for tt in batch_amount:
|
for tt in batch_amount:
|
||||||
cond = {k: v.size() for k, v in to_run[tt][0].conditioning.items()}
|
|
||||||
for k, v in to_run[tt][0].conditioning.items():
|
for k, v in to_run[tt][0].conditioning.items():
|
||||||
cond_shapes[k].append(v.size())
|
cond_shapes[k].append(v.size())
|
||||||
|
|
||||||
|
|||||||
8
main.py
8
main.py
@ -286,8 +286,8 @@ def prompt_worker(q, server_instance):
|
|||||||
cache_ram = 0
|
cache_ram = 0
|
||||||
cache_ram_inactive = 0
|
cache_ram_inactive = 0
|
||||||
if not args.cache_classic and not args.cache_none and args.cache_lru <= 0:
|
if not args.cache_classic and not args.cache_none and args.cache_lru <= 0:
|
||||||
cache_ram = min(32.0, max(4.0, comfy.model_management.total_ram * 0.25 / 1024.0))
|
cache_ram = min(10.0, max(2.0, comfy.model_management.total_ram * 0.10 / 1024.0))
|
||||||
cache_ram_inactive = min(96.0, max(12.0, comfy.model_management.total_ram * 0.75 / 1024.0))
|
cache_ram_inactive = min(96.0, comfy.model_management.total_ram / 1024.0)
|
||||||
if len(args.cache_ram) > 0:
|
if len(args.cache_ram) > 0:
|
||||||
cache_ram = args.cache_ram[0]
|
cache_ram = args.cache_ram[0]
|
||||||
if len(args.cache_ram) > 1:
|
if len(args.cache_ram) > 1:
|
||||||
@ -344,9 +344,9 @@ def prompt_worker(q, server_instance):
|
|||||||
# Log Time in a more readable way after 10 minutes
|
# Log Time in a more readable way after 10 minutes
|
||||||
if execution_time > 600:
|
if execution_time > 600:
|
||||||
execution_time = time.strftime("%H:%M:%S", time.gmtime(execution_time))
|
execution_time = time.strftime("%H:%M:%S", time.gmtime(execution_time))
|
||||||
logging.info(f"Prompt executed in {execution_time}")
|
logging.info(f"Prompt executed in {execution_time}", extra={'color': 'green'})
|
||||||
else:
|
else:
|
||||||
logging.info("Prompt executed in {:.2f} seconds".format(execution_time))
|
logging.info("Prompt executed in {:.2f} seconds".format(execution_time), extra={'color': 'green'})
|
||||||
|
|
||||||
if not asset_seeder.is_disabled():
|
if not asset_seeder.is_disabled():
|
||||||
paths = _collect_output_absolute_paths(e.history_result)
|
paths = _collect_output_absolute_paths(e.history_result)
|
||||||
|
|||||||
11
openapi.yaml
11
openapi.yaml
@ -9585,16 +9585,9 @@ components:
|
|||||||
description: List of plan features
|
description: List of plan features
|
||||||
|
|
||||||
BillingStatus:
|
BillingStatus:
|
||||||
type: object
|
type: string
|
||||||
x-runtime: [cloud]
|
x-runtime: [cloud]
|
||||||
description: "[cloud-only] Overall billing and subscription status."
|
description: "[cloud-only] Overall billing/payment lifecycle status."
|
||||||
properties:
|
|
||||||
subscription:
|
|
||||||
$ref: "#/components/schemas/BillingSubscription"
|
|
||||||
balance:
|
|
||||||
$ref: "#/components/schemas/BillingBalance"
|
|
||||||
has_payment_method:
|
|
||||||
type: boolean
|
|
||||||
enum:
|
enum:
|
||||||
- awaiting_payment_method
|
- awaiting_payment_method
|
||||||
- pending_payment
|
- pending_payment
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
comfyui-frontend-package==1.43.18
|
comfyui-frontend-package==1.44.19
|
||||||
comfyui-workflow-templates==0.9.82
|
comfyui-workflow-templates==0.9.82
|
||||||
comfyui-embedded-docs==0.5.0
|
comfyui-embedded-docs==0.5.0
|
||||||
torch
|
torch
|
||||||
@ -23,7 +23,7 @@ SQLAlchemy>=2.0.0
|
|||||||
filelock
|
filelock
|
||||||
av>=14.2.0
|
av>=14.2.0
|
||||||
comfy-kitchen>=0.2.8
|
comfy-kitchen>=0.2.8
|
||||||
comfy-aimdo==0.4.3
|
comfy-aimdo==0.4.5
|
||||||
requests
|
requests
|
||||||
simpleeval>=1.0.0
|
simpleeval>=1.0.0
|
||||||
blake3
|
blake3
|
||||||
|
|||||||
Reference in New Issue
Block a user