Boboiazumi commited on
Commit
8d1cf5a
1 Parent(s): 9441029

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -112,6 +112,7 @@ def generate(
112
  add_quality_tags: bool = True,
113
  isImg2Img: bool = True,
114
  img_path: str= "",
 
115
 
116
  progress=gr.Progress(track_tqdm=True),
117
  ):
@@ -185,6 +186,7 @@ def generate(
185
  width=img_width,
186
  height=img_height,
187
  image=img,
 
188
  guidance_scale=guidance_scale,
189
  num_inference_steps=num_inference_steps,
190
  generator=generator,
@@ -232,6 +234,7 @@ def generate(
232
  width=img_width,
233
  height=img_height,
234
  image=img,
 
235
  guidance_scale=guidance_scale,
236
  num_inference_steps=num_inference_steps,
237
  generator=generator,
@@ -319,10 +322,16 @@ with gr.Blocks(css="style.css", theme="NoCrypt/miku@1.2.1") as demo:
319
  label="Img2Img", value=False
320
  )
321
  image = gr.Image(
322
- label="Image Input",
323
- visible=False,
324
  type="filepath",
325
- sources=["upload", "webcam", "clipboard"]
 
 
 
 
 
 
 
326
  )
327
  with gr.Accordion(label="Quality Tags", open=True):
328
  add_quality_tags = gr.Checkbox(
@@ -485,6 +494,7 @@ with gr.Blocks(css="style.css", theme="NoCrypt/miku@1.2.1") as demo:
485
  add_quality_tags,
486
  isImg2Img,
487
  image,
 
488
  ],
489
  outputs=[result, gr_metadata],
490
  api_name="run",
 
112
  add_quality_tags: bool = True,
113
  isImg2Img: bool = True,
114
  img_path: str= "",
115
+ img2img_strength: float=0.65,
116
 
117
  progress=gr.Progress(track_tqdm=True),
118
  ):
 
186
  width=img_width,
187
  height=img_height,
188
  image=img,
189
+ strength=img2img_strength,
190
  guidance_scale=guidance_scale,
191
  num_inference_steps=num_inference_steps,
192
  generator=generator,
 
234
  width=img_width,
235
  height=img_height,
236
  image=img,
237
+ strength=img2img_strength,
238
  guidance_scale=guidance_scale,
239
  num_inference_steps=num_inference_steps,
240
  generator=generator,
 
322
  label="Img2Img", value=False
323
  )
324
  image = gr.Image(
325
+ sources=["upload", "webcam", "clipboard"],
 
326
  type="filepath",
327
+ visible=False,
328
+ label="Choose Image",
329
+ )
330
+ img2img_strength = gr.Slider(
331
+ minimum=0.05,
332
+ maximum=1,
333
+ step=0.05,
334
+ value=0.65
335
  )
336
  with gr.Accordion(label="Quality Tags", open=True):
337
  add_quality_tags = gr.Checkbox(
 
494
  add_quality_tags,
495
  isImg2Img,
496
  image,
497
+ img2img_strength
498
  ],
499
  outputs=[result, gr_metadata],
500
  api_name="run",