Badge Studio Composite V1 (DAELab)
A product shot with no model, no seed and no bill
- badge_image
- foreground_mask
- studio_image
- shadow_mask
- report
What it is and why you'd reach for it
There are two ways to turn a finished badge into a deliverable image. One is to ask a model for a premium studio product photograph and hope it keeps your type intact. The other is to cut the badge out and put it on white with a soft shadow. This node is the second one, and for catalogue work it's usually the right answer - every pixel of the badge comes from your master, the background is a colour you specified, and running it twice gives identical output.
It's the deterministic counterpart to Badge Presentation Prompt Builder. Same intent, no generative stage, and consequently no drifting logo, no invented lighting and no per-run cost.
How it works
The composite is four deterministic steps. First, the foreground mask is shifted by shadow_offset_x / shadow_offset_y (default 0 and 6 - down, which is where a light from above puts a shadow) and blurred with a Gaussian whose kernel is 2 * shadow_blur_px + 1 and sigma is shadow_blur_px / 2. Second, that blurred silhouette is multiplied into the background at shadow_opacity - the default 0.1 is deliberately faint; a drop shadow that reads as a shadow rather than a gradient needs to be subtle.
Third, an inner edge light: the mask is eroded by one pixel via max-pooling, the difference gives a one-pixel rim inside the badge's outline, and that rim is added to the badge image at edge_light_strength (0.04 default). Small number, disproportionate effect - this is what stops a badge on white from looking like a flat PNG and starts it looking like a metal object catching a highlight.
Fourth, composite: inside the mask you get the lit badge, outside you get background-plus-shadow. report records the shadow parameters, generative_repaint: false, and the canvas size.
Two constraints that look odd until you understand the pack. enforce_1024 requires 1024×1024 by default, because every mask in this pipeline is 1024-native. And background_color will only accept #FFFFFF - the node compares it to white and raises Badge Studio Composite V1 background_color is fixed to #FFFFFF for anything else, despite the widget being a free text field. The workflow's 8.6 branch is documented as explicitly targeting a pure white seamless background, and this node enforces that rather than trusting the field. If you need cream, you need a different node.
Inputs and outputs that matter
badge_image and foreground_mask are the whole input, and the mask must be the topology that matches the current image - use patched_foreground_mask if a height patch cut anything out, not the original canvas mask. Then background_color (leave it), shadow_opacity, shadow_blur_px (10 is a soft contact shadow; 30+ becomes a floating-object effect), shadow_offset_x / shadow_offset_y, edge_light_strength.
Outputs: studio_image is the deliverable. shadow_mask is the blurred silhouette you generated, which is handy if you want to blend this over something else later. report is the JSON.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library
Restart ComfyUI. The Gaussian blur is OpenCV, which the pack's requirements.txt doesn't declare, so pip install opencv-python-headless if the node doesn't appear. It's a V3-schema node - No module named 'comfy_api' means your ComfyUI core is old, not that you need a pip package.
Common issues
background_color is fixed to #FFFFFF. Working as designed. This node exists for the pure-white catalogue branch.- The shadow is a visible grey blob with a hard edge.
shadow_blur_pxis fine, but your mask has hard geometry and the offset is large. Reduce the offset to 3–6px and keep opacity under 0.15. - A rectangular halo follows the badge. You're feeding a mask whose bbox doesn't hug the silhouette - often a colour-distance mask with a loose tolerance. Fix the mask; this node won't feather its way out of it.
- Everything is white. Foreground mask is empty or inverted. Check it against the canvas node's
design_foreground_mask.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| badge_image | IMAGE | — | |
| foreground_mask | MASK | — | |
| background_color | STRING | #FFFFFF | — |
| shadow_opacity | FLOAT | 0.100–1 | — |
| shadow_blur_px | INT | 100–100 | — |
| shadow_offset_x | INT | 0-100–100 | — |
| shadow_offset_y | INT | 6-100–100 | — |
| edge_light_strength | FLOAT | 0.040–1 | — |
| enforce_1024 | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| studio_image | IMAGE | — |
| shadow_mask | MASK | — |
| report | STRING | — |