/AI-QRCodeWithColab

This repository describes how to create QR Code art using AI and Colab.

Primary LanguageJupyter Notebook

How to Create an QRCode Art

Generated QR Code

This repository provides a comprehensive guide on how to create QR codes Art using Stable Diffusion.

📚 Table of Contents

⚙️ Prerequisites

  1. Download this repository and open AI-QRCode.ipynb with Google Colab. Setup
  2. Open Resources and set the Hardware accelerator to GPU. Resources

🕸️ Open WebUI

Follow the steps in the code to open the Public URL. Public URL

Navigate to Settings and ControlNet. Make sure Multi ControlNet: Max models amount is set to more than 2 (default is 3), then click Apply settings and Reload UI. ControlNet

🎨 QR Code Generation

Follow the steps below to generate your QR code Art:

  1. Open ControlNet -> ControlNet Unit 0 and upload your QRCode. ControlNet Unit 0
  2. Adjust your settings as follows:
    • set the preprocessor to [invert] if your image has a white background and black lines to Enable
    • Set Preprocessor to inpaint_global_harmonious.
    • Set Model to control_v1p_sd15_brightness [5f6aa6ed].
    • Set Control Weight to 0.35. ControlNet Unit 0 Settings
  3. Open ControlNet -> ControlNet Unit 1 and upload your QRCode, then adjust your settings as follows:
    • set the preprocessor to [invert] if your image has a white background and black lines to Enable
    • Set Preprocessor to inpaint_global_harmonious.
    • Set Model to control_v11f1e_sd15_tile [a371b31b].
    • Set Control Weight to 0.55.
    • Set Starting Control Step to 0.35.
    • Set Ending Control Step to 0.75. ControlNet Unit 1 Settings
  4. Prompt your QR Code image to be generated. For instance:
    • Prompt: masterpiece, best quality, Japanese house, tree, and city background
    • Nagative Prompt: UnrealisticDream, FastNegativeEmbedding

Prompt

📌 Others

The style of the generated image heavily depends on the Stable Diffusion checkpoint. You can change the checkpoint to generate a QR code image with a different style.

Checkpoint

You can add more checkpoints by modifying these lines of code: Code

To download checkpoints, run curl -Lo filename.safetensors downloadLink and move the downloaded file into the /content/microsoftexcel/models/Stable-diffusion folder.


This repo is inspired by sd-misc-colab and Rowan Cheung's Twitter post.