---
title: "How we used evals and inference-time compute scaling to generate beautiful QR codes that actually work"
description: "Generating aesthetic QR codes (QArt codes) with Stable Diffusion and ControlNet often produces images that don't scan, so the team built automated evals: the QReader library for scannability and a community aesthetic predictor."
url: "https://swe.quest/articles/how-we-used-evals-and-inference-time-compute-scaling-to-generate-beautiful-qr-92cc5efa8fe78c6a"
canonical: "https://modal.com/blog/qart-codes-evals"
source: "Modal"
published: "2025-07-02"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["evals","computer-vision","inference","machine-learning"]
---

# How we used evals and inference-time compute scaling to generate beautiful QR codes that actually work

A post on [Modal](https://swe.quest/sources/modal.md), published 2025-07-02, 13 min read, Case study. Original: [https://modal.com/blog/qart-codes-evals](https://modal.com/blog/qart-codes-evals)

## Summary

Generating aesthetic QR codes (QArt codes) with Stable Diffusion and ControlNet often produces images that don't scan, so the team built automated evals: the QReader library for scannability and a community aesthetic predictor. They validated both against roughly two thousand hand-scanned and hand-rated prompt-URL pairs. They then swept ControlNet guidance timing and strength on Modal, using a "toast plot" grid to choose a configuration with better aesthetics but a lower scan rate. To recover reliability, they moved the evals into production: they generate many candidates in parallel on GPUs and rank them by scan success and then aesthetic score. That reached a 95% scan-rate SLO with p95 latency under 20 seconds.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)

## Prerequisites

- diffusion models basics
- ControlNet
- QR code error correction

## Keywords

ControlNet, Stable Diffusion 1.5, QReader, Weights & Biases Weave, Modal, QArt codes, YOLO

## Related posts

- [2D Asset Generation: AI for Game Development #4](https://swe.quest/articles/2d-asset-generation-ai-for-game-development-4-01cd732635277696.md): Hugging Face · 2023-01-26 · Medium · 8 min read · Computer vision, Games
  Stable Diffusion's Image2Image mode can be used as one step in a conventional 2D art workflow rather than a replacement for it: rough hand sketches are fed in, the output is painted over in an image editor, and the result is fed back in.
- [Create an infinite icon library by fine-tuning Stable Diffusion](https://swe.quest/articles/create-an-infinite-icon-library-by-fine-tuning-stable-diffusion-bfc1ceb5caaf1412.md): Modal · 2024-05-21 · Medium · 12 min read · Model training, Computer vision, Inference & serving, Serverless, Python
  Stable Diffusion v1.5 is fully fine-tuned on the ~300-icon Heroicons set to generate new icons in a similar black-and-white line style.
- [Open Preference Dataset for Text-to-Image Generation by the 🤗 Community](https://swe.quest/articles/open-preference-dataset-for-text-to-image-generation-by-the-community-51063f2eca79d4de.md): Hugging Face · 2024-12-09 · Easy · 7 min read · Model training, Computer vision, Evaluation, Open source
  Data is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks.
- [Supercharge your OCR Pipelines with Open Models](https://swe.quest/articles/supercharge-your-ocr-pipelines-with-open-models-6c91417d0009054a.md): Hugging Face · 2025-10-21 · Medium · 16 min read · Computer vision, Inference & serving, Evaluation, RAG & retrieval
  Vision-language-model-based OCR has moved well beyond plain transcription.
- [Introducing Würstchen: Fast Diffusion for Image Generation](https://swe.quest/articles/introducing-wurstchen-fast-diffusion-for-image-generation-7dba36d9df7944a1.md): Hugging Face · 2023-09-13 · Medium · 6 min read · Computer vision, Inference & serving, Python
  Würstchen is a text-to-image diffusion model whose text-conditional Prior (Stage C) runs in a latent space with 42x spatial compression, far beyond the usual 4-8x.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
