Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
a75ae23
1
Parent(s):
c34bc06
del share buttons
Browse files- app.py +3 -3
- images_history.py +2 -2
- utils.py +0 -3
app.py
CHANGED
@@ -55,7 +55,7 @@ def control_ui():
|
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
with gr.Accordion('风格迁移', open=False):
|
58 |
-
ref_images = gr.Gallery(label="上传单(多)张图片", format="png", value=None, interactive=True, type="pil")
|
59 |
info_extracts = gr.State([])
|
60 |
ref_strs = gr.State([])
|
61 |
@gr.render(inputs=ref_images, triggers=[ref_images.upload, ref_images.change])
|
@@ -80,13 +80,13 @@ def control_ui():
|
|
80 |
ref_images.upload(lambda l: ([], []) if l is None else ([1]*len(l), [0.6]*len(l)), inputs=ref_images, outputs=[info_extracts, ref_strs])
|
81 |
with gr.Accordion('附加输入', open=False):
|
82 |
with gr.Tab('图生图') as i2i:
|
83 |
-
i2i_image = gr.Image(label="上传图片", value=None, sources=["upload", "clipboard", "webcam"], interactive=True, type="pil")
|
84 |
i2i_str = gr.Slider(label='去噪强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
|
85 |
i2i_noise = gr.Slider(label='噪声', value=0, minimum=0, maximum=1, step=0.1)
|
86 |
reuse_img_i2i = gr.Button(value='使用上一次生成的图片')
|
87 |
with gr.Tab('局部重绘') as inp:
|
88 |
overlay = gr.Checkbox(label='覆盖原图', value=True)
|
89 |
-
inp_img = gr.ImageMask(label="上传图片", value=None, sources=["upload", "clipboard", "webcam"], interactive=True, type="pil", eraser=False, transforms=None, brush=gr.Brush(colors=['#FFFFFF'], color_mode='fixed'), layers=False)
|
90 |
reuse_img_inp = gr.Button(value='使用上一次生成的图片')
|
91 |
selection = gr.Radio(choices=['i2i', 'inp'], value='i2i', visible=False)
|
92 |
with gr.Row():
|
|
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
with gr.Accordion('风格迁移', open=False):
|
58 |
+
ref_images = gr.Gallery(label="上传单(多)张图片", format="png", value=None, interactive=True, type="pil", show_share_button=False)
|
59 |
info_extracts = gr.State([])
|
60 |
ref_strs = gr.State([])
|
61 |
@gr.render(inputs=ref_images, triggers=[ref_images.upload, ref_images.change])
|
|
|
80 |
ref_images.upload(lambda l: ([], []) if l is None else ([1]*len(l), [0.6]*len(l)), inputs=ref_images, outputs=[info_extracts, ref_strs])
|
81 |
with gr.Accordion('附加输入', open=False):
|
82 |
with gr.Tab('图生图') as i2i:
|
83 |
+
i2i_image = gr.Image(label="上传图片", value=None, sources=["upload", "clipboard", "webcam"], interactive=True, type="pil", show_share_button=False)
|
84 |
i2i_str = gr.Slider(label='去噪强度', value=0.7, minimum=0, maximum=0.99, step=0.01)
|
85 |
i2i_noise = gr.Slider(label='噪声', value=0, minimum=0, maximum=1, step=0.1)
|
86 |
reuse_img_i2i = gr.Button(value='使用上一次生成的图片')
|
87 |
with gr.Tab('局部重绘') as inp:
|
88 |
overlay = gr.Checkbox(label='覆盖原图', value=True)
|
89 |
+
inp_img = gr.ImageMask(label="上传图片", value=None, sources=["upload", "clipboard", "webcam"], interactive=True, type="pil", eraser=False, transforms=None, brush=gr.Brush(colors=['#FFFFFF'], color_mode='fixed'), layers=False, show_share_button=False)
|
90 |
reuse_img_inp = gr.Button(value='使用上一次生成的图片')
|
91 |
selection = gr.Radio(choices=['i2i', 'inp'], value='i2i', visible=False)
|
92 |
with gr.Row():
|
images_history.py
CHANGED
@@ -61,14 +61,14 @@ def img_history_ui(tab):
|
|
61 |
page_index = gr.Number(value=1, label="页码", precision=0)
|
62 |
next_page = gr.Button('下一页')
|
63 |
end_page = gr.Button('末尾页')
|
64 |
-
history_gallery = gr.Gallery(show_label=False, columns=6, height=1024)
|
65 |
with gr.Column(scale=1):
|
66 |
info = gr.HTML()
|
67 |
items = gr.JSON(value=None, visible=False)
|
68 |
selected_index = gr.Number(value=-1, visible=False, precision=0)
|
69 |
with gr.Row():
|
70 |
send_btn = gr.Button('参数发送到文生图')
|
71 |
-
del_btn = gr.Button('
|
72 |
|
73 |
img_dir_path.change(lambda path: get_img_list(path, 1) + ('', None), inputs=img_dir_path, outputs=[history_gallery, page_index, info, items])
|
74 |
img_dir_path.blur(update_img_dir, inputs=None, outputs=img_dir_path)
|
|
|
61 |
page_index = gr.Number(value=1, label="页码", precision=0)
|
62 |
next_page = gr.Button('下一页')
|
63 |
end_page = gr.Button('末尾页')
|
64 |
+
history_gallery = gr.Gallery(show_label=False, columns=6, height=1024, show_share_button=False)
|
65 |
with gr.Column(scale=1):
|
66 |
info = gr.HTML()
|
67 |
items = gr.JSON(value=None, visible=False)
|
68 |
selected_index = gr.Number(value=-1, visible=False, precision=0)
|
69 |
with gr.Row():
|
70 |
send_btn = gr.Button('参数发送到文生图')
|
71 |
+
del_btn = gr.Button('删除')
|
72 |
|
73 |
img_dir_path.change(lambda path: get_img_list(path, 1) + ('', None), inputs=img_dir_path, outputs=[history_gallery, page_index, info, items])
|
74 |
img_dir_path.blur(update_img_dir, inputs=None, outputs=img_dir_path)
|
utils.py
CHANGED
@@ -118,9 +118,6 @@ def generate_novelai_image(
|
|
118 |
else:
|
119 |
return "Generation failed", json.loads(response.content)
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
def image_from_bytes(data):
|
125 |
img_file = io.BytesIO(data)
|
126 |
img_file.seek(0)
|
|
|
118 |
else:
|
119 |
return "Generation failed", json.loads(response.content)
|
120 |
|
|
|
|
|
|
|
121 |
def image_from_bytes(data):
|
122 |
img_file = io.BytesIO(data)
|
123 |
img_file.seek(0)
|