Nodes/comfyui_cv/CV Create CCM Model
ComfyUI Node

CV Create CCM Model

Creates and fits a Color Correction Model from detected color patches. The fitted model can be applied to images with 'Apply Color Correction'.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Create CCM Model
  • color_patches
  • ccm_model
  • ccm_matrix
  • loss
ccm_typeCCM_LINEAR
color_spaceCOLOR_SPACE_SRGB
distanceDISTANCE_CIE2000
linearizationLINEARIZATION_GAMMA
linearization_gamma2.2
linearization_degree3
color_checkerCOLORCHECKER_MACBETH
saturated_lower0.00
saturated_upper0.00
Categoryimage/CV/ccm

Inputs (10)

NameTypeDefaultDescription
color_patchesNPARRAYDetected patch colors from 'Detect Color Checker' [N,1,3] float64 in [0,1].
ccm_typeCOMBOCCM_LINEARCCM_LINEAR: 3x3 matrix (no offset). CCM_AFFINE: 4x3 matrix (with offset).
color_spaceCOMBOCOLOR_SPACE_SRGBWorking color space for the correction.
distanceCOMBODISTANCE_CIE2000Color distance metric used in optimization. CIE2000 is most perceptually accurate.
linearizationCOMBOLINEARIZATION_GAMMALinearization method before applying CCM. GAMMA is the standard choice.
linearization_gammaFLOAT2.20.1–5Gamma value for LINEARIZATION_GAMMA.
linearization_degreeINT31–10Polynomial degree for POLYFIT/LOGPOLYFIT methods.
color_checkerCOMBOCOLORCHECKER_MACBETHReference color checker type (must match chart).
saturated_lowerFLOAT0.000–1Lower saturation threshold for filtering patches.
saturated_upperFLOAT0.000–1Upper saturation threshold (0 = disabled).

Outputs (3)

NameTypeDescription
ccm_modelCCM_MODELFitted color correction model.
ccm_matrixNPARRAYThe computed 3x3 or 4x3 color correction matrix.
lossFLOATFit quality metric (lower is better).