Files
facok-ComfyUI-LCS/__init__.py
T
facok cf9edf0239 Add sharpness intervention via PCA subspace in FLUX VAE patch space
New calibration (core/sharpness.py) generates blur stimuli, VAE-encodes,
and extracts PC1 as the sharpness direction. New nodes (nodes/sharpen.py)
provide LCSSharpnessCalibrate (auto-cached per-VAE) and
LCSSharpnessIntervene (post-CFG hook with strength, step window, mask).
Positive strength = sharper, negative = blurrier.
2026-03-20 13:01:23 +08:00

48 lines
1.3 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 LCSLoadData
from .nodes.intervene import LCSColorIntervene, LCSColorBatch, LCSToneAdjust
from .nodes.observe import LCSPreviewColors, LCSStepObserver
from .nodes.sharpen import LCSSharpnessCalibrate, LCSSharpnessIntervene
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 [
LCSLoadData,
LCSColorIntervene,
LCSColorBatch,
LCSToneAdjust,
LCSPreviewColors,
LCSStepObserver,
LCSSharpnessCalibrate,
LCSSharpnessIntervene,
]
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
WEB_DIRECTORY = "./web"
__all__ = [
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS",
"WEB_DIRECTORY",
"LCSExtension",
"comfy_entrypoint",
]