Paint by Numbers: overlay Numbers (Advanced)
When plain number-stamping isn't enough
- input_image
- numbers_image
- mask_image
- overlaid_image
- numbers_mask
The plain overlay Numbers node handles the easy case: white lineart, black numbers, done. overlay Numbers (Advanced) is the same compositing idea with the training wheels off - for when the numbers vanish into a busy background, you only want digits in part of the image, or you're overlaying onto a colored base and the black-on-white digits look wrong.
Use the basic node if your workflow is simple. Reach for this one when you catch yourself reaching for a photo editor to fix the overlay.
What it adds
Under the hood it's the same machinery - auto-scale the numbers sheet, build a mask from non-white pixels (any channel below white_threshold), composite. But it layers on five extras the basic node doesn't have:
- mask_image (MASK) - restrict stamping to a region. Wire in a mask and numbers only land where the mask is white. Good for keeping numbers off faces, skies, or whatever you don't want marked.
- blend_mode - six modes now:
replace,multiply,overlay,soft_light,screen,color_burn. The last two matter:screenmakes dark digits lighten instead of darkening, which is useful on dark backgrounds. - numbers_color - a hex string ("auto" by default). Give it a value like
#FFFFFFand the digits get recolored before compositing. This is the fix when black numbers disappear into a dark region. - outline_width and outline_color - stamp an outline around the numbers. Outline the digit shapes with white and they pop off any background. Width 0 = off.
- numbers_mask output - the mask of exactly where numbers landed, as a real ComfyUI MASK. You can feed this back into other nodes instead of hand-drawing the region.
It also widens white_threshold to the full 0–255 range (the basic node starts at 200), which matters if your numbers sheet has a grayish or off-white background.
The inputs that matter
Only three are required: input_image, numbers_image, and transparency - everything else is optional, which is the polite way of saying "defaults are fine until they're not."
The two you'll actually touch:
- numbers_color - set a hex and your digits change color. The single best knob for legibility.
- outline_width / outline_color - an outline around each digit. Start with width 1–2 and white; black works if you recolor the numbers light.
Then, if numbers are landing where you don't want them, mask_image restricts the paste zone. And if the whole overlay feels heavy, transparency dials it back.
The outputs
- overlaid_image - the finished sheet, same as the basic node.
- numbers_mask - the MASK of the composited numbers. Unlike the basic node, you get to reuse the selection rather than reconstruct it.
Installing
With the rest of the pack - ComfyUI Manager, search "Painting-by-colors-generator", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Chrisvenator/ComfyUI-Painting-by-colors-generator
then restart. No models, no extra downloads; it runs on the same numpy/Pillow/OpenCV stack every ComfyUI install already carries. As with the whole pack, don't trust the README's placeholder clone URL - use the repo above.
One honest note: this is a utility node with zero community signal - no reviews, no impressions, nothing. But the features are straightforward and the source is small and readable, so what you see in the schema is what you get. If the advanced options look like things you'd fiddle with, this is the node to reach for; if not, the basic overlay is half the nodes and does the same job.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| input_image | IMAGE | — | |
| numbers_image | IMAGE | — | |
| transparency | FLOAT | 1.000–1 | — |
| mask_imageopt | MASK | — | |
| white_thresholdopt | INT | 2400–255 | — |
| blend_modeopt | COMBO | replace | 6 options: replace, multiply, overlay, soft_light, screen, color_burn |
| auto_scaleopt | BOOLEAN | true | — |
| scaling_methodopt | COMBO | lanczos | 4 options: lanczos, bicubic, bilinear, nearest |
| numbers_coloropt | STRING | auto | — |
| outline_widthopt | INT | 00–10 | — |
| outline_coloropt | STRING | #FFFFFF | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| overlaid_image | IMAGE | — |
| numbers_mask | MASK | — |