banner
0xMech

0xMech

Focus on various AI application sharing, Blockchain learners, web3 new leeks
twitter

Generate cool QR codes using stable diffusion.

Intro#

The above QR code is my ERC-20 address. Friends who have money can donate a little. 1U2U is not too little, and 1ETH2ETH is not too much. The following images are made by other experts that I found online. They are very beautiful, so I'm sharing them for everyone to enjoy.

By careful observation, you can see that these QR codes hidden in the images are very different from ordinary QR codes, which is what amazes me. Today, I will guide you step by step through an English document on how to create such images.

Operating Environment#

Local Operation#

If you have the conditions, you can use your own computer and install stable diffusion and the desired model and controlnet. You can search for installation methods on your own, as there are very detailed tutorials available.

Online Operation#

If your personal computer configuration is not sufficient and you only use it for learning purposes without a large demand, then I recommend renting a GPU like I do.

Some time ago, you could use Google's "colab" for training for free. However, Google discovered this bug and prohibited free users from using it for stable diffusion training, thus ending my idea of getting it for free. The paid experience on colab is also good, but it has higher requirements for network and payment methods. I believe that most people are not satisfied with it. Therefore, I recommend using the online computing power platform Lanrui Xingzhou. With a 3090 graphics card, running stable diffusion is more than enough, and the cost of 1.9 yuan per hour is very cost-effective. Okay, enough said, not advertising.

Preparation#

Prepare QR Code#

First, prepare the QR code you want to use. I will demonstrate using my ERC-20 address. Open this QR code website, where you can upload a screenshot with a QR code, or directly enter text content or a website. After uploading, select the first style, which is the clearest and produces the best final result. You don't need to modify any other parameters, just click download.

Prepare QR Code

Download QR PNG

Prepare Images#

You can use your own images and generate QR code images using the "img2img" function, or you can use stable diffusion to generate images. Here, I will demonstrate the latter.

Rent Computing Power Platform#

Open the website mentioned above, register if necessary, and recharge your account. To avoid being charged for installing stable diffusion, open the application market first, select the new version of stable diffusion, install it, and then open it. Finally, create an instance and wait for initialization to complete. Click the link to open the Web-UI.

GPU1

GPU2

GPU3

Generate Images#

Since I am not very familiar with the stable diffusion plugin, I used the most conservative method. Here, I will demonstrate using the GhostMix model. After downloading this model, upload it to the /data/models/Stable-diffusion path.

Enter your own prompt, both for the front and back. You can also choose your favorite image prompt on civitAI, but be sure to pay attention to copyright content. You can refer to my prompt:

Japanese painting, mountains, 1girl

Negative prompt:

ugly, disfigured, low quality, blurry, nsfw

Then click on "img2img" and place the QR code in it.

Parameter settings:

Resize mode: Just resize
Sampling method: DPM++2M Karras
Sampling step: 50
Width: 768
Height: 768
CFG Scale: 7
Denoising strength: 0.75

Go to the controlNet settings below and upload the QR code image again in "ControlNet unit 0", and set the parameters as follows:

Enable: Yes
Control Type: Tile
Preprocessor: tile_resample
Model: control_xxx_tile
Denoising strength: 0.75
Control weight: 1
Starting Control Step: 0.23
Ending Control Step: 0.9

If you are not satisfied with the generated image, you can modify the "Control weight" and "Starting Control Step" parameters and continuously adjust them until you are satisfied with the result. After generating the image, be sure to scan it with your phone and make adjustments if necessary.

Show3

Other Images and Prompts#

Here are a few other styles of images and prompts. You can also choose your own prompts.

Villa Style#

Houses1

Prompt:

a cubism painting of a town with a lot of houses in the snow with a sky background, Andreas Rocha, matte painting concept art, a detailed matte painting

Negative prompt:

ugly, disfigured, low quality, blurry, nsfw

Parameters:

Control weight: 0.97
Starting Control Step: 0.23
Ending Control Step: 0.9

Mechanical Girl Style#

Show4

Prompt:

1mechanical girl,ultra realistic details, portrait, global illumination, shadows, octane render, 8k, ultra sharp,intricate, ornaments detailed, cold colors, metal, egypician detail, highly intricate details, realistic light, trending on cgsociety, glowing eyes, facing camera, neon details, machanical limbs,blood vessels connected to tubes,mechanical vertebra attaching to back,mechanical cervial attaching to neck,sitting,wires and cables connecting to head

Negative prompt:

ugly, disfigured, low quality, blurry

Parameters:

Control weight: 1
Starting Control Step: 0.23
Ending Control Step: 0.7

Robot Style#

Show1

Prompt:

light, futobot, cyborg, ((masterpiece),(best quality),(ultra-detailed), (full body:1.2), 1male, solo, hood up, upper body, mask, 1boy, male focus,white gloves, cloak, long sleeves, spaceship, lightning, hires

Negative prompt:

ugly, disfigured, low quality, blurry

Parameters:

Control weight: 1
Starting Control Step: 0.24
Ending Control Step: 0.9

Market Style#

Outdoor Market2

Prompt:

A photo-realistic rendering of a busy market, ((street vendors, fruits, vegetable, shops)), (Photorealistic:1.3), (Highly detailed:1.2), (Natural light:1.2), art inspired by Architectural Digest, Vogue Living, and Elle Decor

Negative prompt:

ugly, disfigured, low quality, blurry, nsfw

Parameters:

Control weight: 87
Starting Control Step: 0.23
Ending Control Step: 0.9

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.