fix: add workaround for same value in Steps IntEnum

This commit is contained in:
Manuel Schmid
2024-06-16 17:46:48 +02:00
parent 2704c90997
commit ea1562d078
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -135,6 +135,10 @@ class Steps(IntEnum):
LIGHTNING = 4 LIGHTNING = 4
HYPER_SD = 4 HYPER_SD = 4
@classmethod
def keys(cls) -> list:
return list(map(lambda c: c, Steps.__members__))
class StepsUOV(IntEnum): class StepsUOV(IntEnum):
QUALITY = 36 QUALITY = 36
+3 -2
View File
@@ -119,8 +119,9 @@ def get_steps(key: str, fallback: str | None, source_dict: dict, results: list,
assert h is not None assert h is not None
h = int(h) h = int(h)
# if not in steps or in steps and performance is not the same # 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(' ', performance_name = source_dict.get('performance', '').replace(' ', '_').replace('-', '_').casefold()
'_').casefold(): performance_candidates = [key for key in Steps.keys() if key.casefold() == performance_name and Steps[key] == h]
if len(performance_candidates) == 0:
results.append(h) results.append(h)
return return
results.append(-1) results.append(-1)