On Tuesday, a Reddit user named “nhciao” posted a series of artistic QR codes created using the Stable Diffusion AI image-synthesis model that can still be read as functional QR codes by smartphone camera apps. The functional pieces reflect artistic styles in anime and Asian art.
QR codes, short for Quick Response codes, are two-dimensional barcodes initially designed for the automotive industry in Japan. These codes have since found wide-ranging applications in various fields including advertising, product tracking, and digital payments, thanks to their ability to store a substantial amount of data. When scanned using a smartphone or a dedicated QR code scanner, the encoded information (which can be text, a website URL, or other data) is quickly accessed and displayed.
In this case, despite the presence of intricate AI-generated designs and patterns in the images created by nhciao, we’ve found that smartphone camera apps on both iPhone and Android are still able to read these as functional QR codes. If you have trouble reading them, try backing your camera farther away from the images.
Stable Diffusion is an AI-powered image-synthesis model released last year that can generate images based on text descriptions. It can also transform existing images using a technique called “img2img.” The creator did not detail the exact technique used to create the novel codes in English, but based on this blog post and the title of the Reddit post (“ControlNet for QR Code”), they apparently trained several custom Stable Diffusion ControlNet models (plus LoRA fine tunings) that have been conditioned to create different-styled results. Next, they fed existing QR codes into the Stable Diffusion AI image generator and used ControlNet to maintain the QR code’s data positioning despite synthesizing an image around it, likely using a written prompt.
Other techniques exist to make artistic-looking QR codes by manipulating the positions of dots within the codes to make meaningful patterns that can still be read. In this case, Stable Diffusion is not only controlling dot positions but also blending picture details to match the QR code.
This interesting use of Stable Diffusion is possible because of the innate error correction feature built into QR codes. This error correction capability allows a certain percentage of the QR code’s data to be restored if it’s damaged or obscured, permitting a level of modification without making the code unreadable.
In typical QR codes, this error correction feature serves to recover information if part of the code is damaged or dirty. But in nhciao’s case, it has been leveraged to blend creativity with utility. Stable Diffusion added unique artistic touches to the QR codes without compromising their functionality.
The codes in the examples seen here all point to a URL for qrbtf.com, a QR code-generator website likely run by nhciao based on their previous Reddit posts from years past. The technique could technically work with any QR code, although someone on the Reddit thread said that it may work best for shorter URLs due to how QR codes encode data.
This discovery opens up new possibilities for both digital art and marketing. Ordinary black-and-white QR codes could be turned into unique pieces of art, enhancing their aesthetic appeal. The positive reaction to nhciao’s experiment on social media may spark a new era in which QR codes are not just tools of convenience but also interesting and complex works of art.