Nodes/Blind_watermark_Comfyui/πŸ“² Generate QR Code
ComfyUI Node

πŸ“² Generate QR Code

Generate a QR code in ComfyUI β€” the real trick is hiding it in an image

By TianDongLΒ·Created 11 months agoΒ·Updated 11 months agoΒ· 22
πŸ“² Generate QR Code
    • qr_image
    • info
    β—„texthttps://github.com/guofei9987/blind_watermarkβ–Ί
    β—„qr_size128β–Ί
    β—„error_correctionM (15%)β–Ί
    β—„border2β–Ί
    β—„invertfalseβ–Ί

    On its own, this node is a QR code generator, and there are a hundred ways to make a QR code that don't involve ComfyUI. The reason it exists in this pack is the workflow it feeds: generate a QR code, bury it in an image as an invisible watermark, then extract and decode it later. That turns a plain QR generator into the front end of a genuinely clever anti-piracy or attribution pipeline.

    So think of it as half utility node, half payload factory. It wraps Python's qrcode library - no frequency-domain magic here, unlike the rest of this pack. The QR code is just a normal, very legible QR image that gets binarized down to black-and-white bits when you feed it to the embed node.

    The inputs that matter

    • text - the payload. A URL, a copyright string, anything. It's multiline, so long text is fine, though shorter keeps the QR denser.
    • error_correction - L (7%), M (15%), Q (25%), H (30%). This is the one you actually want to think about. When you hide a QR inside an image watermark and pull it back out, the round-trip degrades it. The higher the correction level, the more of that damage the decoder can shrug off. Use H (30%) if the QR is going through the watermark path. If you just want a QR for a link, M is fine and keeps the code smaller.
    • qr_size - output pixel size, 32 to 1024, default 128. For watermarking, remember the embed node converts your logo down to 1-bit bits, so a small, crisp QR is better than a huge one.
    • border - quiet zone in modules (default 2). Leave it; scanners need the quiet zone.
    • invert - flips to white-on-black, which can survive some image pipelines better.

    Outputs are qr_image (an IMAGE you wire straight into the embed node) and info (a STRING with the size, error level, and QR version). Wire qr_image into WatermarkEmbedImage's watermark_image input and you have the README's "Example 3" pipeline in four nodes.

    Install

    It ships in the Blind_watermark_Comfyui pack, so you're installing the whole thing:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TianDongL/Blind_watermark_Comfyui.git
    pip install -r requirements.txt
    # restart ComfyUI
    

    Or just search "Blind Watermark" in ComfyUI Manager and install from there. No models to download, no GPU needed - this is a CPU-only, no-vram pack.

    Troubleshooting

    • The pack's own QR decode node needs pyzbar, which has a well-earned reputation for being fiddly, especially on Windows where it wants a native zbar library. The embed/extract nodes don't need it at all - only the decoder does. If you can't get pyzbar working, the example workflow in this repo quietly uses LayerUtility: DecodeQRCode (from ComfyUI-LayerStyle) instead. That's not a bug, that's a workaround the author shipped with.
    • QR won't decode after watermark round-trip? Re-embed with H error correction and don't re-save the image as JPEG multiple times. JPEG is the enemy of every watermark in this pack.
    • Node missing from the menu usually means the requirements didn't actually install (check your console for the pip install error) or you didn't restart ComfyUI after installing.
    CategoryBlindWatermark/QRCode

    Inputs (5)

    NameTypeDefaultDescription
    textSTRINGhttps://github.com/guofei9987/blind_watermarkText or URL to encode in QR code
    qr_sizeINT12832–1024QR code image size (pixels)
    error_correctionCOMBOM (15%)Error correction level - higher allows more damage tolerance
    borderINT20–10Border size in modules
    invertBOOLEANfalseInvert colors (white on black)

    Outputs (2)

    NameTypeDescription
    qr_imageIMAGEβ€”
    infoSTRINGβ€”