Merge branch 'feature/add-metadata-to-files'

This commit is contained in:
Manuel Schmid 2024-02-18 16:24:50 +01:00
commit 26601a99d1
No known key found for this signature in database
GPG Key ID: 32C4F7569B40B84B
3 changed files with 6 additions and 4 deletions

View File

@ -825,6 +825,7 @@ def worker():
('Fooocus V2 Expansion', 'prompt_expansion', task['expansion']),
('Styles', 'styles', str(raw_style_selections)),
('Performance', 'performance', performance_selection.value),
('Steps', 'steps', steps),
('Resolution', 'resolution', str((width, height))),
('Guidance Scale', 'guidance_scale', guidance_scale),
('Sharpness', 'sharpness', modules.patch.patch_settings[pid].sharpness),

View File

@ -1,4 +1,4 @@
from enum import Enum
from enum import IntEnum, Enum
disabled = 'Disabled'
enabled = 'Enabled'
@ -104,13 +104,13 @@ lora_count_with_lcm = lora_count + 1
controlnet_image_count = 4
class Steps(Enum):
class Steps(IntEnum):
QUALITY = 60
SPEED = 30
EXTREME_SPEED = 8
class StepsUOV(Enum):
class StepsUOV(IntEnum):
QUALITY = 36
SPEED = 18
EXTREME_SPEED = 8

View File

@ -97,7 +97,8 @@ def get_steps(key: str, fallback: str | None, source_dict: dict, results: list,
h = source_dict.get(key, source_dict.get(fallback, default))
assert h is not None
h = int(h)
if h not in set(item.value for item in Steps):
# if not in steps or in steps and performance is not the same
if h not in iter(Steps) or Steps(h).name.casefold() != source_dict.get('performance', '').replace(' ', '_').casefold():
results.append(h)
return
results.append(-1)