Design your own A.I. QRcode

Vladimir Garnele
6 min readJun 13, 2023

--

I recently discovered the possibility of generating QR codes with AI and came across some inspiring examples. I wanted to experiment with it to leverage its potential for potential clients. After a few days of trial and error, I wanted to share the process with you to make it quicker for you.

In this article, I will guide you on how to design your own QR code in just a few minutes. Please note that this guide assumes you already have everything set up on your laptop.

Depending on your specific case, some of the steps mentioned here may not be necessary for you.

Software installation

1. Stable Diffusion Setup (for those who don’t have it)

Stable Diffusion is a powerful tool that allows you to have more control over your AI creations, especially when using extensions like ControlNets. If you don’t have Stable Diffusion set up on your laptop, follow these instructions based on your operating system:

2. ControlNets Extension Setup (for those who don’t have it)

ControlNet takes AI to another level by allowing you to modify parts of an image and change its composition. In our case, it will help you include the QR code in the image. Follow these steps to download and set up ControlNet:

QR Code

To modify a QR code, you need to have an optimized QR code that can be edited. In general, QR codes can be modified from 7% to 30%.

Sources: QR Code Error Correction

You can use this QR code generator that allows you to control the error correction level. Set it to “Level H” for high error correction: QR Code Generator

Note: Since I’m living in China, I wanted to generate the image based on my WeChat QR code. However, since you may not be able to modify it, you can drag and drop your own code into this website to generate a link: QR Code Decoder

Step-by-Step Guide

Step 1:

Stable Diffusion Checkpoint You can use any AI model, but I recommend either the Dream Shaper model from Civitai or the Reanimated model from Hugging Face.

Step 2:

Select the “img2img” tab.

Step 3:

Input your positive and negative prompts. You can use the following as a starting prompt:

Positive Prompt: “ancient Chinese-style landscape painting, mountains in front, beautiful winding green river behind, extremely sharp old paper detail, high paper detail, high line detail, high resolution, ultra-high quality, raw, 8k image, extremely high color detail, intricate, epic composition, cinematic lighting, masterpiece, bold complimentary colors. Stunningly masterfully illustrated by Artgerm and range Chinese-style landscape painting, yellow paper color, painted with black and white ink, extremely sharp old paper detail, high paper detail, high line detail, high resolution, ultra-high quality, raw, 8k image, extremely high color detail, intricate, epic composition, cinematic lighting, masterpiece, Artstation, Sergey Svistunov, hyperrealistic, thick fog.” lora:epi_noiseoffset2:1

Negative Prompt: “ugly, disfigured, low quality, blurry, NSFW, fish eyes, watermark, text”

To add more contrast to your prompt, you can use the Lora model, which you can find at this link: Lora Model Guide.

Step 4:

Upload your QR code image.

Select the following parameters:

  • Sampling method: DPM++ 2M karmas
  • Sampling step: 50
  • Size: 768x768
  • FG Scale: 7
  • Denoising strength: 0.75

Step 5:

ControlNet I recommend having three tabs in ControlNets to play around more with the image.

Step 1: Click on Tap setting

Step 2: change the number of Multi ControlNet: Max models amount

Step 3: Apply the setting

Parameters for each ControlNet unit:

ControlNets Unit 0

Upload in the unit the same qrcode.

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile (download from ControlNet Model)
  • Control weight: 0.9
  • Starting control step: 0.24
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

ControlNets Unit 1

Upload the same QR code in the unit

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile
  • Control weight: 1
  • Starting control step: 0.52
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

Now you can generate the image :)

Other examples

Batman

Prompt positive:

A picture of (one Batman) portrait, in the style of (expressive use of line), frank Miller style, powerful gestural mark ((yellow background)), full image, above edge <lora:epi_noiseoffset2:1>

Prompt negative:

ugly, disfigured, low quality, blurry, NSFW, fish eyes, watermark, text, (worst quality, low quality,3D:2), monochrome, zombie, overexposure, watermark, text, bad anatomy, easy negative,ng_deepnegative_v1_75t, ((multiple batman)) women, hair

Parameters for each ControlNet unit:

ControlNets Unit 0

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile (download from ControlNet Model)
  • Control weight: 0.9
  • Starting control step: 0.24
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

ControlNets Unit 1

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile
  • Control weight: 1
  • Starting control step: 0.40
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

Shanghai

Prompt positive:

Shanghai streets, powerful, intricate, elegant, colorful volumetric lighting, scenery, neon, digital painting, highly detailed, art station, sharp focus, illustration, concept art, ruan jia, steve mccurry <lora:epi_noiseoffset2:1>

Prompt negative:

ugly, disfigured, low quality, blurry, nsfw, fish eyes, watermark, text

Parameters for each ControlNet unit:

ControlNets Unit 0

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile (download from ControlNet Model)
  • Control weight: 0.85
  • Starting control step: 0.23
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

ControlNets Unit 1

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile
  • Control weight: 1
  • Starting control step: 0.40
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

Spring landscape

Prompt positive:

A cubism painting, Beautiful oil on canvas impressionistic painting of a beautiful spring day consisting of a large pond surrounded by birch trees with impasto brush strokes. Style of Claude Monet, 16k, UHDPrompt negative:

Prompt negative:

Ugly, disfigured, low quality, blurry, nsfw, fish eyes, watermark, text, human

Parameters for each ControlNet unit:

ControlNets Unit 0

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile (download from ControlNet Model)
  • Control weight: 0.9
  • Starting control step: 0.23
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

ControlNets Unit 1

  • Preprocessor: tile_resample
  • Model: control_v11f1e_sd15_tile
  • Control weight: 9
  • Starting control step: 0.57
  • Ending control step: 0.9
  • Control mode: balanced
  • Resize mode: just resize

Enjoy experimenting with these steps, and please let me know if you have any questions or need further assistance.

--

--