Skip to main content
ComfyUI Native Recraft Color RGB Node The Recraft Color RGB node lets you define precise RGB color values to control colors in Recraft image generation.

Node Function

This node creates a color configuration object that connects to the Recraft Controls node to specify colors used in generated images.

Parameters

Basic Parameters

ParameterTypeDefaultDescription
rinteger0Red channel (0-255)
ginteger0Green channel (0-255)
binteger0Blue channel (0-255)

Output

OutputTypeDescription
recraft_colorRecraft ColorColor config object to connect to Recraft Controls

Usage Example

Recraft Text to Image Workflow Example

Recraft Text to Image Workflow Example

Source Code

[Node source code (Updated on 2025-05-03)]
class RecraftColorRGBNode:
    """
    Create Recraft Color by choosing specific RGB values.
    """

    RETURN_TYPES = (RecraftIO.COLOR,)
    DESCRIPTION = cleandoc(__doc__ or "")  # Handle potential None value
    RETURN_NAMES = ("recraft_color",)
    FUNCTION = "create_color"
    CATEGORY = "api node/image/Recraft"

    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {
                "r": (IO.INT, {
                    "default": 0,
                    "min": 0,
                    "max": 255,
                    "tooltip": "Red value of color."
                }),
                "g": (IO.INT, {
                    "default": 0,
                    "min": 0,
                    "max": 255,
                    "tooltip": "Green value of color."
                }),
                "b": (IO.INT, {
                    "default": 0,
                    "min": 0,
                    "max": 255,
                    "tooltip": "Blue value of color."
                }),
            },
            "optional": {
                "recraft_color": (RecraftIO.COLOR,),
            }
        }

    def create_color(self, r: int, g: int, b: int, recraft_color: RecraftColorChain=None):
        recraft_color = recraft_color.clone() if recraft_color else RecraftColorChain()
        recraft_color.add(RecraftColor(r, g, b))
        return (recraft_color, )

I