Live data from Hacker News

How to make a QR code with Stable Diffusion

stable-diffusion-art.com

21–30 of 75 posts

Re: How to make a QR code with Stable Diffusion

#21
post #20
post #7

The funny thing is that no-one AFAICT has realized that the same content can be encoded in different-looking QR codes. Beside the obvious (different error-correction levels), the content itself can be changed while maintaining its semantic meaning (e.g. " https://example.com/foo ", "HTTPS://EXAMPLE.COM/foo", or "HtTpS://eXaMpLe.CoM/foo" are all semantically identical) and even the QR encoding itself can be tweaked (e…

There is a CRC so it's not as easy at it sounds.

None of what I wrote impacts the CRC calculation.

Re: How to make a QR code with Stable Diffusion

#22
post #7

The funny thing is that no-one AFAICT has realized that the same content can be encoded in different-looking QR codes. Beside the obvious (different error-correction levels), the content itself can be changed while maintaining its semantic meaning (e.g. " https://example.com/foo ", "HTTPS://EXAMPLE.COM/foo", or "HtTpS://eXaMpLe.CoM/foo" are all semantically identical) and even the QR encoding itself can be tweaked (e…

Also not sure the diffusion model has been taught yet that it could in some cases choose to deliberately ignore a (small) fraction of some of the elements/blocks, if it helps with composition.

Or even better just wire up a QR decoder to the loop and automatically reject images that don't decode correctly, and let the model sort out how far it can go.

Re: How to make a QR code with Stable Diffusion

#23

My phone camera couldn't recognize any of the generated ones. Looks cool though

My phone didn't recognized as well, until I zoomed out the screen to 50% and I was able to scan all the generated QRs from the article.

With iPhone 14 from MacBook Air M1 screen about 35-40 cm away every picture except one read on first try and that one read after I pulled the phone back a bit.

Re: How to make a QR code with Stable Diffusion

#24
post #21
post #20

Earlier quoted context omitted.

There is a CRC so it's not as easy at it sounds.

None of what I wrote impacts the CRC calculation.

Diffusion models cannot generate a qr code by itself. The article even shows you need to generate the base image yourself. What you are proposing would mean bruteforcing the QR codes until we see a better shape.

Re: How to make a QR code with Stable Diffusion

#25
post #7

The funny thing is that no-one AFAICT has realized that the same content can be encoded in different-looking QR codes. Beside the obvious (different error-correction levels), the content itself can be changed while maintaining its semantic meaning (e.g. " https://example.com/foo ", "HTTPS://EXAMPLE.COM/foo", or "HtTpS://eXaMpLe.CoM/foo" are all semantically identical) and even the QR encoding itself can be tweaked (e…

QR codes have several different bit-pattern masks, which an encoder should choose between to avoid blocks or runs.. so even without altering the URL there are different outputs.

[A-Z0-9] encodes a lot more efficiently than [a-zA-Z0-9] so there are other considerations when altering a url.

Re: How to make a QR code with Stable Diffusion

#26
post #7

The funny thing is that no-one AFAICT has realized that the same content can be encoded in different-looking QR codes. Beside the obvious (different error-correction levels), the content itself can be changed while maintaining its semantic meaning (e.g. " https://example.com/foo ", "HTTPS://EXAMPLE.COM/foo", or "HtTpS://eXaMpLe.CoM/foo" are all semantically identical) and even the QR encoding itself can be tweaked (e…

Other things you can tweak in a QR Code symbol without changing the decoded content: Error correction level, empty segments, segment encoding, deliberate addition of fully correctable errors, messing with padding bits/bytes after the terminator.

Re: How to make a QR code with Stable Diffusion

#27

As an engineer, the lack of consideration for the matter of how much one should corrupt a signal (which might be scanned under different conditions, such as different light levels and resolutions) is grating to me. It’s like scratching a design onto the bottom of an audio CD, playing it, and if it works on your CD player, shipping it. “Works for me”

This is a classic read: http://datagenetics.com/blog/november12013/index.html

Re: How to make a QR code with Stable Diffusion

#28
post #24
post #21

Earlier quoted context omitted.

None of what I wrote impacts the CRC calculation.

Diffusion models cannot generate a qr code by itself. The article even shows you need to generate the base image yourself. What you are proposing would mean bruteforcing the QR codes until we see a better shape.

I wouldn't call generating a couple of semantically equivalent (but fully valid and 0 error) QR codes and giving each of them as inputs to diffusion model brute forcing.

Even the normal AI image generation process often involves some trial and error. Generating a bunch of variants by changing random seed or slightly tweaking prompt keywords and choosing a result which looks the best. Doing multiple attempts with multiple different inputs doesn't seem more crazy than doing multiple attempts with same input and hoping for better results.

Re: How to make a QR code with Stable Diffusion

#29
post #28
post #24

Earlier quoted context omitted.

Diffusion models cannot generate a qr code by itself. The article even shows you need to generate the base image yourself. What you are proposing would mean bruteforcing the QR codes until we see a better shape.

I wouldn't call generating a couple of semantically equivalent (but fully valid and 0 error) QR codes and giving each of them as inputs to diffusion model brute forcing. Even the normal AI image generation process often involves some trial and error. Generating a bunch of variants by changing random seed or slightly tweaking prompt keywords and choosing a result which looks the best. Doing multiple attempts with mult…

I often iterate my prompt on a fixed seed and by changing slightly the prompt to get the best results, so that wouldn't works well here.
Post reply on HN