aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/ui.py b/modules/ui.py
index df653059..948f303b 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -40,6 +40,7 @@ from modules import prompt_parser
from modules.images import save_image
import modules.textual_inversion.ui
import modules.hypernetwork.ui
+import modules.images_history as img_his
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the browser will not show any UI
mimetypes.init()
@@ -536,7 +537,6 @@ def create_ui(wrap_gradio_gpu_call):
custom_inputs = modules.scripts.scripts_txt2img.setup_ui(is_img2img=False)
with gr.Column(variant='panel'):
-
with gr.Group():
txt2img_preview = gr.Image(elem_id='txt2img_preview', visible=False)
txt2img_gallery = gr.Gallery(label='Output', show_label=False, elem_id='txt2img_gallery').style(grid=4)
@@ -559,6 +559,7 @@ def create_ui(wrap_gradio_gpu_call):
with gr.Group():
html_info = gr.HTML()
generation_info = gr.Textbox(visible=False)
+
connect_reuse_seed(seed, reuse_seed, generation_info, dummy_component, is_subseed=False)
connect_reuse_seed(subseed, reuse_subseed, generation_info, dummy_component, is_subseed=True)
@@ -652,6 +653,7 @@ def create_ui(wrap_gradio_gpu_call):
]
modules.generation_parameters_copypaste.connect_paste(paste, txt2img_paste_fields, txt2img_prompt)
token_button.click(fn=update_token_counter, inputs=[txt2img_prompt, steps], outputs=[token_counter])
+
with gr.Blocks(analytics_enabled=False) as img2img_interface:
img2img_prompt, roll, img2img_prompt_style, img2img_negative_prompt, img2img_prompt_style2, submit, img2img_interrogate, img2img_deepbooru, img2img_prompt_style_apply, img2img_save_style, paste, token_counter, token_button = create_toprow(is_img2img=True)
@@ -747,6 +749,7 @@ def create_ui(wrap_gradio_gpu_call):
with gr.Group():
html_info = gr.HTML()
generation_info = gr.Textbox(visible=False)
+
connect_reuse_seed(seed, reuse_seed, generation_info, dummy_component, is_subseed=False)
connect_reuse_seed(subseed, reuse_subseed, generation_info, dummy_component, is_subseed=True)
@@ -1252,7 +1255,16 @@ Requested path was: {f}
opts.save(shared.config_filename)
- return f'{changed} settings changed.', opts.dumpjson()
+ return f'{changed} settings changed.', opts.dumpjson()
+
+ #images history
+ images_history_switch_dict = {
+ "fn":modules.generation_parameters_copypaste.connect_paste,
+ "t2i":txt2img_paste_fields,
+ "i2i":img2img_paste_fields
+ }
+ images_history = img_his.create_history_tabs(gr, opts, wrap_gradio_call(modules.extras.run_pnginfo), images_history_switch_dict)
+
def run_settings_single(value, key):
if not opts.same_type(value, opts.data_labels[key].default):
@@ -1352,7 +1364,9 @@ Requested path was: {f}
(pnginfo_interface, "PNG Info", "pnginfo"),
(modelmerger_interface, "Checkpoint Merger", "modelmerger"),
(textual_inversion_interface, "Textual inversion", "ti"),
+ (images_history, "History", "images_history"),
(settings_interface, "Settings", "settings"),
+
]
with open(os.path.join(script_path, "style.css"), "r", encoding="utf8") as file: