Implements "The Latent Color Subspace" (arXiv:2603.12261v1, ICML 2026) as a ComfyUI plugin with V3 API + V2 backward compatibility. 6 nodes across 3 categories: - LCS/calibration: LCSCalibrate (PCA from VAE), LCSLoadData (cache load) - LCS/intervention: LCSColorIntervene (single color), LCSColorBatch (multi) - LCS/observe: LCSPreviewColors (latent color map), LCSStepObserver Core modules: patchify (16ch->64d patches), bicone HSL<->LCS mapping, alpha_t/beta_t tables (51 entries from Appendix F), PCA calibration, and timestep normalization with residual preservation.
38 lines
1002 B
Python
38 lines
1002 B
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
|
|
from .nodes.observe import LCSPreviewColors, LCSStepObserver
|
|
|
|
|
|
class LCSExtension(ComfyExtension):
|
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
|
return [
|
|
LCSCalibrate,
|
|
LCSLoadData,
|
|
LCSColorIntervene,
|
|
LCSColorBatch,
|
|
LCSPreviewColors,
|
|
LCSStepObserver,
|
|
]
|
|
|
|
|
|
async def comfy_entrypoint() -> LCSExtension:
|
|
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",
|
|
]
|