mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix paste
This commit is contained in:
@@ -81,7 +81,7 @@ svg.feather.feather-image, .feather .feather-image { display: none }
|
||||
#quicksettings > div, #quicksettings > fieldset { min-width: 24em; max-width: 26em; line-height: 2em; }
|
||||
#refresh_sd_model_checkpoint { height: 48px; margin-left: -14px; background: #333333; box-shadow: none; }
|
||||
#open_folder_extras, #footer, #style_pos_col, #style_neg_col, #roll_col, #extras_upscaler_2, #extras_upscaler_2_visibility, #txt2img_seed_resize_from_w, #txt2img_seed_resize_from_h { display: none; }
|
||||
#refresh_txt2img_styles, #refresh_img2img_styles { height: 40px; margin-left: -8px; }
|
||||
#refresh_txt2img_styles, #refresh_img2img_styles { height: 45px; margin-left: -8px; }
|
||||
#save-animation { border-radius: 0 !important; margin-bottom: 16px; background-color: #111111; }
|
||||
#script_list { padding: 4px; margin-top: 20px; margin-bottom: 20px; }
|
||||
#settings > div.flex-wrap { width: 15em; }
|
||||
|
||||
@@ -92,6 +92,7 @@ button.custom-button{
|
||||
|
||||
.performance p{
|
||||
display: inline-block;
|
||||
color: var(--primary-100) !important
|
||||
}
|
||||
|
||||
.performance .time {
|
||||
@@ -116,7 +117,7 @@ a{
|
||||
#txt2img_gallery img, #img2img_gallery img, #extras_gallery img{
|
||||
object-fit: scale-down;
|
||||
width: -webkit-fill-available !important;
|
||||
height: -webkit-fill-available !important;
|
||||
height: inherit !important;
|
||||
}
|
||||
#txt2img_actions_column, #img2img_actions_column {
|
||||
gap: 0.5em;
|
||||
|
||||
@@ -350,7 +350,9 @@ def create_override_settings_dict(text_pairs):
|
||||
|
||||
|
||||
def connect_paste(button, local_paste_fields, input_comp, override_settings_component, tabname):
|
||||
|
||||
def paste_func(prompt):
|
||||
shared.log.debug(f'paste prompt: {prompt}')
|
||||
if prompt is not None and 'Negative prompt' not in prompt and 'Steps' not in prompt:
|
||||
prompt = None
|
||||
if not prompt and not shared.cmd_opts.hide_ui_dir_config:
|
||||
|
||||
@@ -31,7 +31,7 @@ def plaintext_to_html(text):
|
||||
|
||||
|
||||
def infotext_to_html(text):
|
||||
res = '<p class="html_info">Prompt: ' + html.escape(text).replace('\n', '<br>') + '</p>'
|
||||
res = '<p class="html_info">Prompt: ' + html.escape(text or '').replace('\n', '<br>') + '</p>'
|
||||
sections = res.split('Steps:') # before and after prompt+negprompt'
|
||||
if len(sections) > 1:
|
||||
res = sections[0] + '<br>Steps: ' + sections[1].strip().replace(', ', ' | ')
|
||||
@@ -86,7 +86,7 @@ def save_files(js_data, images, do_make_zip, index):
|
||||
filenames = []
|
||||
fullfns = []
|
||||
for image_index, filedata in enumerate(images, start_index):
|
||||
if 'name' in filedata and os.path.isfile(filedata['name']):
|
||||
if 'name' in filedata and ('tmp' not in filedata['name']) and os.path.isfile(filedata['name']):
|
||||
fullfn = filedata['name']
|
||||
filenames.append(os.path.basename(fullfn))
|
||||
fullfns.append(fullfn)
|
||||
@@ -186,7 +186,6 @@ def create_output_panel(tabname, outdir):
|
||||
paste_field_names = []
|
||||
for paste_tabname, paste_button in buttons.items():
|
||||
parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(
|
||||
paste_button=paste_button, tabname=paste_tabname, source_tabname=("txt2img" if tabname == "txt2img" else None), source_image_component=result_gallery,
|
||||
paste_field_names=paste_field_names
|
||||
paste_button=paste_button, tabname=paste_tabname, source_tabname=("txt2img" if tabname == "txt2img" else None), source_image_component=result_gallery, paste_field_names=paste_field_names
|
||||
))
|
||||
return result_gallery, generation_info, html_info, html_log
|
||||
|
||||
@@ -8,7 +8,7 @@ from modules.ui_common import infotext_to_html
|
||||
|
||||
def wrap_pnginfo(image):
|
||||
_, geninfo, info = run_pnginfo(image)
|
||||
return '', infotext_to_html(geninfo), info
|
||||
return '', infotext_to_html(geninfo), info, geninfo
|
||||
|
||||
|
||||
def submit_click(tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, show_extras_results, *script_inputs):
|
||||
@@ -45,18 +45,18 @@ def create_ui():
|
||||
result_images, generation_info, html_info, html_log = ui_common.create_output_panel("extras", shared.opts.outdir_extras_samples)
|
||||
gr.HTML('File metadata')
|
||||
exif_info = gr.HTML(elem_id="pnginfo_html_info")
|
||||
gen_info = gr.Text(elem_id="pnginfo_gen_info", visible=False)
|
||||
for tabname, button in buttons.items():
|
||||
parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(paste_button=button, tabname=tabname, source_text_component=html_info, source_image_component=extras_image))
|
||||
parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(paste_button=button, tabname=tabname, source_text_component=gen_info, source_image_component=extras_image))
|
||||
|
||||
tab_single.select(fn=lambda: 0, inputs=[], outputs=[tab_index])
|
||||
tab_batch.select(fn=lambda: 1, inputs=[], outputs=[tab_index])
|
||||
tab_batch_dir.select(fn=lambda: 2, inputs=[], outputs=[tab_index])
|
||||
# html_info.change(fn=pretty_geninfo, inputs=[html_info], outputs=[html_info_pretty])
|
||||
_dummy = gr.HTML(visible=False)
|
||||
extras_image.change(
|
||||
fn=wrap_gradio_call(wrap_pnginfo),
|
||||
inputs=[extras_image],
|
||||
outputs=[_dummy, html_info, exif_info],
|
||||
outputs=[_dummy, html_info, exif_info, gen_info],
|
||||
)
|
||||
submit.click(
|
||||
fn=call_queue.wrap_gradio_gpu_call(submit_click, extra_outputs=[None, '']),
|
||||
|
||||
Reference in New Issue
Block a user