Nodes/ComfyUI_Lam/二维码识别
ComfyUI Node

二维码识别

Read a QR code back to text without leaving ComfyUI

By yanlang0123·Created 2 years ago·Updated about a month ago· 76
二维码识别
  • image
  • STRING

IdentifyingQR (the node is labeled 二维码识别 in the UI, literally "QR code recognition") is the simplest thing in the Lam pack: one image in, one string out. It finds a QR code in whatever image you feed it, decodes it, and hands you the text it contained. That's the whole job, and honestly it's a nice little utility to have around.

Why you'd reach for it

Most people use this node for one of two things. First, the one the pack author clearly designed it for: QR codes as a delivery mechanism for prompts. If you're building an automated pipeline - especially one where a workflow gets triggered from a phone or a printed code - a QR can carry a prompt, a config string, or an instruction that the graph decodes at runtime. You scan it into a STRING, wire that into a prompt slot, and your workflow is now driven by whatever the code says.

Second, and probably the more common use in the wild: verifying AI-generated QR art. People generate aesthetic QR codes (the "QR monster" style) constantly, and the fail state is generating something pretty that a phone can't scan. Drop the output into IdentifyingQR and you get the decoded text back if it's legible - or an error if it isn't. It's a quick sanity check that doesn't require pulling up a phone app. For that job the node is genuinely handy, even though it was built for the video pipeline above.

How it works

The node takes a single image (an IMAGE tensor from any Load Image or generator output) and returns a STRING with the decoded content. Behind the scenes it's a standard QR detect-and-decode pass - find the code, read the payload, return it. You don't configure anything: there are no optional inputs, no settings, nothing to tune. If the QR is present and reasonably legible, you get text out.

There's not much to explain in terms of mechanism, which is the point. It's the kind of node that either works or tells you the image doesn't contain a scannable code. If it fails, make sure the QR is in sharp focus and not tiny in the frame - real-world photos with glare or heavy rotation will decode unreliably, though clean generated QR art is usually fine.

Installing the pack

IdentifyingQR ships inside ComfyUI_Lam, so you install the whole pack and this node comes along:

cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam.git

then restart ComfyUI. Or use ComfyUI Manager and search for ComfyUI_Lam. A couple of real notes from the README before you run it:

  • The author targets the CUDA 12.1 portable ComfyUI build (ComfyUI_windows_portable_nvidia_cu121_or_cpu) and asks you to run install.bat, then a 修改文件.bat (Windows) or 修改文件.sh (Linux) patch script afterward.
  • The README also wants you to drop ControlNetLama.pth (from lllyasviel's Annotators) into models/lama/ and an "image-face-fusion" face-swap model into models/image-face-fusion. Those are for the pack's other nodes, not for IdentifyingQR - this node needs no model files at all.

The honest caveat

Like everything in this pack, the UI is in Chinese, the README is in Chinese, and there's effectively zero documentation for this node beyond its name. If you just need to read a QR code in a graph, this works fine - but you could also reach for any generic QR/OpenCV helper node with an English UI. Where Lam's version earns its place is the pipeline where the decoded string feeds straight into the LamAgent → MiniMax H3 video workflow. In that context it's the input stage that turns a physical code into a generation, and that's a neat trick.

Categorylam

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING