The Recraft Controls node lets you define control parameters (like colors and background colors) to guide Recraft’s image generation process. This node combines multiple control inputs into a unified control object.

Parameters

Optional Parameters

ParameterTypeDescription
colorsRecraft ColorColor controls for image generation
background_colorRecraft ColorBackground color control

Output

OutputTypeDescription
recraft_controlsRecraft ControlsControl config object for Recraft generation nodes

Usage Example

Recraft Text to Image Workflow Example

Recraft Text to Image Workflow Example

How It Works

Node process:

  1. Collects input control parameters (colors and background_color)
  2. Combines these parameters into a structured control object
  3. Outputs this control object for connecting to Recraft generation nodes

When connected to Recraft generation nodes, these control parameters influence the AI generation process. The AI considers multiple factors beyond just the text prompt’s semantic content. If color inputs are configured, the AI will try to use these colors appropriately in the generated image.

Source Code

[Node source code (Updated on 2025-05-03)]

class RecraftControlsNode:
    """
    Create Recraft Controls for customizing Recraft generation.
    """

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

    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {
            },
            "optional": {
                "colors": (RecraftIO.COLOR,),
                "background_color": (RecraftIO.COLOR,),
            }
        }

    def create_controls(self, colors: RecraftColorChain=None, background_color: RecraftColorChain=None):
        return (RecraftControls(colors=colors, background_color=background_color), )