Files
Bishoy SamaanandClaude Sonnet 4.6 1c160ff396 v1.3.2: ACES 1.2 always in dropdown, auto-downloads on first use
- ACES 1.2 is now a permanent entry in BUILTIN_CONFIGS (like ACES 1.3/2.0),
  no longer conditionally injected only if the file already exists
- load_config() auto-triggers download_aces12() on first use when the file
  is missing, then loads it — no manual path required
- Rename "Custom path (ACES 1.2 / other)" → "Custom path (other)" since
  ACES 1.2 now has its own dedicated entry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 15:37:46 +01:00

60 lines
2.2 KiB
Python

"""
ComfyUI-ACES-IO
OpenColorIO / ACES color-management nodes for ComfyUI.
Supported ACES versions (built-in, no download needed):
• ACES 2.0 — CG Config & Studio Config [OCIO 2.5] ← recommended
• ACES 1.3 — CG Config & Studio Config [OCIO 2.1 / 2.3 / 2.4]
• ACES 1.2 and any other config: supply a path to your .ocio / .ocioz file
via the "Custom path" preset in the Config Loader node.
Download ACES 1.2 config from:
https://github.com/colour-science/OpenColorIO-Configs
Nodes (mirroring Nuke's OCIO set):
ACES IO — Config Loader load / select an OCIO config
ACES IO — ColorSpace OCIOColorSpace (cs → cs conversion)
ACES IO — Display Transform OCIODisplay (full display pipeline)
ACES IO — Viewer Nuke Viewer (exposure + gamma + channel view)
ACES IO — Look Transform OCIOLookTransform
ACES IO — File LUT OCIOFileTransform
ACES IO — Log Convert OCIOLogConvert (log ↔ linear)
ACES IO — Config Info lists colorspaces / displays / views / looks
"""
import os
import importlib.util
import logging
_logger = logging.getLogger(__name__)
# Check for PyOpenColorIO before attempting to import nodes so that a missing
# OCIO installation shows a single, actionable message rather than a traceback.
if importlib.util.find_spec("PyOpenColorIO") is None:
_logger.error(
"\n"
"[ACES IO] PyOpenColorIO is not installed — nodes will not load.\n"
"Install it with one of:\n"
" pip install opencolorio>=2.3.0\n"
" conda install -c conda-forge opencolorio>=2.3.0\n"
"Then restart ComfyUI."
)
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
else:
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
# Serve web/js to the ComfyUI frontend
WEB_DIRECTORY = "web"
# Register REST API routes (colorspace / display / view pickers)
try:
from . import server_routes # noqa: F401
except Exception as _e:
import logging
logging.warning(f"[ACES IO] Could not load server routes: {_e}")
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]