Engine rewrite: - Remove fake Display P3 stage (sRGB->XYZ->P3 round-trip was a no-op hiding a plain saturation multiply) and redundant strength multipliers - Fix box blur: was a trailing window shifted diagonally with zero-padded borders; now centered with edge replication - Fix non-monotonic highlight soft-clip (banding above white) - White balance and tone mapping in linear light (luminance-preserving) - Smart HDR: Durand-style log-luminance base/detail local tone mapping - Color science in Oklab: hue-preserving vibrance, real skin-tone protection mask, subtle split-tone signature - Single two-scale detail stage (texture + clarity) with tanh halo suppression, replacing three overlapping sharpeners - Photon-weighted grain, natural-falloff vignette in linear light - 15 iPhone 17 Photographic Styles presets (moods + undertones + B&W) - Delete dead camera_profiles.py LUT engine: tetrahedral interpolation (industry standard) with chunked memory-safe application; document that the Apple Log LUT expects log input UI: rebuild for new params; sizing via getMinHeight/getMaxHeight + computeSize (no more guessed heights), remount safety net for workflow reload store clears, sanitize values restored by position from old saves Tests: 16-case suite covering blur centering, Oklab round-trip, styles, skin protection, tetrahedral exactness, node API Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
"""
|
|
ComfyUI-CameraForensicRealism
|
|
Camera Forensic Realism Engine — Custom Node for ComfyUI
|
|
|
|
Emulates the iPhone 17 ISP color pipeline so AI-generated images pick up
|
|
real camera color science instead of the flat "AI look".
|
|
|
|
Pipeline (v4):
|
|
1. White balance — linear light, luminance-preserving
|
|
2. Global tone — exposure, shadow lift, midtone contrast, filmic rolloff
|
|
3. Smart HDR — local tone mapping in log-luminance
|
|
4. Color science — Oklab vibrance, skin protection, iPhone split-tone
|
|
5. Detail — two-scale halo-suppressed luminance sharpening
|
|
6. Optics & sensor — linear-light vignette + photon-weighted grain
|
|
+ 14 iPhone 17 Photographic Styles presets
|
|
|
|
Also includes:
|
|
- LUT Loader: Load .cube 3D LUT files
|
|
- LUT Apply: Tetrahedral-interpolation LUT application with strength
|
|
"""
|
|
|
|
from .nodes import CameraForensicRealismEngine, LUTLoader, LUTApply
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"CameraForensicRealismEngine": CameraForensicRealismEngine,
|
|
"LUTLoader": LUTLoader,
|
|
"LUTApply": LUTApply,
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"CameraForensicRealismEngine": "📷 Camera Forensic Realism (iPhone 17)",
|
|
"LUTLoader": "🎨 LUT Loader",
|
|
"LUTApply": "🎨 LUT Apply",
|
|
}
|
|
|
|
WEB_DIRECTORY = "./js"
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|