π°οΈ QRCodes (Simple Style)
The QR code that dresses up
- IMAGE
- MASK
- INVERTED_MASK
The show-off of the qrcode family
QRCodes (Simple Style) is where this pack stops being utilitarian. Where the B&W and Color nodes hand you a plain module grid, this one can draw every module as a circle, a rounded square, a gapped square, or vertical/horizontal bars - and paint the whole thing with a solid fill or a radial, square, horizontal, or vertical gradient. It's the node you use when the QR code is the design, not a thing to be hidden under ControlNet paint.
How it works
Under the hood it's the qrcode library's StyledPilImage with two families of options, and that's the whole mental model:
style- six module drawers:CircleModuleDrawer,RoundedModuleDrawer,SquareModuleDrawer,GappedSquareModuleDrawer,VerticalBarsDrawer,HorizontalBarsDrawer. This changes what each individual dark module looks like.color- five color masks:SolidFillColorMaskplus radial/square/horizontal/vertical gradients. This is wherecolor_1st,color_2nd,color_3rdcome in - the mapping depends on the gradient:- SolidFill β
1st= background,2nd= modules. - Radial/Square β
1st= back,2nd= center,3rd= edge. - Horizontal/Vertical β
1st= back,2nd= left/top,3rd= right/bottom.
- SolidFill β
Everything else is the same qrcode plumbing as Simple Color: bg_color/fg_color as tuple strings, error_correct, version, box_size, border, and a radius that rounds the whole code - except here the corners outside the radius are filled with hardcoded white, not a pickable color.
Two version gotchas worth knowing: this is the only node in the pack that needs a recent qrcode (StyledPilImage arrived in qrcode 7.x; the pack pins 8.0), and the code uses Python 3.10+ match statements, so it dies on older Pythons with a syntax error rather than a friendly message.
The scannability tax
Here's my honest take: circle and gapped-square modules look great and scan noticeably worse. Gradients look slick and murder the contrast the QR reader depends on. Every style choice here is a trade against the code's ability to actually decode, which is why the README's whole anatomy lesson - finder patterns, quiet zone, error correction levels - suddenly matters. Concretely: keep error_correct on H (the dropdown defaults to L), keep the gradient stops high-contrast (dark 2nd, light 1st), and don't go below a couple of modules of border - the quiet zone is non-negotiable.
Inputs, briefly
text, width, height, bg_color, fg_color, error_correct, version (default 1 - raise it for URLs or it errors), box_size, border, radius, style, color, color_1st/2nd/3rd, and mask_color (red/green/blue - which channel the MASK/INVERTED_MASK outputs derive from). Outputs are those three: image plus the two masks.
Troubleshooting
- ImportError about styledpil β your environment's
qrcodeis too old.pip install qrcode==8.0(which the pack's requirements file already pins). - SyntaxError on load β you're on Python < 3.10.
- Won't scan β too cute. Rounded or square modules, solid fill, error correction H, and verify with the pack's QRCodeReader.
Installing it
Same pack, 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 files. It shows up under QR Code Nodes β qrcode-based after restart.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| width | INT | 5121β8192 | β |
| height | INT | 5121β8192 | β |
| bg_color | STRING | (0, 0, 0) | β |
| fg_color | STRING | (255, 255, 255) | β |
| error_correct | COMBO | 4 options: ERROR_CORRECT_L, ERROR_CORRECT_M, ERROR_CORRECT_Q, ERROR_CORRECT_H | |
| version | COMBO | 40 options: 1, 2, 3, 4, 5, 6, +34 | |
| box_size | INT | 100β8192 | β |
| border | INT | 40β8192 | β |
| radius | INT | 00β8192 | β |
| style | COMBO | 6 options: CircleModuleDrawer, RoundedModuleDrawer, SquareModuleDrawer, GappedSquareModuleDrawer, VerticalBarsDrawer, HorizontalBarsDrawer | |
| color | COMBO | 5 options: RadialGradiantColorMask, SolidFillColorMask, SquareGradiantColorMask, HorizontalGradiantColorMask, VerticalGradiantColorMask | |
| color_1st | STRING | (255, 255, 255) | β |
| color_2nd | STRING | (255, 0, 0) | β |
| color_3rd | STRING | (255, 0, 255) | β |
| mask_color | COMBO | 3 options: red, green, blue |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |
| MASK | MASK | β |
| INVERTED_MASK | MASK | β |