radames commited on
Commit
15417c3
1 Parent(s): 3aa0ca8
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -46,7 +46,7 @@ def inference(
46
  controlnet_conditioning_scale: float = 2.0,
47
  strength: float = 0.8,
48
  seed: int = -1,
49
- num_inference_steps: int = 50,
50
  ):
51
  init_image = resize_for_condition_image(init_image, 768)
52
  qrcode_image = resize_for_condition_image(qrcode_image, 768)
@@ -56,16 +56,16 @@ def inference(
56
  out = pipe(
57
  prompt=prompt,
58
  negative_prompt=negative_prompt,
59
- image=init_image, # type: ignore
60
  control_image=qrcode_image, # type: ignore
61
- width=768, # type: ignore
62
- height=768, # type: ignore
63
- guidance_scale=guidance_scale,
64
- controlnet_conditioning_scale=controlnet_conditioning_scale, # type: ignore
65
  generator=generator,
66
- strength=strength,
67
  num_inference_steps=num_inference_steps,
68
- ) # type: ignore
69
  return out.images[0]
70
 
71
 
@@ -73,7 +73,7 @@ with gr.Blocks() as blocks:
73
  gr.Markdown(
74
  """# AI QR Code Generator
75
 
76
- model by: https://huggingface.co/DionTimmer/controlnet_qrcode-control_v1p_sd15
77
  """
78
  )
79
 
 
46
  controlnet_conditioning_scale: float = 2.0,
47
  strength: float = 0.8,
48
  seed: int = -1,
49
+ num_inference_steps: int = 30,
50
  ):
51
  init_image = resize_for_condition_image(init_image, 768)
52
  qrcode_image = resize_for_condition_image(qrcode_image, 768)
 
56
  out = pipe(
57
  prompt=prompt,
58
  negative_prompt=negative_prompt,
59
+ image=init_image,
60
  control_image=qrcode_image, # type: ignore
61
+ width=768,
62
+ height=768,
63
+ guidance_scale=float(guidance_scale),
64
+ controlnet_conditioning_scale=float(controlnet_conditioning_scale),
65
  generator=generator,
66
+ strength=float(strength),
67
  num_inference_steps=num_inference_steps,
68
+ )
69
  return out.images[0]
70
 
71
 
 
73
  gr.Markdown(
74
  """# AI QR Code Generator
75
 
76
+ model: https://huggingface.co/DionTimmer/controlnet_qrcode-control_v1p_sd15
77
  """
78
  )
79