Nodes/ComfyUI-Simple_QR_Codes/🚒 CreateSolidFrame
ComfyUI Node

🚒 CreateSolidFrame

Give your QR code a poster border in one node

By zentrocdotΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 2
🚒 CreateSolidFrame
  • image
  • IMAGE
β—„fg_color(255, 255, 255)β–Ί
β—„bg_color(0, 0, 0)β–Ί
β—„thickness4β–Ί
β—„frame_size40β–Ί

The one that makes a QR look like a finished card

CreateSolidFrame is the most straight-ahead of the pack's three frame nodes: it takes any image - most likely one of this pack's QR codes - and wraps it in a solid border, like putting a card in a matte. That's genuinely useful if your QR is headed to a poster, a business card, or a sticker, where a raw barcode floating on white looks unfinished and a border makes it read as a deliberate piece of design. It's the visual equivalent of the quiet zone: a little breathing room makes everything look intentional.

How it works

The node grows the canvas by frame_size pixels on every side and fills that new margin with bg_color. Then it draws a fg_color rectangle of thickness pixels around the outer edge of the canvas. So you get two decisions out of four inputs: frame_size controls how much colored margin surrounds the image, thickness controls how heavy the outer frame line is, and fg_color / bg_color pick the two colors. Colors are tuple-style strings - "(0, 0, 0)" style, not hex or CSS names.

A quick mechanism note that affects your results: the border is drawn with OpenCV rectangles on a numpy canvas, then your image is pasted in with PIL. Nothing fancy, nothing lossy - but because the frame is built at final canvas size, the thicker you go, the more the image itself shrinks relative to the whole card. For a QR, keep frame_size modest relative to width/height or the code gets small enough that scanners notice.

The single IMAGE output is just the framed image. There's no mask output on the frame nodes - they're decoration, not conditioning tools. Wire the output into a preview or Save Image and you're done.

The QR-specific advice

This is a framing node that happens to live in a QR pack, so treat the frame as extra quiet-zone budget: a white or light bg_color with a dark fg_color line reads best and keeps scanners happy. If you framed a colored or logo'd QR, do a quick sanity scan with the pack's QRCodeReader - the frame itself doesn't hurt scannability, but a busy background behind the code can.

Common issues

  • Frame looks like it's missing β†’ if fg_color equals bg_color, the outer line is invisible by design; give them contrast.
  • Colors come out gray β†’ the node fell back to its default gray because your color string wasn't in "(r, g, b)" format. Watch the parentheses and commas.

Installing it

Part of ComfyUI-Simple_QR_Codes: ComfyUI Manager β†’ search "Simple QR Codes" β†’ install β†’ restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/zentrocdot/ComfyUI-Simple_QR_Codes
cd ComfyUI-Simple_QR_Codes
pip install -r requirements.txt

The frame nodes are why the pack requires opencv-python. No models to download. It shows up under QR Code Nodes β†’ frames.

Category🍭 QR Code Nodes/🎨 frames

Inputs (5)

NameTypeDefaultDescription
imageIMAGEβ€”
fg_colorSTRING(255, 255, 255)β€”
bg_colorSTRING(0, 0, 0)β€”
thicknessINT41–8192β€”
frame_sizeINT402–8192β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”