feat: add config metadata_created_by
This commit is contained in:
parent
6662381931
commit
7b9deb17ee
|
|
@ -856,6 +856,10 @@ def worker():
|
|||
metadata |= {
|
||||
'software': f'Fooocus v{fooocus_version.version}',
|
||||
}
|
||||
if modules.config.metadata_created_by != 'None':
|
||||
metadata |= {
|
||||
'created_by': modules.config.metadata_created_by
|
||||
}
|
||||
metadata_string = json.dumps(metadata, ensure_ascii=False)
|
||||
elif save_metadata_to_images and metadata_schema == 'a1111':
|
||||
generation_params = {
|
||||
|
|
@ -871,6 +875,11 @@ def worker():
|
|||
"Version": f'Fooocus v{fooocus_version.version}'
|
||||
}
|
||||
|
||||
if modules.config.metadata_created_by != 'None':
|
||||
generation_params |= {
|
||||
'Created By': quote(modules.config.metadata_created_by)
|
||||
}
|
||||
|
||||
generation_params_text = ", ".join([k if k == v else f'{k}: {quote(v)}' for k, v in generation_params.items() if v is not None])
|
||||
positive_prompt_resolved = ', '.join(task['positive'])
|
||||
negative_prompt_resolved = ', '.join(task['negative'])
|
||||
|
|
|
|||
|
|
@ -325,6 +325,11 @@ default_metadata_schema = get_config_item_or_set_default(
|
|||
default_value='fooocus',
|
||||
validator=lambda x: x in [y[1] for y in modules.flags.metadata_schema if y[1] == x]
|
||||
)
|
||||
metadata_created_by = get_config_item_or_set_default(
|
||||
key='metadata_created_by',
|
||||
default_value='',
|
||||
validator=lambda x: isinstance(x, str)
|
||||
)
|
||||
|
||||
example_inpaint_prompts = [[x] for x in example_inpaint_prompts]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue