feat: add config and checkbox for save_metadata_to_images
This commit is contained in:
parent
c5a15c7321
commit
8d56318bed
|
|
@ -141,6 +141,7 @@ def worker():
|
|||
inpaint_input_image = args.pop()
|
||||
inpaint_additional_prompt = args.pop()
|
||||
inpaint_mask_image_upload = args.pop()
|
||||
save_metadata_to_images = args.pop()
|
||||
|
||||
cn_tasks = {x: [] for x in flags.ip_list}
|
||||
for _ in range(4):
|
||||
|
|
@ -839,8 +840,8 @@ def worker():
|
|||
}
|
||||
cn_task_index += 1
|
||||
|
||||
metadata |= {'software': f'Fooocus v{fooocus_version.version}'}
|
||||
metadata_string = json.dumps(metadata, ensure_ascii=False)
|
||||
metadata |= {'software': f'Fooocus v{fooocus_version.version}'}
|
||||
metadata_string = json.dumps(metadata, ensure_ascii=False)
|
||||
|
||||
for x in imgs:
|
||||
d = [
|
||||
|
|
@ -867,7 +868,7 @@ def worker():
|
|||
if n != 'None':
|
||||
d.append((f'LoRA {li + 1}', f'{n} : {w}'))
|
||||
d.append(('Version', 'v' + fooocus_version.version))
|
||||
log(x, d, metadata_string, True)
|
||||
log(x, d, metadata_string, save_metadata_to_images)
|
||||
|
||||
yield_result(async_task, imgs, do_not_show_finished_images=len(tasks) == 1)
|
||||
except ldm_patched.modules.model_management.InterruptProcessingException as e:
|
||||
|
|
|
|||
|
|
@ -315,6 +315,11 @@ example_inpaint_prompts = get_config_item_or_set_default(
|
|||
],
|
||||
validator=lambda x: isinstance(x, list) and all(isinstance(v, str) for v in x)
|
||||
)
|
||||
default_save_metadata_to_images = get_config_item_or_set_default(
|
||||
key='default_save_metadata_to_images',
|
||||
default_value=False,
|
||||
validator=lambda x: isinstance(x, bool)
|
||||
)
|
||||
|
||||
example_inpaint_prompts = [[x] for x in example_inpaint_prompts]
|
||||
|
||||
|
|
@ -334,6 +339,7 @@ possible_preset_keys = [
|
|||
"default_prompt_negative",
|
||||
"default_styles",
|
||||
"default_aspect_ratio",
|
||||
"default_save_metadata_to_images",
|
||||
"checkpoint_downloads",
|
||||
"embeddings_downloads",
|
||||
"lora_downloads",
|
||||
|
|
|
|||
3
webui.py
3
webui.py
|
|
@ -381,6 +381,8 @@ with shared.gradio_root:
|
|||
info='Set as negative number to disable. For developer debugging.')
|
||||
disable_preview = gr.Checkbox(label='Disable Preview', value=False,
|
||||
info='Disable preview during generation.')
|
||||
save_metadata_to_images = gr.Checkbox(label='Save Metadata to Images', value=modules.config.default_save_metadata_to_images,
|
||||
info='Adds parameters to generated images allowing manual regeneration.')
|
||||
|
||||
with gr.Tab(label='Control'):
|
||||
debugging_cn_preprocessor = gr.Checkbox(label='Debug Preprocessors', value=False,
|
||||
|
|
@ -528,6 +530,7 @@ with shared.gradio_root:
|
|||
ctrls += [input_image_checkbox, current_tab]
|
||||
ctrls += [uov_method, uov_input_image]
|
||||
ctrls += [outpaint_selections, inpaint_input_image, inpaint_additional_prompt, inpaint_mask_image]
|
||||
ctrls += [save_metadata_to_images]
|
||||
ctrls += ip_ctrls
|
||||
|
||||
state_is_generating = gr.State(False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue