image
Image-generation-specific model constants, enums, and descriptors.
IMAGE_GENERATION_BASELINE_NATIVE_RESOLUTION_LOOKUP
module-attribute
IMAGE_GENERATION_BASELINE_NATIVE_RESOLUTION_LOOKUP: dict[
KNOWN_IMAGE_GENERATION_BASELINE | str, int
] = {}
The single-side preferred resolution for each known stable diffusion baseline.
_ALTERNATIVE_NAME_TO_BASELINE
module-attribute
_IMAGE_BASELINE_REGISTRY
module-attribute
_IMAGE_BASELINE_REGISTRY = DescriptorRegistry[
KNOWN_IMAGE_GENERATION_BASELINE | str,
BaselineDescriptor,
](_rebuild_baseline_derived_data)
alternative_sdxl_baseline_names
module-attribute
_unregistered_baselines
module-attribute
_CONTROLNET_STYLE_REGISTRY
module-attribute
KNOWN_IMAGE_GENERATION_BASELINE
Bases: StrEnum
An enum of all the image generation baselines.
Source code in src/horde_model_reference/model_consts/image.py
infer
class-attribute
instance-attribute
The baseline is not known and should be inferred from the model name.
BaselineDescriptor
dataclass
Describes a known image-generation baseline in a single place.
Attributes:
-
native_resolution(int | None) –Preferred single-side resolution, or
Nonefor baselines likeinferthat have no fixed resolution. -
alternative_names(tuple[str, ...]) –Alternative human/API names that map to this baseline.
Source code in src/horde_model_reference/model_consts/image.py
CONTROLNET_STYLE
Bases: StrEnum
An enum of all the ControlNet 'styles' - the process that defines the model's behavior.
Examples include canny, depth, and openpose.
Source code in src/horde_model_reference/model_consts/image.py
_rebuild_baseline_derived_data
_rebuild_baseline_derived_data(
data: dict[
KNOWN_IMAGE_GENERATION_BASELINE | str,
BaselineDescriptor,
],
) -> None
Rebuild derived baseline lookups from the registry.
Source code in src/horde_model_reference/model_consts/image.py
register_image_baseline
register_image_baseline(
name: KNOWN_IMAGE_GENERATION_BASELINE | str,
descriptor: BaselineDescriptor,
) -> None
Register a new image-generation baseline.
_matching_image_baseline_exists
_matching_image_baseline_exists(
baseline: str,
known_image_generation_baseline: KNOWN_IMAGE_GENERATION_BASELINE
| str,
) -> bool
Return True if baseline is a recognized alternative name for known_image_generation_baseline.
Parameters:
-
baseline(str) –The baseline name to look up.
-
known_image_generation_baseline(KNOWN_IMAGE_GENERATION_BASELINE | str) –The known image generation baseline to check against.
Returns:
-
bool–True if the baseline name matches the given known baseline, False otherwise.
Source code in src/horde_model_reference/model_consts/image.py
is_known_image_baseline
Return True if baseline is a known baseline or alternative name.
Parameters:
-
baseline(str) –The baseline name to check.
Returns:
-
bool–True if the baseline is known, False otherwise.
Source code in src/horde_model_reference/model_consts/image.py
get_baseline_descriptor
Return the BaselineDescriptor for baseline.
Parameters:
-
baseline(KNOWN_IMAGE_GENERATION_BASELINE | str) –The known image generation baseline (enum member or plain string).
Raises:
-
KeyError–If the baseline is not registered.
Source code in src/horde_model_reference/model_consts/image.py
get_all_registered_baselines
get_all_registered_baselines() -> dict[
KNOWN_IMAGE_GENERATION_BASELINE | str,
BaselineDescriptor,
]
Return a shallow copy of the baseline registry.
This includes both built-in KNOWN_IMAGE_GENERATION_BASELINE members and
any externally registered baselines.
Source code in src/horde_model_reference/model_consts/image.py
get_baseline_native_resolution
Get the native resolution of a stable diffusion baseline.
Parameters:
-
baseline(KNOWN_IMAGE_GENERATION_BASELINE | str) –The stable diffusion baseline (enum member or plain string).
Returns:
-
int–The native resolution of the baseline.
Source code in src/horde_model_reference/model_consts/image.py
get_baselines_by_resolution
Get all baselines that have the given native resolution.
Parameters:
-
resolution(int) –The native resolution to look for.
Returns:
-
list[KNOWN_IMAGE_GENERATION_BASELINE | str]–A list of baselines that have the given native resolution.