ComfyUI Node: Colorspace

Class Name

ColorspaceNode

Category
COCO Tools/Processing
Author
Conor-Collins (Account age: 522days)
Extension
ComfyUI-CoCoTools_IO
Latest Updated
2025-05-30
Github Stars
0.04K

How to Install ComfyUI-CoCoTools_IO

Install this extension via the ComfyUI Manager by searching for ComfyUI-CoCoTools_IO
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CoCoTools_IO in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Colorspace Description

Facilitates conversion between various color spaces for accurate image display across devices, supporting ACES, sRGB, Rec.709, Display P3, Rec.2020, Adobe RGB, and more, with user-friendly mapping and handling of linear/non-linear spaces, gamma encoding/decoding, and color value clipping for HDR content.

Colorspace:

The ColorspaceNode is designed to facilitate the conversion between different color spaces, which is crucial for ensuring that images are displayed correctly across various devices and platforms. This node supports a wide range of color spaces, including ACES, sRGB, Rec.709, Display P3, Rec.2020, and Adobe RGB, among others. By mapping user-friendly color space names to their technical equivalents, the node simplifies the process of color space conversion, making it accessible even to those without a deep technical background. The node handles both linear and non-linear color spaces, providing automatic gamma encoding and decoding where necessary. It also manages the clipping of color values to ensure that images are displayed within the appropriate range, particularly when dealing with high dynamic range (HDR) content. This functionality is essential for AI artists who need to maintain color accuracy and consistency in their digital artworks.

Colorspace Input Parameters:

from_colorspace

The from_colorspace parameter specifies the color space of the input image. It determines how the node interprets the color data of the image before conversion. This parameter is crucial because it ensures that the image is correctly decoded if it is in an encoded color space. The available options include "ACES2065-1", "ACEScg", "ACEScct", "ACEScc", "sRGB", "sRGB Linear", "Rec.709", "Rec.709 Linear", "Display P3", "Display P3 Linear", "Rec.2020", "Rec.2020 Linear", "Adobe RGB", "Adobe RGB Linear", and "Raw". The choice of color space affects the initial processing of the image, particularly in terms of gamma correction and color value interpretation.

to_colorspace

The to_colorspace parameter defines the target color space to which the input image will be converted. This parameter is essential for ensuring that the output image is compatible with the intended display or processing environment. Similar to the from_colorspace parameter, it offers a range of options, including "ACES2065-1", "ACEScg", "ACEScct", "ACEScc", "sRGB", "sRGB Linear", "Rec.709", "Rec.709 Linear", "Display P3", "Display P3 Linear", "Rec.2020", "Rec.2020 Linear", "Adobe RGB", "Adobe RGB Linear", and "Raw". The selection of the target color space influences the final appearance of the image, as it dictates the gamma encoding and any necessary clipping of color values.

Colorspace Output Parameters:

result_tensor

The result_tensor is the primary output of the ColorspaceNode, representing the image data after conversion to the specified target color space. This output is crucial for ensuring that the image is correctly displayed or processed in subsequent stages of a workflow. The result_tensor is a torch tensor that contains the color-corrected image data, with values adjusted according to the gamma encoding and clipping rules of the target color space. This output ensures that the image maintains its intended appearance across different devices and platforms.

Colorspace Usage Tips:

  • Always ensure that the from_colorspace and to_colorspace parameters are correctly set to match the source and target environments of your image. This will prevent color inaccuracies and ensure consistent display across devices.
  • When working with HDR content, choose a color space that supports a wide dynamic range, such as "ACES" or "Raw", to avoid unnecessary clipping of color values.
  • If you are unsure about the color space of your input image, consider using "Raw" as the from_colorspace to bypass any conversion and maintain the original color data.

Colorspace Common Errors and Solutions:

Unsupported colorspaces: <from_colorspace> -> <to_colorspace>

  • Explanation: This error occurs when the specified from_colorspace or to_colorspace is not recognized or supported by the node.
  • Solution: Verify that both the from_colorspace and to_colorspace parameters are set to valid options listed in the node's documentation. Ensure there are no typos or unsupported color space names.

Raw colorspace detected, returning input unchanged

  • Explanation: This message indicates that either the from_colorspace or to_colorspace is set to "Raw", meaning no conversion will be applied to the image.
  • Solution: If conversion is desired, change the from_colorspace or to_colorspace to a specific color space other than "Raw". If no conversion is needed, this message can be safely ignored.

Colorspace Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools_IO
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.