ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
ColorMatch
ColorMatch Node Documentation
Overview
The ColorMatch node is a part of the KJNodes extension for ComfyUI, designed to transfer colors from a reference image to a target image. This node is particularly useful for tasks such as automatic color grading of photographs, enhancing aesthetic coherence in artwork, or performing light-field and stop-motion corrections.
Functionality
The node allows users to transfer the color characteristics of a reference image to a target image using various sophisticated methods. Each method has different underlying algorithms designed to achieve specific color matching effects.
Color Transfer Methods
- Monge-Kantorovich Linearization (MKL): Utilizes the approach proposed by Pitie et al. to achieve color transfer.
- Histogram Matching (HM): Matches the histogram of the target image to that of the reference image.
- Reinhard: Based on the approach from Reinhard et al., which aims to match statistical properties of colors between images.
- Multi-Variate Gaussian Distribution (MVGD): An analytical solution for color transfer using Gaussian properties.
- Compound Methods:
hm-mvgd-hm: A combination method utilizing both histogram matching and MVGD.hm-mkl-hm: A combination method using histogram matching and MKL.
Inputs
- Reference Image (
image_ref): The image from which color characteristics will be transferred. Must be provided in an IMAGE format. - Target Image (
image_target): The image to which color characteristics from the reference image will be applied. Must be provided in an IMAGE format. - Method (
method): The color transfer method to be used. Available options are:- MKL (
mkl) - HM (
hm) - Reinhard (
reinhard) - MVGD (
mvgd) - HM-MVGD-HM (
hm-mvgd-hm) - HM-MKL-HM (
hm-mkl-hm) Default method ismkl.
- MKL (
- Strength (
strength): An optional parameter to control the strength of the color transfer effect, allowing fine-tuning of the results. It is a float value with default 1.0 and ranges from 0.0 to 10.0.
Outputs
- Processed Image (
image): The target image with the color characteristics from the reference image applied. This is delivered in an IMAGE format.
Usage in ComfyUI Workflows
The ColorMatch node is typically integrated within workflows involving image grading, artistic style transfers, or any context where consistent color aesthetics are required. It helps:
- Match color tones in a series of photographs or frames in an animation to maintain visual consistency.
- Adjust the atmosphere of images by applying color grading consistent with a given style or time of day.
Example Workflow
- Step 1: Import reference and target images into your workflow.
- Step 2: Add and configure the
ColorMatchnode, selecting your desired method and adjusting strength as needed. - Step 3: Connect the
ColorMatchnode to further nodes for additional processing or output.
Special Features and Considerations
- Batch Processing: The node supports batch processing, allowing multiple images to be color-matched simultaneously if batch sizes match.
- Error Handling: The node includes safeguards to alert users when input conditions are not met, such as mismatched batch sizes.
- Installation Requirement: To use this node, ensure that the
color-matcherPython package is installed. This can typically be managed via the provided requirements.txt.
The ColorMatch node provides a robust way to manage color transfers, offering creative control over image aesthetics across a variety of use cases. Special consideration should be given to the choice of method based on the desired output and the characteristics of the input images.