QR Code
The clean QR canvas that keeps your QR art scannable
- QR_CODE
- QR_VERSION
- IMAGE_SIZE
Generative QR art lives or dies by the input you feed the ControlNet. If the QR you start from is soft-edged, undersized, or badly proportioned, no amount of clever prompting rescues the scannability - the model just faithfully copies mush into the image. This node, the plain "QR Code" one, is the cleanest way to mint that input without leaving ComfyUI.
It's the workhorse of the ComfyQR pack. It renders a QR at native module size with zero resampling: every module (each little black square) comes out exactly module_size pixels wide, crisply. That matters more than it sounds. A brightness/pattern ControlNet conditions on the structure of the QR, and the cleaner the structure you hand it, the more room the diffusion pass has to decorate without destroying the pattern. This is the same recipe that made the QR Monster ControlNet famous back in the SD 1.5/SDXL days - the input side hasn't changed even though the models have.
Under the hood it's the battle-tested python qrcode library wrapped in a ComfyUI node. It picks the QR version from your text length and error correction level, then draws the image at module_size pixels per module. No interpolation, no blur. The inputs a beginner actually sets:
module_size- pixel width of one module, default 16. This is your canvas-resolution dial.max_image_size- a guardrail. If text + module_size + error_correction would produce something bigger, the node raises an error and halts the pipeline instead of silently downscaling. That's deliberate: better to fail loud than feed a resampled QR into your ControlNet. Bump it when your URL is long.error_correction- defaults to High, and for art that's the right call. Diffusion corrupts part of the pattern no matter what, so the 30% slack High gives you is your insurance policy. Drop to Low only if you need a denser, smaller code.protocol- set this to Https and type just the path, not the whole URL. It's a documented workaround: the textbox clips the "//" character combo, which quietly mangles addresses.
There's also fill_hexcolor/back_hexcolor (3 or 6 hex digits, # optional), border in module widths, and module_drawer - square by default, plus gapped square, circle, rounded, and vertical/horizontal bars. The stylized drawers are fun to experiment with, though the README warns they register small RMSE deviations if you later run them through the mask-errors node.
Outputs are QR_CODE (the image), QR_VERSION (the QR version your text needed), and IMAGE_SIZE (final pixel width). QR_VERSION is mostly trivia; IMAGE_SIZE is genuinely useful for wiring the exact canvas size into downstream nodes.
Install is the pack-wide one: ComfyUI Manager → search "ComfyQR", or
cd ComfyUI/custom_nodes
git clone https://github.com/coreyryanhanson/ComfyQR
then restart ComfyUI. Dependencies are just qrcode and pillow - no models to download, no API keys. The repo is mirrored from GitLab, so issues and PRs live there.
The common gotcha is the max-size halt when you lengthen the text: raise max_image_size, shrink module_size, or trim the URL. And heads up, the README says "two nodes" - it's stale; there are four, all in this pack. If your QR art doesn't scan, the fix isn't usually here - it's downstream, in how you mask and denoise the pattern.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| protocol | COMBO | Https | 3 options: Http, Https, None |
| text | STRING | — | |
| module_size | INT | 161–64 | — |
| max_image_size | INT | 51264–4096 | — |
| fill_hexcolor | STRING | #000000 | — |
| back_hexcolor | STRING | #FFFFFF | — |
| error_correction | COMBO | High | 4 options: Low, Medium, Quartile, High |
| border | INT | 10–100 | — |
| module_drawer | COMBO | Square | 6 options: Square, Gapped square, Circle, Rounded, Vertical bars, Horizontal bars |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| QR_CODE | IMAGE | — |
| QR_VERSION | INT | — |
| IMAGE_SIZE | INT | — |