9 Commits
Author SHA1 Message Date
facok 25e7d953d5 Register sys.modules alias so other plugins can import ComfyUI_LCS
ComfyUI loads custom_nodes by directory name (ComfyUI-LCS) but Python
cannot import module names with hyphens. Register ComfyUI_LCS as a
sys.modules alias so SubspaceLab and other plugins can use
`from ComfyUI_LCS.core.xxx import ...` regardless of load order.
2026-03-23 03:01:19 +08:00
facok 8656e48f9f Add LCSColorAnchor to V3 and V2 node registrations
The anchor node was implemented but missing from __init__.py registrations.
Also removes probe node references (exposure, spatial variance, chroma AC)
which have been moved to ComfyUI-SubspaceLab.
2026-03-23 02:07:19 +08:00
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
facok 48d5f7efb6 Merge LCSCalibrate into LCSLoadData with per-VAE auto-caching
Replace two calibration nodes with a single smart LCSLoadData that
fingerprints VAE weights (sha256 of first decoder weight) and
auto-manages cached calibration files as data/lcs_{fingerprint}.safetensors.
2026-03-17 06:27:55 +08:00
facok 78be03db46 Add frontend preset sync for LCSToneAdjust sliders
Selecting a preset now updates slider values in real-time via a
frontend JS extension, and users can tweak values after selecting.
Sliders are always visible (removed optional=True). Preset values
live only in JS (single source of truth); Python keeps just the
name list for the combo widget. Sync only fires on explicit user
dropdown interaction, preserving saved slider tweaks on workflow load.
2026-03-17 04:47:57 +08:00
facok 56699625e0 Rename LCSContrastAdjust to LCSToneAdjust and add tone presets
The node now controls contrast, brightness, saturation, and color
temperature — "Contrast Adjust" was misleading. Adds 9 one-click
tonal presets (Cinematic, HDR, Vivid, Dramatic, Low Key, High Key,
Warm, Cool, Desaturated) plus Custom mode for manual slider control.
2026-03-17 03:43:10 +08:00
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
facok 0973fd0fd8 Add docstrings to all public functions, classes, and methods
Coverage: 29% → 100% (41/41 public items documented).
Keeps the existing concise style with inline shape annotations.
2026-03-17 02:26:21 +08:00
facok 534bc19033 Implement LCS plugin for training-free color control in FLUX
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.
2026-03-17 01:43:26 +08:00