mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
refactor: cleanup flags, use __member__ to check if enums contains key
This commit is contained in:
+8
-3
@@ -48,7 +48,8 @@ SAMPLERS = KSAMPLER | SAMPLER_EXTRA
|
|||||||
|
|
||||||
KSAMPLER_NAMES = list(KSAMPLER.keys())
|
KSAMPLER_NAMES = list(KSAMPLER.keys())
|
||||||
|
|
||||||
SCHEDULER_NAMES = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform", "lcm", "turbo", "align_your_steps", "tcd"]
|
SCHEDULER_NAMES = ["normal", "karras", "exponential", "sgm_uniform", "simple", "ddim_uniform", "lcm", "turbo",
|
||||||
|
"align_your_steps", "tcd"]
|
||||||
SAMPLER_NAMES = KSAMPLER_NAMES + list(SAMPLER_EXTRA.keys())
|
SAMPLER_NAMES = KSAMPLER_NAMES + list(SAMPLER_EXTRA.keys())
|
||||||
|
|
||||||
sampler_list = SAMPLER_NAMES
|
sampler_list = SAMPLER_NAMES
|
||||||
@@ -91,6 +92,7 @@ sdxl_aspect_ratios = [
|
|||||||
'1664*576', '1728*576'
|
'1664*576', '1728*576'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class MetadataScheme(Enum):
|
class MetadataScheme(Enum):
|
||||||
FOOOCUS = 'fooocus'
|
FOOOCUS = 'fooocus'
|
||||||
A1111 = 'a1111'
|
A1111 = 'a1111'
|
||||||
@@ -157,7 +159,10 @@ class Performance(Enum):
|
|||||||
return x in [cls.EXTREME_SPEED.value, cls.LIGHTNING.value, cls.HYPER_SD.value]
|
return x in [cls.EXTREME_SPEED.value, cls.LIGHTNING.value, cls.HYPER_SD.value]
|
||||||
|
|
||||||
def steps(self) -> int | None:
|
def steps(self) -> int | None:
|
||||||
return Steps[self.name].value if Steps[self.name] else None
|
return Steps[self.name].value if self.name in Steps.__members__ else None
|
||||||
|
|
||||||
def steps_uov(self) -> int | None:
|
def steps_uov(self) -> int | None:
|
||||||
return StepsUOV[self.name].value if Steps[self.name] else None
|
return StepsUOV[self.name].value if self.name in StepsUOV.__members__ else None
|
||||||
|
|
||||||
|
def lora_filename(self) -> str | None:
|
||||||
|
return PerformanceLoRA[self.name].value if self.name in PerformanceLoRA.__members__ else None
|
||||||
|
|||||||
Reference in New Issue
Block a user