legacy_models
Pydantic models encapsulating the legacy-to-new reference normalization rules.
_ALLOWED_CONFIG_FILENAMES
module-attribute
_BASELINE_NORMALIZATION_MAP
module-attribute
_BASELINE_NORMALIZATION_MAP = {
"stable diffusion 1": "stable_diffusion_1",
"stable diffusion 2": "stable_diffusion_2_768",
"stable diffusion 2 512": "stable_diffusion_2_512",
"stable_diffusion_xl": "stable_diffusion_xl",
"stable_cascade": "stable_cascade",
}
LegacyRecordUnion
module-attribute
LegacyRecordUnion = (
LegacyStableDiffusionRecord
| LegacyTextGenerationRecord
| LegacyBlipRecord
| LegacyClipRecord
| LegacyCodeformerRecord
| LegacyControlnetRecord
| LegacyEsrganRecord
| LegacyGfpganRecord
| LegacyGenericRecord
| LegacySafetyCheckerRecord
| LegacyMiscellaneousRecord
)
LegacyConfigFile
Bases: BaseModel
A single legacy config file entry.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
content_hash
class-attribute
instance-attribute
The normalized tensor-region content hash of this component file (distinct from the whole-file
sha256sum): the cross-platform-stable identity used for cross-process sharing. None when unknown
or unhashable.
_ensure_sha256sum_for_model_files
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_serialize_without_none
LegacyConfigDownload
Bases: BaseModel
A single legacy config download entry.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_validate_download_fields
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_serialize_without_none
LegacyConfig
Bases: BaseModel
Typed representation of the legacy config payload.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
files
class-attribute
instance-attribute
download
class-attribute
instance-attribute
embedded_component_hashes
class-attribute
instance-attribute
Maps a component kind (vae, text_encoders) to the tensor-region content hash of that component
embedded in the primary checkpoint: the cross-platform-stable identity for cross-process sharing. None
when the model embeds no shareable component or is unhashable.
_coerce_config_dict
class-attribute
classmethod
instance-attribute
_normalize_entries
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
is_empty
Return True when no download entries survive normalization.
Note: files are always cleared during normalization (new format doesn't use them).
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_serialize_without_none
Drop None keys so an absent embedded_component_hashes is omitted, not emitted as null.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyGenericRecord
Bases: BaseModel
Base legacy record representation with shared validation rules.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyStableDiffusionRecord
Bases: LegacyGenericRecord
Stable Diffusion legacy record with category-specific validation.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
requirements
class-attribute
instance-attribute
requirements: (
dict[
str,
int
| float
| str
| list[int]
| list[float]
| list[str]
| bool,
]
| None
) = None
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_normalize_baseline
_validate_showcases
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_validate_stable_diffusion_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
sort_model_fields
Sort fields for consistent JSON output.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyTextGenerationRecord
Bases: LegacyGenericRecord
Text generation legacy record with category-specific validation.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
settings
class-attribute
instance-attribute
settings: (
dict[
str,
int
| float
| str
| list[int]
| list[float]
| list[str]
| bool,
]
| None
) = None
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_text_generation_rules
Validate text generation specific rules.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyBlipRecord
Bases: LegacyGenericRecord
BLIP legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyClipRecord
Bases: LegacyGenericRecord
CLIP legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyCodeformerRecord
Bases: LegacyGenericRecord
Codeformers legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyEsrganRecord
Bases: LegacyGenericRecord
ESRGAN legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyGfpganRecord
Bases: LegacyGenericRecord
GFPGAN legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacySafetyCheckerRecord
Bases: LegacyGenericRecord
Safety Checker legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyMiscellaneousRecord
Bases: LegacyGenericRecord
Miscellaneous legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
LegacyControlnetRecord
Bases: LegacyGenericRecord
ControlNet legacy record with category-specific normalization.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
type
instance-attribute
type: Literal[
"control_canny",
"control_depth",
"control_hed",
"control_mlsd",
"control_normal",
"control_openpose",
"control_fakescribbles",
"control_scribble",
"control_seg",
"control_qr",
"control_qr_xl",
"control_lineart",
"control_lineart_anime",
"control_normal_bae",
"control_recolor",
"control_tile",
]
model_config
class-attribute
instance-attribute
config
class-attribute
instance-attribute
features_not_supported
class-attribute
instance-attribute
_validate_common_rules
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_drop_none_keys
Serialize instance and drop keys whose value is None.
The legacy GitHub JSON omits absent optional fields entirely (e.g. a config file
entry with only path + sha256sum never carries md5sum/file_type).
Pydantic's default serialization emits those as null, which would pollute the
diff produced by the GitHub sync for newly added/modified models. Dropping None
keys keeps API-written records byte-compatible with the hand-authored legacy format
while preserving field order and any extra keys.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_record_issue
Append a validation issue message to the shared conversion context.
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
_increment_host_counter
Source code in src/horde_model_reference/legacy/classes/legacy_models.py
get_legacy_model_type
Get the appropriate Pydantic model class for a given category.