P01yH3dr0n commited on
Commit
b46f0d0
1 Parent(s): 963c0c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -46,6 +46,19 @@ def control_ui():
46
  with gr.Row():
47
  width = gr.Slider(label="Width", value=1024, minimum=64, maximum=2048, step=64)
48
  height = gr.Slider(label="Height", value=1024, minimum=64, maximum=2048, step=64)
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  with gr.Row():
50
  with gr.Column():
51
  with gr.Accordion('Advanced Gen Setting', open=False):
@@ -63,22 +76,9 @@ def control_ui():
63
  with gr.Row():
64
  dyn_threshold = gr.Checkbox(False, label="Dynamic Thresholding")
65
  cfg_rescale = gr.Slider(0, 1, 0, step=0.01, label="CFG rescale")
66
- with gr.Accordion('风格迁移', open=False):
67
- ref_image = gr.Image(label="上传图片", value=None, sources=["upload"], interactive=True, type="pil")
68
- info_extract = gr.Slider(label='参考信息提取', value=1, minimum=0, maximum=1, step=0.1)
69
- ref_str = gr.Slider(label='参考强度', value=0.6, minimum=0, maximum=1, step=0.1)
70
- reuse_img_vibe = gr.Button(value='使用上一次生成的图片')
71
- with gr.Accordion('蒙版重绘', open=False):
72
- with gr.Row():
73
- use_inp = gr.Checkbox(label='启用', value=False)
74
- overlay = gr.Checkbox(label='覆盖原图', value=True)
75
- inp_img = gr.ImageEditor(label="上传图片", value=None, sources=["upload"], interactive=True, type="pil", eraser=False, transforms=None, brush="imagemask")
76
- inp_str = gr.Slider(label='重绘强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
77
- reuse_img_inp = gr.Button(value='使用上一次生成的图片')
78
  with gr.Column():
79
  gr.Textbox(value=get_count, label='Usage count', every=10)
80
  save = gr.Checkbox(value=False, label='Always save all generated images', visible=False)
81
-
82
  gen_btn = gr.Button(value="Generate", variant="primary")
83
  rand_seed.click(fn=lambda: -1, inputs=None, outputs=seed)
84
  width.change(lambda w, h: h if w*h<=1024*1024 else (1024*1024//w//64)*64, [width, height], height)
@@ -120,7 +120,7 @@ def main_ui():
120
  gen_btn.click(generate, paras + [others[0], others[4]], [image, info])
121
  others[2].click(lambda o, s: o if len(s) == 0 else s['parameters']['seed'], inputs=[paras[3], info], outputs=paras[3])
122
  others[3].click(lambda i: i, inputs=image, outputs=paras[14])
123
- others[5].click(lambda i: gr.ImageEditor(value=i), inputs=image, outputs=paras[17])
124
  return page, paras[:14]
125
 
126
 
@@ -146,7 +146,7 @@ def ui():
146
  inputs=[png_items] + paras,
147
  outputs=paras)
148
  png2main.click(fn=None,
149
- js="(x) => { if (x !== null) document.getElementById('client_ui_main-button').click(); "
150
  "return null; }",
151
  inputs=image)
152
  image.change(read_info_from_image, inputs=image, outputs=[info, png_items])
 
46
  with gr.Row():
47
  width = gr.Slider(label="Width", value=1024, minimum=64, maximum=2048, step=64)
48
  height = gr.Slider(label="Height", value=1024, minimum=64, maximum=2048, step=64)
49
+ with gr.Coloumn():
50
+ with gr.Accordion('风格迁移', open=False):
51
+ ref_image = gr.Image(label="上传图片", value=None, sources=["upload"], interactive=True, type="pil")
52
+ info_extract = gr.Slider(label='参考信息提取', value=1, minimum=0, maximum=1, step=0.1)
53
+ ref_str = gr.Slider(label='参考强度', value=0.6, minimum=0, maximum=1, step=0.1)
54
+ reuse_img_vibe = gr.Button(value='使用上一次生成的图片')
55
+ with gr.Accordion('蒙版重绘', open=False):
56
+ with gr.Row():
57
+ use_inp = gr.Checkbox(label='启用', value=False)
58
+ overlay = gr.Checkbox(label='覆盖原图', value=True)
59
+ inp_img = gr.ImageEditor(label="上传图片", value=None, sources=["upload"], interactive=True, type="pil", eraser=False, transforms=None, brush="imagemask")
60
+ inp_str = gr.Slider(label='重绘强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
61
+ reuse_img_inp = gr.Button(value='使用上一次生成的图片')
62
  with gr.Row():
63
  with gr.Column():
64
  with gr.Accordion('Advanced Gen Setting', open=False):
 
76
  with gr.Row():
77
  dyn_threshold = gr.Checkbox(False, label="Dynamic Thresholding")
78
  cfg_rescale = gr.Slider(0, 1, 0, step=0.01, label="CFG rescale")
 
 
 
 
 
 
 
 
 
 
 
 
79
  with gr.Column():
80
  gr.Textbox(value=get_count, label='Usage count', every=10)
81
  save = gr.Checkbox(value=False, label='Always save all generated images', visible=False)
 
82
  gen_btn = gr.Button(value="Generate", variant="primary")
83
  rand_seed.click(fn=lambda: -1, inputs=None, outputs=seed)
84
  width.change(lambda w, h: h if w*h<=1024*1024 else (1024*1024//w//64)*64, [width, height], height)
 
120
  gen_btn.click(generate, paras + [others[0], others[4]], [image, info])
121
  others[2].click(lambda o, s: o if len(s) == 0 else s['parameters']['seed'], inputs=[paras[3], info], outputs=paras[3])
122
  others[3].click(lambda i: i, inputs=image, outputs=paras[14])
123
+ others[5].click(lambda i: i, inputs=image, outputs=paras[17])
124
  return page, paras[:14]
125
 
126
 
 
146
  inputs=[png_items] + paras,
147
  outputs=paras)
148
  png2main.click(fn=None,
149
+ _js="(x) => { if (x !== null) document.getElementById('client_ui_main-button').click(); "
150
  "return null; }",
151
  inputs=image)
152
  image.change(read_info_from_image, inputs=image, outputs=[info, png_items])