CivArchive
    Controlnet QR Pattern (QR Codes) - v1_sd15
    Preview 1160663
    Preview 1199725
    Preview 1180167
    Preview 1160653
    Preview 1200889

    Controlnet model for use in qr codes

    Conditioning only 25% of the pixels closest to black and the 25% closest to white.

    Move the model and the .yaml to models/ControlNet

    IMPORTANT:
    
    Don't expect the images to be scannable at first, try to generate a lot of images and adjust the parameters. The recommended parameters are only recommendations, many images require different values.
    
    Recommended parameters:
    
    model: meinamix v8
    Steps: 30, 
    Size: 1024x1024,
    ControlNet:
    preprocessor: none,
    weight: 1,
    starting/ending: (0, 0.8),
    control mode: Balanced
    
    ADetailer steps: 36
    
    I strongly recommend using the ADetailer extension to recover details from character faces.
    

    Better results with a QR with rounded edges from this site:

    https://qrcode.antfu.me/

    Complete guide by Antfu:

    https://antfu.me/posts/ai-qrcode-101

    Fruit store by @.pos in discord (With the v1)


    QR Pattern and QR Pattern sdxl were created as free community resources by an Argentinian university student. Training AI models requires money, which can be challenging in Argentina's economy.

    If you find these models helpful and would like to empower an enthusiastic community member to keep creating free open models, I humbly welcome any support you can offer through ko-fi here

    https://ko-fi.com/nacholmo

    Description

    FAQ

    Comments (52)

    SpliffnColaJun 16, 2023
    CivitAI

    Useless if it's archived and unable to be downloaded. Why even upload this??

    Nacholmo
    Author
    Jun 16, 2023· 1 reaction

    @andylehere Its ready now, literally 5min since I press archive by accident lmao

    SpliffnColaJun 16, 2023

    @Sundae Thanks for the quick reply.

    Nacholmo
    Author
    Jun 16, 2023· 4 reactions

    For ethical concerns I decided not to make the model public (just kidding).

    R10LJun 16, 2023· 2 reactions
    CivitAI

    Can you give more details of how you created the images?

    Nacholmo
    Author
    Jun 16, 2023· 2 reactions
    Steps: 40, Size: 920x920, ControlNet: preprocessor: none, weight: 1, starting/ending: (0, 0.75), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced Play arround with the starting step, 0 to 0.25 its the sweetspot, if it start at 0 the qr has priority, the higher you raise them, the stronger the prompt gets
    Nacholmo
    Author
    Jun 16, 2023

    If you mean the dotted qrcode I use this page https://qrbtf.com

    Select this option:

    https://i.imgur.com/5LFWUMD.png

    Elliryk2Jun 16, 2023

    @Sundae do you put the qr code on a blank canva to have this look ?

    Nacholmo
    Author
    Jun 16, 2023

    @Elliryk2 All of the images are genereted using the unmodified qr image as come from the site that I link early. Black QR, white background. But it should work with other colors in the qr shape too!

    Elliryk2Jun 16, 2023

    @Sundae don't mind I forgot to put the new QR image 😅😁

    MigelAngelECJun 16, 2023· 3 reactions
    CivitAI

    How to use this on Invoke IA ?

    waifu_aisJun 16, 2023

    +1

    Nacholmo
    Author
    Jun 16, 2023

    I don't know if Invoke has support for controlnet, let me check when I get home

    Nacholmo
    Author
    Jun 16, 2023

    It looks like you will have to wait until the next major release of invoke ai to get support for controlnet.

    https://github.com/invoke-ai/InvokeAI/issues/3319

    QuestionQuestJul 11, 2023

    @Nacholmo InvokeAI has recently released a beta update that changes a lot of things, including adding support for ControlNets. Thus far I have been unsuccessful however getting your Controlnet to run on it as the files from huggingface and here have not worked. This might be due to the fact that InvokeAI seems to rely on both a config.json file and a .safetensors file but I'm not really sure. It would be good if you could look into this (I will be as well)

    QuestionQuestJul 11, 2023

    So it turns out it's not working because the existing controlnets in InvokeAI are hardcoded in and controlnet modularity is not yet available. As a result, you may not have to change anything about your controlnet as it's an InvokeAI problem for now. I eagerly await the update that lets me use your controlnet and am assisting them with bug testing

    Anton_KJun 16, 2023
    CivitAI

    Do you think how to make img2img work? I have another finished image and I want to get a QR code from it

    Nacholmo
    Author
    Jun 16, 2023

    It needs to start en a very early step where the image is blurry to work decently, try cranking up the denoising strength and maybe set controlnet in something like starting/ending: (0.35, 1), to keep the image structure to some degree, but the image it's going to change a lot.
    TLDR: Its not a good model for img2img

    Anton_KJun 16, 2023

    @Nacholmo Thanks you

    mnemicJun 18, 2023
    CivitAI

    I played around a bit to try and get similar results for a barcode, but I couldn't get anything that worked well.

    Have you tried anything with that yet @nacholmo?

    Nacholmo
    Author
    Jun 18, 2023

    With lines too tinned and without error correction I see it very difficult, if the qr can work it is because of its redundant information system. But I don't think it's impossible, if you make it work, please share the results

    rkfgJun 18, 2023
    CivitAI

    Nice model, I found it easier to make a working code with it than with another model while still keeping the artwork visible. Can you please describe the workflow for making the dataset? Did you generate images and overlaid the codes on top or what were the tricks?

    Nacholmo
    Author
    Jun 18, 2023· 1 reaction

    I dont use any qr in the dataset! As I wrote in the description I only isolated 15% of the colors closest to black. More precisely I first applied filters like gaussian blur and smoothing; then converted a copy to grayscale, to calculate the distance to black of the predominant color of the image, with that information I created a mask to which I applied a feather to the content of the mask on a white background and another blur

    rkfgJun 18, 2023

    @Nacholmo Thanks, very interesting! So you first made (or scrapped) random images with descriptions, then created a mask from them using the procedure you described, then used the mask as conditioning? If I understand it correctly, the images conditioned themselves, it looks backwards but the result is great! Very clever idea.

    On a second thought, I believe most CN training is like that, only the basic example with color circles is forward (conditioning is created first, expected result is made from it).

    Nacholmo
    Author
    Jun 18, 2023

    @rkfg You are right! Thats the way most controlnet are trained, the first thing created is most of the time is the preprocessor, and then the preprocessor is used to create the dataset

    rkfgJun 18, 2023

    @Nacholmo Awesome! I see that the model doesn't work well on lower resolutions such as 512x512, perhaps because there's not enough space. So you only isolated black and similar dark colors, what if you also isolated white and used some other color (red?) as "neutral"? That way it'd be possible to not only condition the dark spots but also white and leave the rest at the base model's discretion. Of course, the regular QRs would need preprocessing such as making the so called quiet zone (the border) red. But then the model might start working on lower res.

    EDIT: oh wait, managed to make it work. But it needs the weight to be 2, otherwise the code is too bleak.

    artcollectormania8888522Jun 19, 2023
    CivitAI

    Where I have to put the file: "controlnetQRPatternQR_v10.safetensors"??

    Nacholmo
    Author
    Jun 19, 2023

    In stable-diffusion-webui\extensions\sd-webui-controlnet\models if you are using the default automatic1111, or in models\ControlNet in the vlad fork

    romori2261Jun 19, 2023
    CivitAI

    Me and another 2 people tried to use it and can't make a proper image, especially not as it shown in the examples.
    We tried the reccomended and not recommended settings, but nothing gave the effect... what do we miss?

    Someone suggested that it's a loopback few times until it gave the specific effect, but you haven't mention it in any of the tutorials in comments or HF

    And thank you for the model :)

    Nacholmo
    Author
    Jun 19, 2023

    Can you show me results you have in discord? nacholmo its my username, or upload it to imgur and post the links here if you dont want to add me

    Nacholmo
    Author
    Jun 19, 2023· 1 reaction

    Issue addressed in DMs and a new tip was added to the model description

    SelosJun 21, 2023
    CivitAI

    Hi, If I use a different generation size than 920 x 920, can I still obtain readable QR codes? The thing is, my GPU doesn't support using that resolution. For some reason, I can use 960 x 960 but not 920. However, I haven't obtained readable results, and I'm not sure if it's just a matter of mishandling the tools or if it's optimized specifically for 920 x 920 generations. Thank you for the model regardless.

    Nacholmo
    Author
    Jun 21, 2023

    You can use other resolution! my recommendation was 920x920 only because the default 512 it was to low to generate enough details. About if a code can be scanned, are you using a long link? That seems to be one of the reasons why people can get it scannable. And the parameters in the model description are just an example, maybe your image needs something different try tweaking it, and generate a bunch of it, as more images you generate more probably one be as the same time cooler and scannable, take more time with some prompts, make sure to tweak it too

    antfuJun 30, 2023· 14 reactions
    CivitAI

    Thanks a lot for the model. It was super fun!

    I wrote two blog posts about how I use this model to create QR images, hope you can find it useful:

    - https://antfu.me/posts/ai-qrcode

    - https://antfu.me/posts/ai-qrcode-refine

    Nacholmo
    Author
    Jun 30, 2023· 2 reactions

    Great! I added it to the model description

    antfuJun 30, 2023

    @Nacholmo Wow, thanks!

    zuzanaaviel538Jul 1, 2023· 1 reaction

    @antfu your guide is amazing!

    In your instructions to your guide @anfu, you say to put the controlnet files in to "stable-diffusion-webui/models/ControlNext". Instead it should be in the"stable-diffusion-webui\extensions\sd-webui-controlnet\models". Both folders have a controlnet folder inside them so it makes sense to get them confused.

    I am blown away at this controlnet by @Nacholmo and how well written your guide is @antfu.

    Well done!

    antfuJul 1, 2023· 1 reaction

    @zuzanaaviel538 What's the difference between those two folders? I found that putting under models would just work (and it's what I am using)

    zuzanaaviel538Jul 1, 2023

    @antfu I am not sure I was just following the instructions from github on Mikubill. Those were his instructions. We also may be using a different Webui. These folders may do the same thing. I am more than happy to delete the comment above if they do the same thing. I just wanted to point it out incase someone got confused.

    zuzanaaviel538Jul 1, 2023

    I see where to put the .yaml file but my download didnt include a .yaml. How do I generate one or where do I get it?

    Nacholmo
    Author
    Jul 1, 2023

    @zuzanaaviel538

    The yaml is the config file, look under the blue download button on this page, it looks like this when you click on it.

    https://imgur.com/a/YwspS2p

    The controlnet models folder depends on the version of the webui that are you using, if you have the default automatic1111 up to date,

    its stable-diffusion-webui\extensions\sd-webui-controlnet\models

    move the yaml and the models with the same name there.

    Some versions (like the vlad fork) also accept:

    stable-diffusion-webui\models\ControlNet

    Anyway in the settings should be an option to change the models path, but I recomment just moving together the model and config files to extensions\sd-webui-controlnet\models, because work in most cases.

    huangzhihua163246Jul 11, 2023

    谢谢!Thank you.

    kingsrt666Jul 1, 2023
    CivitAI

    ???????这啥问题呀

    RuntimeError: "log_vml_cpu" not implemented for 'Half'

    Time taken: 0.01s

    Torch active/reserved: 9/26 MiB, Sys VRAM: 1312/12282 MiB (10.68%)

    Nacholmo
    Author
    Jul 1, 2023

    First time that I see that error. I was unable to reproduce the error but, in reddit some user commented that adding "--precision full --no half" to the webui parameters fix this issue. Let me know if it helps

    PaulmemJul 3, 2023
    CivitAI

    Hello creator, after I put the model file and additional files in the controlnet folder, how do I know that the model loaded successfully? I've used it many times without generating the QR code look

    PaulmemJul 3, 2023

    Should the model files and additional files be placed together in the extensions\sd-webui-controlnet\models directory?

    Dora_UTJul 3, 2023

    @Paulmem You need to enable controlNet. 一开始我也是你这样

    PaulmemJul 3, 2023

    @H3clikejava xdddd yep i forgot to enable it. My bad

    zard999Jul 4, 2023
    CivitAI

    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown

    Hello, what is the reason for this error?

    Nacholmo
    Author
    Jul 4, 2023

    Seems like a problem with your installation maybe, you only get that error with this model?

    ros_implonJul 4, 2023
    CivitAI

    Hi. Wanted to get an idea how have you created the dataset for training the controlnet. From what I understood, we would need an QR artwork as well in the training data. BTW great model.

    Nacholmo
    Author
    Jul 4, 2023· 2 reactions

    I didn't use any qr in the dataset!
    As I wrote in the description I only masked 15% of the colors closest to black.
    More precisely I first applied filters like gaussian blur and smoothing;
    then converted a copy to grayscale, to calculate the distance to black of the predominant color of the image,
    with that information I created a mask to which I applied a feather to the content of the mask on a white background.
    And last apply the filters one more time.

    Controlnet
    SD 1.5

    Details

    Downloads
    4,936
    Platform
    CivitAI
    Platform Status
    Available
    Created
    6/15/2023
    Updated
    5/14/2026
    Deleted
    -

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.