LayerUtility: ColorImage V2
ColorImage V2 — generate a solid-color image at any size
- size_as
- image
You'd be surprised how often a workflow needs a plain rectangle of one color - a background to composite onto, a solid matte, a fill behind a transparent subject, a base for a mask. ColorImage V2 makes exactly that: pick a size, pick a color, out comes a flat image. The "V2" trick that earns its keep is that it can match the size of another image you already have, so you don't retype dimensions every time.
How it works
It generates a new image filled entirely with one color at whatever dimensions you specify. Simple as that. The V2 addition is the size_as input: connect any image (or other sized thing) and the node reads its width and height and produces the color fill at that exact size, ignoring the manual size fields. That's the difference between "a 512×512 gray square" and "a gray square the same size as this render, whatever that is."
The inputs and output that matter
size- a preset resolution (1024 x 1024,1280 x 720,1344 x 768, and the usual SDXL-friendly buckets) orcustomto use the width/height fields below.custom_width/custom_height- the dimensions whensizeiscustom.color- the fill color as a hex string (default#000000). Pair it with the pack'sColorPickernode if you'd rather choose visually than type hex.size_as(optional, any type) - connect an image here and its dimensions override everything; the color fill comes out matching that image's size.
Output is a single image (IMAGE) - your solid color, ready to composite, mask against, or use as a background.
The size_as input is the reason to prefer V2. A common job is compositing a background-removed subject onto a flat color - you cut the subject out with RmBgUltra V2, then need a color plate at the exact size of the original to blend against. Feed that original into size_as and you get a perfectly-matched fill with zero manual measuring, then hand both to ImageBlendAdvance. Other everyday uses: a neutral canvas to outpaint from, a solid base to build a mask on, or a plain backdrop for product mockups.
How to install it
ComfyUI Manager: search ComfyUI Layer Style, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
install requirements.txt, restart. It's under 😺dzNodes → LayerUtility.
Common issues
The one that confuses people: when size_as is connected, it wins - the size dropdown and the custom width/height fields are ignored. So if you set custom to 512×512 but keep getting a 1024×1024 fill, unplug size_as (or accept that it's matching the connected image). The other thing is the color format: it wants a hex string like #3A7BD5. If a downstream compositor is showing the wrong color, check the hex is well-formed. Beyond that there's nothing to it - no model, no dependencies, just a reliable color-plate generator you'll wire into more workflows than you'd expect.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| size | COMBO | 10 options: custom, 1024 x 1024, 768 x 512, 512 x 768, 1280 x 720, 720 x 1280, +4 | |
| custom_width | INT | 5124–99999 | — |
| custom_height | INT | 5124–99999 | — |
| color | STRING | #000000 | — |
| size_asopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |