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.
You'd need to inject a lot of noise (and different kinds of noise, and different implementations of QR decoders) before you present the image to the QR decode, to make sure you are still producing a robust QR code.
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.