CivArchive
    Controlnet QR Pattern (QR Codes) - v2_sd15
    Preview 1441936
    Preview 1451139
    Preview 1441933
    Preview 1441937
    Preview 1441932
    Preview 1456087

    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 (28)

    rostamianiJul 7, 2023
    CivitAI

    I cannot scan your examples using my phone. Do I need a special qr scanner?

    Nacholmo
    Author
    Jul 7, 2023· 1 reaction

    With Google lens it's scan, people use the iPhone one and the wechat one also. Try not holding the phone too close

    haresh121Jul 8, 2023
    CivitAI

    Hi @nacholmo,

    Is there any way to use the model in Huggingface Controlnet or in the StableDiffusionControlnetPipeline ?

    If you have any idea please let me know.

    And I wanted to know how you've trained the controlnet model. If you can share any resources pointing to the same, it would be helpful.

    Nacholmo
    Author
    Jul 9, 2023

    I think the easiest way to do so it's with the diffusers version, in my huggingface repo I have the diffusers checkpoints also, I recommend the 9500.

    And about the training I learned from the example in diffusers, the rest was trial and error, this is the link:
    https://github.com/huggingface/diffusers/tree/main/examples/controlnet

    haresh121Jul 10, 2023

    Ah, Got it !!
    Thanks for the information.

    So you haven't trained on a paired set of control images and the images generated using the control !!

    Just a random set of QR codes and the images from captioning dataset, right ?

    Nacholmo
    Author
    Jul 14, 2023

    @haresh121 As I wrote in another comment, I didn't use any qr in the dataset.
    I only masked 25% of the colors closest to black and white.
    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.

    doublematAug 19, 2023

    @Nacholmo Does that mean we should be blurring the qr codes when using this model?

    Nacholmo
    Author
    Aug 20, 2023· 1 reaction

    @doublemat I mean, you can experiment with that, but the blur that I use in the dataset its very small, 2 pixel radius

    1403726Jul 11, 2023· 13 reactions
    CivitAI

    This is quite an interesting system to be honest. I also found a way to make them consistently scannable almost constantly.

    Use 2 instances of Control Net.

    1a) In the first use Preprocessor Inpaint_Global_Harmonious and model control_v1p_sd15_brightness
    1b) Control Weight 0.35, Don't touch Starting or Ending Control Step.

    2a) In the 2nd no preprocessor and the QRpattern Model.
    2b) Control Weight 1.0, Starting Control Step 0.2, Ending Control Step 0.8


    3) Just do you for the rest with your prompt as usual (I suggest using a LORA for extra Details)

    This will ensure that that the QR is almost always completely scannable from the first try, even the non-hires. Fix ones.

    p4ntalaimonJul 13, 2023

    Hi Mitheldreas! Thank you for the steps! Is there an easy way to run 2 instances of the same extension like Control Net? Thanks again!

    1403726Jul 13, 2023· 1 reaction

    @liffairy843 You can go to Settings >>> ControlNet >>> Multi ControlNet and then choose how many you are going to need (usually you will rarely use more then 2) then save the changes and fully restart A1111 from then on you will always boot it up with 2 instances of ControlNet.

    LyonnelJul 14, 2023
    CivitAI

    I think you should add "sd15" in the name of the files because the "v20", alone, is confusing

    Nacholmo
    Author
    Jul 14, 2023

    Should be changed, civitai didn't pick the name from the actual file, it pick up the version name

    blackvizard666Jul 14, 2023
    CivitAI

    I am trying to run this on my Macbook Air M2 set up.

    It is showing me this error:   RuntimeError: Placeholder storage has not been allocated on MPS device!

    Nacholmo
    Author
    Jul 14, 2023

    Seems like a pytorch issue related to the M1 and M2, unfortunately I do not own any of these devices to try to reproduce the error. If you find a solution, share it here in case may help other people!

    AbassidsJul 17, 2023
    CivitAI

    Hello, where to place this checkpoint file?

    Nacholmo
    Author
    Jul 18, 2023· 2 reactions

    In models/ControlNet

    kalmmadJul 17, 2023· 1 reaction
    CivitAI

    hi is there a colab to use this

    kalmmadJul 21, 2023

    @Nacholmo thank you I love you@Nacholmo @Nacholmo @Nacholmo @Nacholmo @Nacholmo @Nacholmo @Nacholmo @Nacholmo @Nacholmo 

    dacianJul 24, 2023
    CivitAI

    anyone hows can I get the preview of this controlnet (not using the webui)

    KriskrrrJul 31, 2023
    CivitAI

    Can this used by img2img?What I really want is the picture which highly related to my favorite picture.Thanks

    Bjoey99Aug 3, 2023
    CivitAI

    If this works it would be such a unique concept

    katiekatSep 25, 2023· 3 reactions
    CivitAI

    ive been playing with this all day

    took a while to get it dialed in and stuff b ut it works SO good and its so freaking cool. thank you so much for the upload

    katiekatSep 27, 2023· 3 reactions
    CivitAI

    this model works really well for making the optical illusion type renders. but im wondering if there is a controlnet model that is specialized in making the optical illusion type renders, and not just as a side effect of being able to incorporate qr codes?

    Nacholmo
    Author
    Oct 4, 2023· 1 reaction

    Many people use qr monsters for that purpose
    https://civitai.com/models/111006/qr-code-monster

    2667164034847Nov 30, 2023
    CivitAI

    can you share about how to train the model?

    Nacholmo
    Author
    Dec 1, 2023

    I learned from the example in diffusers, the rest was trial and error, this is the link:
    https://github.com/huggingface/diffusers/tree/main/examples/controlnet

    Controlnet
    SD 1.5

    Details

    Downloads
    26,983
    Platform
    CivitAI
    Platform Status
    Available
    Created
    7/7/2023
    Updated
    5/13/2026
    Deleted
    -

    Available On (1 platform)

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