Files
facok-ComfyUI-LCS/__init__.py
T
facok b4e8dbd3d7 Add LCSContrastAdjust node for contrast, brightness, and saturation control
Operates directly in 3D LCS space by decomposing patches into lightness
(projection onto black→white achromatic axis) and chroma (perpendicular
residual). No HSL round-trip needed, making it faster than the color
intervention path.
2026-03-17 02:49:40 +08:00

43 lines
1.2 KiB
Python

"""ComfyUI-LCS: The Latent Color Subspace — training-free color control for FLUX.
Paper: "The Latent Color Subspace" (arXiv:2603.12261v1, ICML 2026)
"""
# V3 ComfyExtension entry point
from comfy_api.latest import ComfyExtension, io
from .nodes.calibrate import LCSCalibrate, LCSLoadData
from .nodes.intervene import LCSColorIntervene, LCSColorBatch, LCSContrastAdjust
from .nodes.observe import LCSPreviewColors, LCSStepObserver
class LCSExtension(ComfyExtension):
"""V3 ComfyExtension providing all LCS nodes to ComfyUI."""
async def get_node_list(self) -> list[type[io.ComfyNode]]:
"""Return all LCS node classes."""
return [
LCSCalibrate,
LCSLoadData,
LCSColorIntervene,
LCSColorBatch,
LCSContrastAdjust,
LCSPreviewColors,
LCSStepObserver,
]
async def comfy_entrypoint() -> LCSExtension:
"""V3 async entry point called by ComfyUI on startup."""
return LCSExtension()
# V2 backward compatibility
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__all__ = [
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
"LCSExtension",
"comfy_entrypoint",
]