Nodes/ComfyUI_Fill-Nodes/FL Region PNG Overlay
ComfyUI Node

FL Region PNG Overlay

Randomly place PNGs inside regions you draw on the node

By filliptm·Created 3 years ago·Updated 2 days ago· 632
FL Region PNG Overlay
  • image
  • image
seed0
rotation_min-5.0
rotation_max5.0
vignette_enabledtrue
vignette_diameter0.85
vignette_skew0.35
vignette_opacity0.45
vignette_offset_x0
vignette_offset_y0
vignette_rotation_offset0.0
regions_json[]
show_canvastrue

Most overlay nodes want one fixed position for your logo or watermark. FL_RegionPNGOverlay, part of the sprawling Fill-Nodes pack (filliptm / Machinedelusions on Patreon), takes the opposite approach: you define one or more rectangular regions on the image, and it picks a PNG at random from each region's own folder and drops it in, jittered with a bit of rotation and an optional vignette so the composite doesn't look pasted-on. It's the node you want for repeatable-but-varied placement - think batch product shots where a logo needs to land in roughly the same corner every time but shouldn't look identical frame to frame, or synthetic data where you need a marker to appear in a plausible spot with some natural randomness.

How it works

The node has an on-node canvas widget: it shows your image and lets you draw and edit regions directly - each one is an X/Y position plus a width and height. Those regions are stored as regions_json, and each region points at a folder of candidate PNGs; at render time the node seeds a random pick per region, rotates it somewhere between rotation_min and rotation_max, and composites it. If vignette_enabled is on, it also darkens/feathers around the placement so the overlay blends rather than sitting as a flat sticker.

The inputs and outputs that matter

  • image - the base image the overlays get placed on.
  • regions_json (default "[]") - the region definitions; normally you edit this through the on-node canvas rather than hand-typing JSON, but it's exposed as a plain string so you can save/reuse a region layout across runs.
  • show_canvas (default true) - toggles the interactive region editor on the node itself.
  • seed - controls which PNG gets picked per region and the rotation jitter; same seed, same picks.
  • rotation_min/rotation_max (default −5° / 5°) - how much random rotation each placed PNG gets, for that "not perfectly pasted" look.
  • The vignette_* cluster (vignette_enabled, vignette_diameter, vignette_skew, vignette_opacity, vignette_offset_x/_y, vignette_rotation_offset) shapes an elliptical darkening/feathering effect around the placement area - vignette_diameter and vignette_skew control its size and how oval-vs-round it is, vignette_opacity how strong the darkening reads.

Output is a single image with all region overlays composited in.

How to install it

ComfyUI Manager: search "Fill-Nodes", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt

then restart. Nothing exotic dependency-wise here - it's PIL-level compositing - but remember to actually populate the folders your regions point at with PNGs before running; an empty region folder has nothing to randomly pick from.

Common issues & troubleshooting

A region shows nothing. Check that its folder actually contains PNG files - this node picks from what's on disk, it doesn't generate placeholder content.

Overlay looks flat/pasted despite the vignette settings. Push vignette_opacity up and vignette_diameter down slightly so the darkening is more concentrated around the overlay's edges rather than washing over the whole region.

Same layout, different result every time you expect it not to. Confirm seed is actually fixed rather than left on a random-per-run value upstream - with a static seed, the same regions and the same folder contents will reproduce the same picks and rotation every run.

Category🏵️Fill Nodes/Image

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
seedINT00–2147483647
rotation_minFLOAT-5.0-180–180
rotation_maxFLOAT5.0-180–180
vignette_enabledBOOLEANtrue
vignette_diameterFLOAT0.850.05–3
vignette_skewFLOAT0.350.05–2
vignette_opacityFLOAT0.450–1
vignette_offset_xINT0-4096–4096
vignette_offset_yINT0-4096–4096
vignette_rotation_offsetFLOAT0.0-180–180
regions_jsonSTRING[]
show_canvasBOOLEANtrue

Outputs (1)

NameTypeDescription
imageIMAGE