feat: prevent config reset by renaming metadata_scheme to match config options
This commit is contained in:
parent
63403d614e
commit
1419231e74
|
|
@ -373,7 +373,7 @@
|
|||
"Metadata": "Metadata",
|
||||
"Apply Metadata": "Apply Metadata",
|
||||
"Metadata Scheme": "Metadata Scheme",
|
||||
"Image Prompt parameters are not included. Use A1111 for compatibility with Civitai.": "Image Prompt parameters are not included. Use A1111 for compatibility with Civitai.",
|
||||
"Fooocus (json)": "Fooocus (json)",
|
||||
"A1111 (plain text)": "A1111 (plain text)"
|
||||
"Image Prompt parameters are not included. Use a1111 for compatibility with Civitai.": "Image Prompt parameters are not included. Use a1111 for compatibility with Civitai.",
|
||||
"fooocus (json)": "fooocus (json)",
|
||||
"a1111 (plain text)": "a1111 (plain text)"
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ class MetadataScheme(Enum):
|
|||
|
||||
|
||||
metadata_scheme = [
|
||||
('Fooocus (json)', MetadataScheme.FOOOCUS.value),
|
||||
('A1111 (plain text)', MetadataScheme.A1111.value),
|
||||
(f'{MetadataScheme.FOOOCUS.value} (json)', MetadataScheme.FOOOCUS.value),
|
||||
(f'{MetadataScheme.A1111.value} (plain text)', MetadataScheme.A1111.value),
|
||||
]
|
||||
|
||||
lora_count = 5
|
||||
|
|
@ -114,10 +114,10 @@ class Performance(Enum):
|
|||
def list(cls) -> list:
|
||||
return list(map(lambda c: c.value, cls))
|
||||
|
||||
def steps(self) -> int:
|
||||
def steps(self) -> int | None:
|
||||
return Steps[self.name].value if Steps[self.name] else None
|
||||
|
||||
def steps_uov(self) -> int:
|
||||
def steps_uov(self) -> int | None:
|
||||
return StepsUOV[self.name].value if Steps[self.name] else None
|
||||
|
||||
|
||||
|
|
|
|||
2
webui.py
2
webui.py
|
|
@ -411,7 +411,7 @@ with shared.gradio_root:
|
|||
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.')
|
||||
metadata_scheme = gr.Radio(label='Metadata Scheme', choices=flags.metadata_scheme, value=modules.config.default_metadata_scheme,
|
||||
info='Image Prompt parameters are not included. Use A1111 for compatibility with Civitai.',
|
||||
info='Image Prompt parameters are not included. Use a1111 for compatibility with Civitai.',
|
||||
visible=modules.config.default_save_metadata_to_images)
|
||||
|
||||
save_metadata_to_images.change(lambda x: gr.update(visible=x), inputs=[save_metadata_to_images], outputs=[metadata_scheme],
|
||||
|
|
|
|||
Loading…
Reference in New Issue