Fake-QRcode ControlNet

These are ControlNet checkpoints trained on runwayml/stable-diffusion-v1-5 to generate recognizable AIGC QRcode image.

Model Details

Details will be added soon...

Use with diffusers

See the snippet below for usage with diffusers:

import cv2
import numpy as np
import torch
import os, sys

from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, AutoencoderKL, EulerAncestralDiscreteScheduler
from PIL import Image

controlnet = ControlNetModel.from_pretrained("ghoskno/Fake-Qrcode")
pipe = StableDiffusionControlNetPipeline.from_pretrained(
  "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
)
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
pipe.enable_model_cpu_offload()

generator = torch.manual_seed(412052000)

qrcode = cv2.imread('path_to_qrcode.png')
qrcode = cv2.resize(255 - qrcode, (1024, 1024))

image = pipe(
  "Blooming chinese chrysanthemum, green leaves growing wantonly, flowers, Complex patterns on the border, Masterpiece Art, Beauty, 8K,  Unreal Engine",
  Image.fromarray(qrcode),
  generator=generator,
  num_inference_steps=37,
  guidance_scale=7,
  controlnet_conditioning_scale=1.85
).images[0]

Some examples

input qrcode image

prompt: Blooming chinese chrysanthemum, green leaves growing wantonly, flowers, Complex patterns on the border, Masterpiece Art, Beauty, 8K, Unreal Engine

prompt: Plum blossoms in the snow, pink stamens, green leaves and branches growing wantonly, flowers, Complex patterns on the border, Masterpiece Art, Beauty, 8K, Unreal Engine

Limitations and Bias

  • No strict control by input prompt
  • Sometimes generate confusion or generate unrecognizable QRcode images
Downloads last month
12
Safetensors
Model size
0.4B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support