Creating Artistic QR Code Images with ControlNet and Stable Diffusion
The article demonstrates how to create visually appealing, scannable QR‑code artworks using ControlNet and Stable Diffusion, explaining QR‑code structure, contrast preservation, and several pipelines—including tile‑based, OpenPose‑combined, and community QR‑code models—while detailing WebUI settings, prompt examples, weight tuning, and a custom ControlNet that reduces grid artifacts.
In this article the author explores how to generate artistic QR‑code images that remain scannable while blending seamlessly into visual artwork. The discussion starts with a brief overview of QR‑code structure—three positioning patterns and a data matrix—and the basic decoding steps (detect positioning patterns, binarize the image, decode the binary stream).
The key insight is that as long as the bright‑dark contrast of the QR‑code is preserved, the code can still be read. Therefore the challenge is to embed the QR‑code into an image without destroying this contrast.
Several generation pipelines are presented:
Using ControlNet 1.1 Tile (preprocessor: tile_resample ) together with Stable Diffusion's img2img to enhance texture details in the QR‑code region while keeping the overall contrast.
Combining ControlNet Tile with ControlNet OpenPose to also control the pose of a human figure in the image.
Employing community‑released QRCode‑ControlNet models (e.g., DionTimmer/controlnet_qrcode‑control_v1p_sd15 ) and discussing their strengths and weaknesses.
For each pipeline the author provides concrete WebUI settings and full prompt strings. Example prompt snippets are shown below:
Tony Stark, bruise wounded, wet soaked, water splash, torn apart, ripped clothes, random background vintage, neons lights, (high detailed skin:1.2), 8k uhd, dslr, soft lighting, hyperdetailed, intricately detailed, unreal engine, fantastical, ideal human, high quality, film grain, bokeh, Fujifilm XT3, hyper realistic
Negative prompt: ugly, disfigured, low quality, blurry, nsfw
Steps: 50, Sampler: DPM++ 2M Karras, CFG scale: 10, Seed: 3724036266, Size: 768x768, Model hash: 4199bcdd14, Model: revAnimated_v122, Denoising strength: 0.85, Mask blur: 4, ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 0.8, starting/ending: (0.23, 0.9), resize mode: Just Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (512, 1, 64)" futobot, cyborg, ((masterpiece),(best quality),(ultra-detailed), (full body:1.2), 1 female, solo, hood up, upper body, mask, 1 girl, female focus, black gloves, cloak, long sleeves
Negative prompt: paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, nsfw, nipples, (((necklace))), (worst quality, low quality:1.2), watermark, username, signature, text, multiple breasts, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet, single color, ((((ugly)))), (((duplicate))), ((morbid)), ((mutilated)), (((tranny))), (((trans))), (((trannsexual))), (hermaphrodite), extra fingers, mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), (((disfigured)), (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), (missing legs), (((extra arms))), (((extra legs))), mutated hands,(fused fingers), (too many fingers), (((long neck))), (bad body perspect:1.1)
Steps: 60, Sampler: DPM++ 2M Karras, CFG scale: 11, Seed: 2912497446, Size: 768x768, Model hash: ed4f26c284, Model: camelliamix25D_v2, Denoising strength: 1, Mask blur: 4, ControlNet 0: "preprocessor: openpose_full, model: control_sd15_openpose [fef5e48e], weight: 1, starting/ending: (0, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (512, 64, 64)", ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 0.75, starting/ending: (0.23, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (512, 1, 64)"The author notes that excessive “grid‑feel” (visible QR‑code squares) reduces aesthetic quality, while insufficient contrast can break scannability. Adjusting the ControlNet weight and the start/end diffusion steps is crucial: higher weight yields stronger QR‑code texture but may introduce unwanted grid patterns; lower weight may lose readability.
Experiments with different input QR‑code colors (e.g., red) demonstrate that the pipeline can produce more natural‑looking results when the QR‑code color matches the target scene.
Finally, the article proposes a custom QR‑code ControlNet trained on data that preserves contrast while discarding color and grid artifacts. Preliminary results show improved visual appeal and higher success rates compared to generic tile‑based approaches.
Overall, the piece provides a practical guide for researchers and developers interested in AI‑driven QR‑code art, covering theory, implementation details, parameter tuning, and evaluation of multiple methods.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.