Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
The ColorTransfer node adjusts the color palette of a target image to match the colors of a reference image. It uses different mathematical algorithms to analyze and transfer the color characteristics, such as brightness, contrast, and hue distribution, from the reference to the target. This is useful for creating visual consistency across multiple images or applying a specific color grade.

Inputs

ParameterData TypeRequiredRangeDescription
image_targetIMAGEYes-Image(s) to apply the color transform to.
image_refIMAGEYes-Reference image(s) to match colors to.
methodCOMBOYes"reinhard_lab"
"mkl_lab"
"histogram"
The color transfer algorithm to use.
source_statsDYNAMICCOMBOYes"per_frame"
"uniform"
"target_frame"
Determines how color statistics are calculated from the source (target) image(s).
strengthFLOATYes0.0 to 10.0The intensity of the color transfer effect. A value of 1.0 applies the full transform, while 0.0 returns the original image. Default: 1.0
Parameter Details:
  • source_stats Options:
    • per_frame: Each frame in a batch is matched to the image_ref individually.
    • uniform: Color statistics are pooled across all source frames to create a single baseline, which is then matched to the image_ref.
    • target_frame: Uses one chosen frame from the target batch as the baseline for computing the transform to the image_ref. This transform is then applied uniformly to all frames, which preserves the relative color differences between them. When this option is selected, an additional target_index parameter becomes available.
  • target_index (appears when source_stats is "target_frame"): The frame index (starting from 0) used as the source baseline for computing the transform. Default: 0. Must be between 0 and 10000.
Constraints:
  • If strength is set to 0.0 or image_ref is None, the node returns the original image_target without processing.
  • When source_stats is set to "target_frame", the target_index must be a valid index within the batch of image_target. If it exceeds the number of frames, the last frame is used.
  • For the histogram method with source_stats set to "per_frame", if the batch size of image_ref is greater than 1, each target frame is matched to the corresponding reference frame by index. If the reference batch has only one frame, it is used for all target frames.

Outputs

Output NameData TypeDescription
imageIMAGEThe resulting image(s) after the color transfer has been applied.

Source fingerprint (SHA-256): f844af34ac6129c7751953c48e2d12aa0d2c556937e610f649f3eb2725955711