Qr Code (mtb)
The plain code that feeds those AI-art QR codes
- IMAGE
The description undersells it a bit: "Basic QR Code generator." True, but worth naming why this exact combination of a QR generator and ComfyUI is popular: it's the standard first step for the "QR code art" technique - feeding a plain black-and-white QR code into a ControlNet model trained specifically to hide it inside a generated image, so the final picture scans as a working QR code while looking like a landscape, a portrait, whatever your prompt describes. This node doesn't do that part. It just generates the plain code. The art happens downstream, once you wire this into a QR-code ControlNet.
Inputs that matter
url(defaulthttps://www.github.com) - the data encoded into the code. Despite the name, this can be any text, not strictly a URL - that's just what the default demonstrates.width/height(both default 256) - the output image dimensions.box_size(default 10) - how many pixels wide each individual QR "module" (the small black/white squares that make up the code) renders as. This is a standard term from the Pythonqrcodelibrary this kind of node is typically built on.border(default 4) - the quiet-zone padding around the code, in modules. QR readers rely on this blank margin to detect where the code starts; shrinking it too far can hurt scannability.error_correct(L,M,Q, orH, defaultL) - the QR spec's standard error-correction levels.Lis the lowest redundancy and packs the most data per code;His the most redundant and most tolerant of the code being partially obscured or damaged. This one matters a lot if you're feeding the output into a ControlNet for the "hidden QR art" technique - the AI-generated image is effectively "damaging" the code by overlaying art on top of it, soHgives the ControlNet the most room to work with while the code still scans reliably.Lis fine if you just need a clean, undecorated code.invert(a toggle, default off) - flips black and white in the output.
Output is a single IMAGE - the generated code, ready to feed into a preview, a compositing step, or a ControlNet preprocessor pipeline.
Installing it
- ComfyUI Manager - search "MTB Nodes", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/melMass/comfy_mtb, restart. A manual clone needspip install -r requirements.txtrun inside thecomfy_mtbfolder first.
If you want the QR-art technique specifically, you'll also need a QR-code ControlNet model (a separate download, not something this node ships with) and the ControlNet nodes in your graph to apply it.
Common issues & troubleshooting
Final image doesn't scan after ControlNet runs. Raise error_correct to Q or H before you do anything else. L's low redundancy is the most likely reason a heavily-stylized generation stops scanning - there just isn't enough error-correction data left once the art has visually "damaged" much of the code.
Code looks cramped or a scanner won't lock onto it at all. Check border - too thin a quiet zone is a classic reason phone cameras fail to even recognize there's a QR code present, independent of anything ControlNet does later.
Output looks like a random block pattern, no obvious grid. box_size too small relative to width/height can make individual modules hard to distinguish, especially after any downstream resizing. Keep box_size proportionate to your target output size.
Some mtb nodes fail to load at startup. Standard for this pack - check the console for [comfy_mtb] STATUS and http://127.0.0.1:8188/mtb for what didn't load. QR generation needs the Python qrcode library specifically; if that's missing from your environment, this is a plausible node to end up on the "didn't load" list.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| url | STRING | https://www.github.com | — |
| width | INT | 2560–8096 | — |
| height | INT | 2560–8096 | — |
| error_correct | COMBO | L | 4 options: L, M, Q, H |
| box_size | INT | 100–8096 | — |
| border | INT | 40–8096 | — |
| invert | COMBO | false | 1 options: BOOLEAN |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |