Merge branch 'jpg_config_image_extension'

# Conflicts:
#	modules/config.py
#	modules/flags.py
#	webui.py
This commit is contained in:
Manuel Schmid 2024-01-14 23:40:24 +01:00
commit f25bf49894
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
4 changed files with 13 additions and 13 deletions

View File

@ -134,7 +134,7 @@ def worker():
performance_selection = args.pop()
aspect_ratios_selection = args.pop()
image_number = args.pop()
image_extension = args.pop()
image_file_extension = args.pop()
image_seed = args.pop()
sharpness = args.pop()
guidance_scale = args.pop()
@ -527,7 +527,7 @@ def worker():
if direct_return:
d = [('Upscale (Fast)', '2x')]
uov_input_image_path = log(uov_input_image, d, image_extension)
uov_input_image_path = log(uov_input_image, d, image_file_extension)
yield_result(async_task, uov_input_image_path, do_not_show_finished_images=True)
return
@ -819,7 +819,7 @@ def worker():
if n != 'None':
d.append((f'LoRA {li + 1}', f'{n} : {w}'))
d.append(('Version', 'v' + fooocus_version.version))
img_paths.append(log(x, d, image_extension))
img_paths.append(log(x, d, image_file_extension))
yield_result(async_task, img_paths, do_not_show_finished_images=len(tasks) == 1, progressbar_index=int(15.0 + 85.0 * float((current_task_id + 1) * steps) / float(all_steps)))
except ldm_patched.modules.model_management.InterruptProcessingException as e:

View File

@ -289,10 +289,10 @@ default_max_image_number = get_config_item_or_set_default(
default_value=32,
validator=lambda x: isinstance(x, int) and x >= 1
)
default_image_extension = get_config_item_or_set_default(
key='default_image_extension',
default_image_file_extension = get_config_item_or_set_default(
key='default_image_file_extension',
default_value='png',
validator=lambda x: x in modules.flags.image_extensions
validator=lambda x: x in modules.flags.image_file_extensions
)
default_image_number = get_config_item_or_set_default(
key='default_image_number',

View File

@ -40,7 +40,7 @@ performance_selections = [
('Extreme Speed (LCM) <span style="color: grey;"> \U00002223 8 steps, intermediate results disabled</span>', 'Extreme Speed')
]
image_extensions = ['png', 'jpg', 'webp']
image_file_extensions = ['png', 'jpg', 'webp']
inpaint_option_default = 'Inpaint or Outpaint (default)'
inpaint_option_detail = 'Improve Detail (face, hand, eyes, etc.)'

View File

@ -249,9 +249,9 @@ with shared.gradio_root:
elem_classes='aspect_ratios')
image_number = gr.Slider(label='Image Number', minimum=1, maximum=modules.config.default_max_image_number, step=1, value=modules.config.default_image_number)
image_extension = gr.Radio(label='Image Outputs Extension',
choices=modules.flags.image_extensions,
value=modules.config.default_image_extension)
image_file_extension = gr.Radio(label='Image File Extension',
choices=modules.flags.image_file_extensions,
value=modules.config.default_image_file_extension)
negative_prompt = gr.Textbox(label='Negative Prompt', show_label=True, placeholder="Type prompt here.",
info='Describing what you do not want to see.', lines=2,
@ -282,7 +282,7 @@ with shared.gradio_root:
queue=False, show_progress=False)
if not args_manager.args.disable_image_log:
gr.HTML(f'<a href="/file={get_current_html_path(image_extension)}" target="_blank">\U0001F4DA History Log</a>')
gr.HTML(f'<a href="/file={get_current_html_path(image_file_extension)}" target="_blank">\U0001F4DA History Log</a>')
with gr.Tab(label='Styles'):
style_sorter.try_load_sorted_styles(
@ -593,7 +593,7 @@ with shared.gradio_root:
scheduler_name, adaptive_cfg, refiner_swap_method, negative_prompt, disable_intermediate_results
], queue=False, show_progress=False)
image_extension.input(lambda x: gr.update(image_extension=x), inputs=image_extension)
image_file_extension.input(lambda x: gr.update(image_file_extension=x), inputs=image_file_extension)
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, advanced_column,
queue=False, show_progress=False) \
@ -634,7 +634,7 @@ with shared.gradio_root:
ctrls = [
currentTask, prompt, negative_prompt, translate_prompts, style_selections,
performance_selection, aspect_ratios_selection, image_number, image_extension, image_seed, sharpness, guidance_scale
performance_selection, aspect_ratios_selection, image_number, image_file_extension, image_seed, sharpness, guidance_scale
]
ctrls += [base_model, refiner_model, refiner_switch] + lora_ctrls