meta_consts
Domain enums, category descriptors, and runtime registries for model reference metadata.
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.
_MODEL_DOMAIN_REGISTRY
module-attribute
_MODEL_PURPOSE_REGISTRY
module-attribute
github_image_model_reference_categories
module-attribute
This distinguishes the original github repo locations and has no other meaning.
github_text_model_reference_categories
module-attribute
This distinguishes the original github repo locations and has no other meaning.
no_legacy_format_available_categories
module-attribute
Categories for which no legacy-format JSON file exists..
categories_managed_elsewhere
module-attribute
Categories that are managed by an external system.
MODEL_CLASSIFICATION_LOOKUP
module-attribute
_CATEGORY_REGISTRY
module-attribute
_CATEGORY_REGISTRY = DescriptorRegistry[
MODEL_REFERENCE_CATEGORY | str, CategoryDescriptor
](_rebuild_category_derived_data)
_unregistered_categories
module-attribute
__all__
module-attribute
__all__ = [
"CONTROLNET_STYLE",
"IMAGE_GENERATION_BASELINE_NATIVE_RESOLUTION_LOOKUP",
"KNOWN_IMAGE_GENERATION_BASELINE",
"KNOWN_TAGS",
"KNOWN_TEXT_BACKENDS",
"MODEL_DOMAIN",
"MODEL_PURPOSE",
"MODEL_REFERENCE_CATEGORY",
"MODEL_STYLE",
"TEXT_BACKENDS",
"BaselineDescriptor",
"CategoryDescriptor",
"ModelClassification",
"get_all_registered_baselines",
"get_all_registered_categories",
"get_baseline_descriptor",
"get_baseline_native_resolution",
"get_baselines_by_resolution",
"get_category_descriptor",
"get_known_tags",
"is_known_controlnet_style",
"is_known_image_baseline",
"is_known_model_domain",
"is_known_model_purpose",
"is_known_model_style",
"is_known_tag",
"is_known_text_backend",
"register_category",
"register_controlnet_style",
"register_image_baseline",
"register_model_domain",
"register_model_purpose",
"register_model_style",
"register_tag",
"register_text_backend",
]
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
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
MODEL_STYLE
Bases: StrEnum
An enum of all the model styles.
Source code in src/horde_model_reference/model_consts/shared.py
TEXT_BACKENDS
Bases: StrEnum
An enum of all the text backends.
Source code in src/horde_model_reference/model_consts/text.py
MODEL_DOMAIN
Bases: StrEnum
The domain of a model, i.e., what it pertains to (image, text, video, etc.).
Source code in src/horde_model_reference/meta_consts.py
MODEL_PURPOSE
Bases: StrEnum
The primary purpose of a model, for example, image generation or feature extraction.
Source code in src/horde_model_reference/meta_consts.py
generation
class-attribute
instance-attribute
The model is the central part of a generative AI system.
post_processing
class-attribute
instance-attribute
The model is used for post-processing user input or generation tasks.
auxiliary_or_patch
class-attribute
instance-attribute
The model is an auxiliary or patch model, e.g. LoRA or ControlNet.
feature_extractor
class-attribute
instance-attribute
The model is a feature extractor, e.g. CLIP or BLIP.
safety_checker
class-attribute
instance-attribute
A special case of feature extraction.
ModelClassification
Bases: BaseModel
Contains specific information about how to categorize a model.
This includes the model's MODEL_DOMAIN and MODEL_PURPOSE.
Source code in src/horde_model_reference/meta_consts.py
domain
instance-attribute
The domain of the model, i.e., what it pertains to (image, text, video, etc.)
validator_known_purpose
Check if the purpose is known.
Source code in src/horde_model_reference/meta_consts.py
MODEL_REFERENCE_CATEGORY
Bases: StrEnum
The categories of model reference entries.
Source code in src/horde_model_reference/meta_consts.py
CategoryDescriptor
dataclass
Describes a model reference category's traits in a single place.
Source code in src/horde_model_reference/meta_consts.py
domain
instance-attribute
The MODEL_DOMAIN this category belongs to, e.g. image, text, video, etc.
purpose
instance-attribute
The MODEL_PURPOSE of models in this category, e.g. generation, feature extraction, etc.
github_source
class-attribute
instance-attribute
Whether a legacy-format JSON file exists for this category. (e.g., "image" or "text").
None means the category has no legacy GitHub source.
has_legacy_format
class-attribute
instance-attribute
Whether a legacy-format JSON file exists for this category.
managed_elsewhere
class-attribute
instance-attribute
Whether this category is managed by an external system.
filename_override
class-attribute
instance-attribute
Non-default v2 filename (default is {category}.json).
legacy_filename_override
class-attribute
instance-attribute
Non-default legacy filename (default matches v2).
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_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_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.
Source code in src/horde_model_reference/model_consts/image.py
is_known_controlnet_style
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
register_controlnet_style
register_image_baseline
register_image_baseline(
name: KNOWN_IMAGE_GENERATION_BASELINE | str,
descriptor: BaselineDescriptor,
) -> None
Register a new image-generation baseline.
get_known_tags
is_known_model_style
is_known_tag
register_model_style
register_tag
is_known_text_backend
register_text_backend
register_model_domain
is_known_model_domain
register_model_purpose
is_known_model_purpose
_rebuild_category_derived_data
_rebuild_category_derived_data(
data: dict[
MODEL_REFERENCE_CATEGORY | str, CategoryDescriptor
],
) -> None
Rebuild derived category data from the registry.
Source code in src/horde_model_reference/meta_consts.py
register_category
Register a new model reference category.
get_github_image_categories
Return categories whose legacy JSON lives in the image GitHub repo.
get_github_text_categories
Return categories whose legacy JSON lives in the text GitHub repo.
get_no_legacy_format_categories
Return categories that have no legacy-format JSON file.
get_model_classification
Return the ModelClassification for category, or raise KeyError.
get_category_descriptor
Return the CategoryDescriptor for category.
Raises:
-
KeyError–If the category is not registered.