Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
64da8ce
1
Parent(s):
a6a6485
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def control_ui():
|
|
57 |
with gr.Row():
|
58 |
use_inp = gr.Checkbox(label='启用', value=False)
|
59 |
overlay = gr.Checkbox(label='覆盖原图', value=True)
|
60 |
-
inp_img = gr.
|
61 |
inp_str = gr.Slider(label='重绘强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
|
62 |
reuse_img_inp = gr.Button(value='使用上一次生成的图片')
|
63 |
with gr.Row():
|
@@ -105,7 +105,7 @@ def generate(prompt, quality_tags, neg_prompt, seed, scale, width, height, steps
|
|
105 |
|
106 |
|
107 |
def preview_ui():
|
108 |
-
with gr.Blocks(css='#preview_image { height: 100%;}')
|
109 |
image = gr.Image(elem_id='preview_image', interactive=False, type='pil')
|
110 |
info = gr.JSON(value={}, label="Submitted Payload")
|
111 |
return image, info
|
@@ -147,7 +147,7 @@ def ui():
|
|
147 |
inputs=[png_items] + paras,
|
148 |
outputs=paras)
|
149 |
png2main.click(fn=None,
|
150 |
-
|
151 |
inputs=image)
|
152 |
image.change(read_info_from_image, inputs=image, outputs=[info, png_items])
|
153 |
return website
|
|
|
57 |
with gr.Row():
|
58 |
use_inp = gr.Checkbox(label='启用', value=False)
|
59 |
overlay = gr.Checkbox(label='覆盖原图', value=True)
|
60 |
+
inp_img = gr.ImageEditor(label="上传图片", value=None, interactive=True, type="pil", eraser=False, transforms=None, brush='imagemask')
|
61 |
inp_str = gr.Slider(label='重绘强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
|
62 |
reuse_img_inp = gr.Button(value='使用上一次生成的图片')
|
63 |
with gr.Row():
|
|
|
105 |
|
106 |
|
107 |
def preview_ui():
|
108 |
+
with gr.Blocks(css='#preview_image { height: 100%;}'):
|
109 |
image = gr.Image(elem_id='preview_image', interactive=False, type='pil')
|
110 |
info = gr.JSON(value={}, label="Submitted Payload")
|
111 |
return image, info
|
|
|
147 |
inputs=[png_items] + paras,
|
148 |
outputs=paras)
|
149 |
png2main.click(fn=None,
|
150 |
+
js="(x) => { if (x !== null) document.getElementById('client_ui_main-button').click(); return null; }",
|
151 |
inputs=image)
|
152 |
image.change(read_info_from_image, inputs=image, outputs=[info, png_items])
|
153 |
return website
|