Boboiazumi commited on
Commit
735ce25
1 Parent(s): cad8a48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -81,6 +81,8 @@ def generate(
81
  upscaler_strength: float = 0.55,
82
  upscale_by: float = 1.5,
83
  add_quality_tags: bool = True,
 
 
84
  progress=gr.Progress(track_tqdm=True),
85
  ):
86
  generator = utils.seed_everything(seed)
@@ -222,32 +224,14 @@ with gr.Blocks(css="style.css", theme="NoCrypt/[email protected]") as demo:
222
  )
223
  with gr.Row():
224
  with gr.Column(scale=2):
225
- with gr.Tab("Txt2img"):
226
  with gr.Group():
227
- prompt = gr.Text(
228
- label="Prompt",
229
- max_lines=5,
230
- placeholder="Enter your prompt",
231
- )
232
- negative_prompt = gr.Text(
233
- label="Negative Prompt",
234
- max_lines=5,
235
- placeholder="Enter a negative prompt",
236
  )
237
- with gr.Accordion(label="Quality Tags", open=True):
238
- add_quality_tags = gr.Checkbox(
239
- label="Add Quality Tags", value=True
240
- )
241
- quality_selector = gr.Dropdown(
242
- label="Quality Tags Presets",
243
- interactive=True,
244
- choices=list(quality_prompt.keys()),
245
- value="Standard v3.1",
246
- )
247
- with gr.Tab("Img2Img"):
248
- with gr.Group():
249
  image = gr.Image(
250
  label="Image Input",
 
251
  )
252
  prompt = gr.Text(
253
  label="Prompt",
@@ -374,6 +358,13 @@ with gr.Blocks(css="style.css", theme="NoCrypt/[email protected]") as demo:
374
  queue=False,
375
  api_name=False,
376
  )
 
 
 
 
 
 
 
377
  aspect_ratio_selector.change(
378
  fn=lambda x: gr.update(visible=x == "Custom"),
379
  inputs=aspect_ratio_selector,
 
81
  upscaler_strength: float = 0.55,
82
  upscale_by: float = 1.5,
83
  add_quality_tags: bool = True,
84
+ isImg2Img: bool = True,
85
+
86
  progress=gr.Progress(track_tqdm=True),
87
  ):
88
  generator = utils.seed_everything(seed)
 
224
  )
225
  with gr.Row():
226
  with gr.Column(scale=2):
227
+ with gr.Tab("Input"):
228
  with gr.Group():
229
+ isImg2Img = gr.Checkbox(
230
+ label="Img2Img", value=False
 
 
 
 
 
 
 
231
  )
 
 
 
 
 
 
 
 
 
 
 
 
232
  image = gr.Image(
233
  label="Image Input",
234
+ visible=False
235
  )
236
  prompt = gr.Text(
237
  label="Prompt",
 
358
  queue=False,
359
  api_name=False,
360
  )
361
+ isImg2Img.change(
362
+ fn=lambda x: [gr.update(visible=x)],
363
+ inputs=isImg2Img,
364
+ outputs=[image],
365
+ queue=False,
366
+ api_name=False,
367
+ )
368
  aspect_ratio_selector.change(
369
  fn=lambda x: gr.update(visible=x == "Custom"),
370
  inputs=aspect_ratio_selector,