Nodes/RES4LYF/Image Get Color Swatches
ComfyUI Node Runs on cloud

Image Get Color Swatches

Turning a flat-color layout into ordered zones

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Image Get Color Swatches
  • image_color_swatches
  • color_swatches

RES4LYF's regional conditioning feature - unlimited prompt zones in a single image, over ten used at once in the pack author's own examples - needs a way to define where each zone lives. The README shows two approaches: draw masks freely, or use "more traditional rigid ones." This node is the rigid path. Its own description says it plainly: it reads color swatches, in the order they appear from top to bottom, out of an input image - built specifically for use with color masks.

The workflow it's meant for: instead of hand-painting a separate freeform mask for every zone in your composition, you sketch one small reference image where each region is filled with a distinct, flat, solid color - no gradients, no anti-aliasing - stacked top to bottom in whatever order matches your zone list. Feed that reference image in here, and it extracts each color as an ordered swatch, ready to pair with a per-zone conditioning list elsewhere in your regional-conditioning setup.

Inputs and output

  • image_color_swatches (IMAGE) - required. Your flat-color layout reference - small, deliberately simple, one solid color per zone.
  • Output: color_swatches (COLOR_SWATCHES) - the ordered list of colors read out of the image, top to bottom.

That ordering is the whole point of the node, and it's explicit in its own description - so the order your zones appear in your reference image needs to match the order you're expecting to feed prompts or masks to downstream.

Installing it

Part of the full RES4LYF pack:

  • ComfyUI Manager - search "RES4LYF," install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, then cd RES4LYF && pip install -r requirements.txt, restart.

No extra downloads needed for this node.

Common issues

Wrong number of swatches come out, or boundaries look wrong. This node depends on your reference image having genuinely flat, distinct color blocks. Any anti-aliasing on the edges between color regions, gradients, or near-duplicate colors will confuse the read - draw your layout with hard edges and clearly separated colors, ideally at low resolution where you can be precise about exactly which pixels are which color.

Zones map to the wrong prompts. Since ordering is top-to-bottom and nothing else, it's easy to lose track of which swatch corresponds to which zone once you're several nodes downstream. Keep a note of your reference image's layout (or keep the image itself visible in the workflow) rather than trying to hold the top-to-bottom order in your head.

Not sure what consumes COLOR_SWATCHES next. This node is the first step of a color-mask regional-conditioning chain - it doesn't do anything with the swatches itself, it just extracts them. If you're not sure what to plug the output into, look for a color-to-mask node elsewhere in RES4LYF's mask category rather than expecting this node alone to complete the setup.

CategoryRES4LYF/images

Inputs (1)

NameTypeDefaultDescription
image_color_swatchesIMAGE

Outputs (1)

NameTypeDescription
color_swatchesCOLOR_SWATCHES