# Stable Diffusion QR codes: do they scan?

> Sometimes, and not reliably. Diffusion models preserve the code's overall pattern but shift luminance locally, so some modules end up on the wrong side of the decoder's threshold. Expect a meaningful share of generations to fail on at least one phone. Test every output with a real decoder, several devices and both close and far distances.

Source: https://useqr.app/docs/design/stable-diffusion-qr-codes-do-they-scan · Last reviewed 2026-08-21 · UseQR is free forever, no signup.

---

## The short answer

Sometimes. A well-tuned generation with a short payload and error correction H can scan
on most phones. A large fraction of generations do not, and almost none scan as robustly
as a plain code. If you need a number to plan around: treat every generation as a
candidate with an unknown pass rate, because the model gives you **no guarantee per
module**, only a tendency.

## Why "sometimes" is the honest answer

A decoder finds the three corner squares, maps the grid, then samples luminance near each
**module centre** and thresholds it dark or light. Diffusion art fails this pipeline in
three specific ways:

- **Local contrast violations.** The conditioning is a soft constraint. The model happily
  paints a module centre as a mid-grey that sits within a few percent of the binarisation
  threshold: decisive for the artwork, ambiguous for the decoder.
- **Different decoders, different thresholds.** Binarisation strategies vary between
  scanner implementations, so a marginal code famously
  [scans on one phone and not another](/docs/troubleshooting/qr-code-scans-on-one-phone-only).
  "It worked on my phone" is a sample size of one threshold.
- **Distance eats detail first.** At 10× the code's width each module spans only a few
  camera pixels (see [module size vs camera resolution](/docs/spec/module-size-vs-camera-resolution)),
  and the painterly texture that read as "dark enough" close up averages into mush.

## How to test one properly

A single successful scan proves nothing. A generation earns trust by surviving all of this:

1. **Machine decode first.** Upload the final artwork to the [validator](/validate). It
   decodes the rendered image and confirms the payload byte-for-byte. Anything that fails
   here is discarded before wasting phone time.
2. **At least three phones**, including one several years old, camera and decoder
   diversity is the point.
3. **Two distances**: close (about 15 cm) and the full working distance of 10× the
   code's width.
4. **Two lighting conditions**: bright and dim indoor. Low light collapses exactly the
   marginal contrast these codes run on.
5. **Off-axis**: roughly 30° off perpendicular.
6. **The final medium.** If it will be printed, test the print: screens are the
   best case, as [screen-vs-print failures](/docs/troubleshooting/qr-code-scans-on-screen-not-in-print)
   show.

This is the same discipline as any [decode-verify loop](/docs/developers/why-verify-that-your-qr-code-decodes),
applied with extra paranoia because the failure modes are diffuse.

## Improving the odds

Reliability and artistic freedom trade off directly through the ControlNet conditioning
weight: more guidance, more scannable, more visibly QR-shaped. Beyond that slider:
shorten the payload so the version stays low and modules stay large, use error correction
H, keep the corner finder patterns and quiet zone effectively untouched, and generate in
batches, keeping only outputs that pass the full test above. The wider design context is
in [artistic and AI-generated QR codes](/docs/design/artistic-and-ai-generated-qr-codes).

## When the trade-off is worth it

When the image matters more than the scan: exhibition posters, album art, pieces where
the code is the concept. Even then, print a plain
[short URL underneath](/docs/design/qr-code-next-to-a-short-url-fallback) so a failed scan
costs the viewer five seconds instead of the connection. Where the scan is the product
(payments, menus, tickets, packaging) the answer is simply no; use a conventional code.

## FAQ

### Do Stable Diffusion QR codes actually work?

Some do, on some phones, at some distances. The conditioning steers module luminance but
guarantees nothing, so reliability varies per generation. Every output must be tested
individually with a real decoder and multiple devices before use.

### Why does my AI QR code scan on one phone but not another?

Decoders binarise the image with different thresholding strategies, and cameras differ in
resolution and low-light behaviour. Art codes run close to the threshold everywhere, so
small implementation differences flip modules between readable and not.

### How can I make an AI QR code more scannable?

Raise the conditioning weight, shorten the payload so modules are larger, use error
correction H, and keep the three corner squares and quiet zone clean. Then generate many
candidates and keep only those that pass testing on several phones at full distance.

### Should I use an AI-generated QR code for my business?

Not where the scan carries revenue or safety: menus, payments, packaging, signage. Use
them where the artwork is the point and a failed scan is a shrug, and always print a
readable URL alongside.

## Try it

- https://useqr.app/validate
- https://useqr.app/url
- https://useqr.app/scan
