model_reference_records
The model database pydantic models and associate enums/lookups.
MODEL_RECORD_TYPE_LOOKUP
module-attribute
__all__
module-attribute
__all__ = [
"MODEL_RECORD_TYPE_LOOKUP",
"AudioGenerationModelRecord",
"BlipModelRecord",
"ClipModelRecord",
"CodeformerModelRecord",
"ControlNetModelRecord",
"DownloadRecord",
"EsrganModelRecord",
"FineTuneSeriesInfo",
"GenericModelRecord",
"GenericModelRecordConfig",
"GenericModelRecordMetadata",
"GfpganModelRecord",
"ImageGenerationModelRecord",
"MiscellaneousModelRecord",
"SafetyCheckerModelRecord",
"TextGenerationModelRecord",
"VideoGenerationModelRecord",
"get_record_type_for_category",
"register_record_type",
]
DownloadRecord
Bases: BaseModel
A record of a file to download for a model. Typically a ckpt file.
Source code in src/horde_model_reference/model_reference_records.py
file_name
instance-attribute
The horde specific filename. This is not necessarily the same as the file's name on the model host.
GenericModelRecordConfig
Bases: BaseModel
Configuration for a generic model record.
Source code in src/horde_model_reference/model_reference_records.py
GenericModelRecordMetadata
Bases: BaseModel
Metadata for a generic model record.
Source code in src/horde_model_reference/model_reference_records.py
schema_version
class-attribute
instance-attribute
The version of the schema used to create this record.
created_at
class-attribute
instance-attribute
The Unix time of when the record was created.
updated_at
class-attribute
instance-attribute
The Unix time of when the record was last updated.
created_by
class-attribute
instance-attribute
The name or identifier of the person or system which created the record.
FineTuneSeriesInfo
Bases: BaseModel
Information about a fine-tuning series.
Source code in src/horde_model_reference/model_reference_records.py
version
class-attribute
instance-attribute
The version of the fine-tuning series.
author
class-attribute
instance-attribute
The author of the fine-tuning series.
description
class-attribute
instance-attribute
A short description of the fine-tuning series.
GenericModelRecord
Bases: BaseModel
A generic model reference record.
Source code in src/horde_model_reference/model_reference_records.py
record_type
instance-attribute
Discriminator field for polymorphic deserialization. Identifies the specific record type.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
model_classification
instance-attribute
The classification of the model.
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
ImageGenerationModelRecord
Bases: GenericModelRecord
A model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as an image generation model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
image_generation
)
)
The domain (e.g., image, text) and purpose (e.g., generation, classification) of the model.
inpainting
class-attribute
instance-attribute
If this is an inpainting model or not.
baseline
instance-attribute
The model on which this model is based.
optimization
class-attribute
instance-attribute
The optimization type of the model.
tags
class-attribute
instance-attribute
Any tags associated with the model which may be useful for searching.
showcases
class-attribute
instance-attribute
Links to any showcases of the model which illustrate its style.
min_bridge_version
class-attribute
instance-attribute
The minimum version of AI-Horde-Worker required to use this model.
trigger
class-attribute
instance-attribute
A list of trigger words or phrases which can be used to activate the model.
homepage
class-attribute
instance-attribute
A link to the model's homepage.
style
class-attribute
instance-attribute
The style of the model.
requirements
class-attribute
instance-attribute
requirements: (
dict[
str,
int
| float
| str
| list[int]
| list[float]
| list[str]
| bool,
]
| None
) = None
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
validator_set_arrays_to_empty_if_none
Set any None values to empty lists.
Source code in src/horde_model_reference/model_reference_records.py
validator_is_baseline_and_style_known
Check if the baseline is known.
Source code in src/horde_model_reference/model_reference_records.py
ControlNetModelRecord
Bases: GenericModelRecord
A ControlNet model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a ControlNet model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(controlnet)
)
controlnet_style
class-attribute
instance-attribute
The 'style' (purpose) of the controlnet. See CONTROLNET_STYLE for all possible values and more info.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
validator_is_style_known
Check if the style is known.
Source code in src/horde_model_reference/model_reference_records.py
TextGenerationModelRecord
Bases: GenericModelRecord
A text generation model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a text generation model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
text_generation
)
)
parameters_count
class-attribute
instance-attribute
instruct_format
class-attribute
instance-attribute
The instruction template format used by this model (e.g., ChatML, Mistral, Alpaca).
settings
class-attribute
instance-attribute
settings: (
dict[
str,
int
| float
| str
| list[int]
| list[float]
| list[str]
| bool,
]
| None
) = None
text_model_group
class-attribute
instance-attribute
The base model group name for grouping model variants together.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
BlipModelRecord
Bases: GenericModelRecord
A BLIP model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a BLIP model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(blip)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
ClipModelRecord
Bases: GenericModelRecord
A CLIP model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a CLIP model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(clip)
)
pretrained_name
class-attribute
instance-attribute
The pretrained model name, if applicable.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
CodeformerModelRecord
Bases: GenericModelRecord
A Codeformer model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a Codeformer model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(codeformer)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
EsrganModelRecord
Bases: GenericModelRecord
An ESRGAN model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as an ESRGAN model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(esrgan)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
GfpganModelRecord
Bases: GenericModelRecord
A GFPGAN model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a GFPGAN model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(gfpgan)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
SafetyCheckerModelRecord
Bases: GenericModelRecord
A safety checker model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a safety checker model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
safety_checker
)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
VideoGenerationModelRecord
Bases: GenericModelRecord
A video generation model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a video generation model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
video_generation
)
)
baseline
class-attribute
instance-attribute
The model on which this model is based.
tags
class-attribute
instance-attribute
Any tags associated with the model which may be useful for searching.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
AudioGenerationModelRecord
Bases: GenericModelRecord
An audio generation model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as an audio generation model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
audio_generation
)
)
baseline
class-attribute
instance-attribute
The model on which this model is based.
tags
class-attribute
instance-attribute
Any tags associated with the model which may be useful for searching.
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
MiscellaneousModelRecord
Bases: GenericModelRecord
A miscellaneous model entry in the model reference.
Source code in src/horde_model_reference/model_reference_records.py
record_type
class-attribute
instance-attribute
Discriminator field identifying this as a miscellaneous model record.
model_classification
class-attribute
instance-attribute
model_classification: ModelClassification = Field(
default_factory=lambda: _classification_for(
miscellaneous
)
)
description
class-attribute
instance-attribute
A short description of the model.
version
class-attribute
instance-attribute
The version of the model (not the version of SD it is based on, see baseline for that info).
finetune_series
class-attribute
instance-attribute
Information about the fine-tuning of the model. For image, some examples are 'Pony', 'Illustrious", etc.
metadata
class-attribute
instance-attribute
Metadata about the record itself, such as creation and update times.
config
class-attribute
instance-attribute
A dictionary of any configuration files and information on where to download the model file(s).
primary_download_url
property
Return the URL of the first download entry, or None if there are no downloads.
_classification_for
Build the default ModelClassification for category from the registry.
Source code in src/horde_model_reference/model_reference_records.py
get_default_config
Get the default config for model records based on whether AI Horde is being tested or not.
Source code in src/horde_model_reference/model_reference_records.py
register_record_type
register_record_type(
category: MODEL_REFERENCE_CATEGORY | str,
) -> Callable[
[type[GenericModelRecord]], type[GenericModelRecord]
]
Register a model record type with its category.
Source code in src/horde_model_reference/model_reference_records.py
_field_policy_for
_field_policy_for(
category: MODEL_REFERENCE_CATEGORY | str,
field_name: str,
fallback: FieldPolicy,
) -> FieldPolicy
Source code in src/horde_model_reference/model_reference_records.py
_apply_policy
_apply_policy(
*,
category: MODEL_REFERENCE_CATEGORY | str,
field_name: str,
value: str,
fallback_policy: FieldPolicy,
model_name: str,
) -> None
Source code in src/horde_model_reference/model_reference_records.py
get_record_type_for_category
get_record_type_for_category(
category: MODEL_REFERENCE_CATEGORY | str,
) -> type[GenericModelRecord]
Return the registered record type for category, falling back to GenericModelRecord.
Parameters:
-
category(MODEL_REFERENCE_CATEGORY | str) –The model reference category (enum member or plain string).
Returns:
-
type[GenericModelRecord]–The record type class registered for the category, or
GenericModelRecord -
type[GenericModelRecord]–if no specific type has been registered.