mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: add config metadata_created_by
This commit is contained in:
@@ -856,6 +856,10 @@ def worker():
|
|||||||
metadata |= {
|
metadata |= {
|
||||||
'software': f'Fooocus v{fooocus_version.version}',
|
'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)
|
metadata_string = json.dumps(metadata, ensure_ascii=False)
|
||||||
elif save_metadata_to_images and metadata_schema == 'a1111':
|
elif save_metadata_to_images and metadata_schema == 'a1111':
|
||||||
generation_params = {
|
generation_params = {
|
||||||
@@ -871,6 +875,11 @@ def worker():
|
|||||||
"Version": f'Fooocus v{fooocus_version.version}'
|
"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])
|
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'])
|
positive_prompt_resolved = ', '.join(task['positive'])
|
||||||
negative_prompt_resolved = ', '.join(task['negative'])
|
negative_prompt_resolved = ', '.join(task['negative'])
|
||||||
|
|||||||
@@ -325,6 +325,11 @@ default_metadata_schema = get_config_item_or_set_default(
|
|||||||
default_value='fooocus',
|
default_value='fooocus',
|
||||||
validator=lambda x: x in [y[1] for y in modules.flags.metadata_schema if y[1] == x]
|
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]
|
example_inpaint_prompts = [[x] for x in example_inpaint_prompts]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user