Nodes/ComfyUI-Simple_QR_Codes/πŸ›°οΈ QRCodes (Simple Logo)
ComfyUI Node

πŸ›°οΈ QRCodes (Simple Logo)

Stick a logo in the middle of a QR code β€” and why you need H error correction

By zentrocdotΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 2
πŸ›°οΈ QRCodes (Simple Logo)
  • image
  • IMAGE
  • MASK
  • INVERTED_MASK
β—„textβ–Ί
β—„width512β–Ί
β—„height512β–Ί
β—„fg_color(0, 0, 0)β–Ί
β—„bg_color(255, 255, 255)β–Ί
β—„error_correctβ–Ύβ–Ί
β—„versionβ–Ύβ–Ί
β—„box_size25β–Ί
β—„border4β–Ί
β—„width_height_logo64β–Ί
β—„mask_colorβ–Ύβ–Ί

The "branded QR" node

QRCodes (Simple Logo) does one thing: takes your QR code, pastes a logo dead-center, and hands back a QR that actually looks like your brand instead of a stock barcode. It's the third node in the pack's qrcode-based family, and it's the one you reach for when the QR isn't going into a ControlNet art workflow but straight onto a poster, business card, or product label.

The mechanism is exactly what it sounds like. The node builds the QR with Python's qrcode library, resizes your logo to width_height_logo pixels (keeping aspect ratio), and pastes it in the middle of the code. No fancy blending, no alpha compositing - a straight paste. If you don't wire an image in at all, it draws a solid square in your fg_color as a placeholder, so the layout still works before you've picked art.

Why the defaults are a trap

The center of a QR code is where the data is most redundant - that's why logos work there at all - but it's also where error correction earns its keep. This node's error_correct dropdown defaults to ERROR_CORRECT_L, the weakest level (7% recovery). That's exactly backwards for a logo: you're about to destroy the densest part of the code, and L gives you the least safety net. Set error_correct to ERROR_CORRECT_H (30% recovery) before you add a logo. It's the single most important setting on this node, and the default will happily let you produce an unscannable QR.

The other trap is version, default 1 - the smallest QR. Add a logo, pick H error correction, and a version-1 code won't fit a URL at all; you'll get a DataOverflowError. For "logo + URL," expect to be up around version 3–5. General guidance that holds: keep the logo under ~15% of the QR's width, use H, and test the result with the pack's QRCodeReader node before you print it.

Inputs and outputs, quickly

  • text - payload. width / height - final canvas.
  • fg_color / bg_color - tuple-style strings like "(0, 0, 0)", not hex, not CSS names.
  • box_size - module size pre-resize; this one defaults to 25, higher than its siblings, so the base is fairly crisp before the stretch.
  • width_height_logo - logo size in pixels (default 64).
  • mask_color - a red/green/blue enum, and this time the name is honest: it picks which channel the masks are derived from.
  • Optional image - your logo. Outputs: IMAGE, MASK, INVERTED_MASK (QR pattern vs. background, useful for compositing the logo'd code over other graphics).

Common issues

  • Won't scan β†’ error correction too low, or logo too big. H + smaller logo.
  • "Data does not fit" β†’ version too low for the text; raise it.
  • Logo looks stretched β†’ the node preserves aspect on the short side, so very wide or tall logos get letterboxed oddly. Use a roughly square logo.

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

No model downloads - it's all CPU-side PIL and qrcode (pinned to 8.0). Right-click in ComfyUI and you'll find it under QR Code Nodes β†’ qrcode-based.

Category🍭 QR Code Nodes/🚜 qrcode-based

Inputs (12)

NameTypeDefaultDescription
textSTRINGβ€”
widthINT5121–8192β€”
heightINT5121–8192β€”
fg_colorSTRING(0, 0, 0)β€”
bg_colorSTRING(255, 255, 255)β€”
error_correctCOMBO4 options: ERROR_CORRECT_L, ERROR_CORRECT_M, ERROR_CORRECT_Q, ERROR_CORRECT_H
versionCOMBO40 options: 1, 2, 3, 4, 5, 6, +34
box_sizeINT250–8192β€”
borderINT40–8192β€”
width_height_logoINT640–8192β€”
mask_colorCOMBO3 options: red, green, blue
imageoptIMAGEβ€”

Outputs (3)

NameTypeDescription
IMAGEIMAGEβ€”
MASKMASKβ€”
INVERTED_MASKMASKβ€”