Skip to content

shared

Shared model constants and enums used across multiple model categories.

_MODEL_STYLE_REGISTRY module-attribute

_MODEL_STYLE_REGISTRY = EnumRegistry(
    (value) for item in MODEL_STYLE
)

_KNOWN_TAGS_INITIAL module-attribute

_KNOWN_TAGS_INITIAL = (
    "anime",
    "manga",
    "cyberpunk",
    "tv show",
    "booru",
    "retro",
    "character",
    "hentai",
    "scenes",
    "low poly",
    "cg",
    "sketch",
    "high resolution",
    "landscapes",
    "comic",
    "cartoon",
    "painting",
    "game",
)

_TAG_REGISTRY module-attribute

_TAG_REGISTRY = EnumRegistry(_KNOWN_TAGS_INITIAL)

KNOWN_TAGS module-attribute

KNOWN_TAGS = mutable_values()

MODEL_STYLE

Bases: StrEnum

An enum of all the model styles.

Source code in src/horde_model_reference/model_consts/shared.py
class MODEL_STYLE(StrEnum):
    """An enum of all the model styles."""

    generalist = auto()
    anime = auto()
    furry = auto()
    artistic = auto()
    other = auto()
    realistic = auto()

generalist class-attribute instance-attribute

generalist = auto()

anime class-attribute instance-attribute

anime = auto()

furry class-attribute instance-attribute

furry = auto()

artistic class-attribute instance-attribute

artistic = auto()

other class-attribute instance-attribute

other = auto()

realistic class-attribute instance-attribute

realistic = auto()

register_model_style

register_model_style(style: MODEL_STYLE | str) -> None

Register a new model style.

Source code in src/horde_model_reference/model_consts/shared.py
def register_model_style(style: MODEL_STYLE | str) -> None:
    """Register a new model style."""
    _MODEL_STYLE_REGISTRY.register(style)

is_known_model_style

is_known_model_style(style: MODEL_STYLE | str) -> bool

Check if a model style is known.

Source code in src/horde_model_reference/model_consts/shared.py
def is_known_model_style(style: MODEL_STYLE | str) -> bool:
    """Check if a model style is known."""
    return _MODEL_STYLE_REGISTRY.is_known(style)

get_known_tags

get_known_tags() -> list[str]

Return a snapshot of all known tags as a list.

Source code in src/horde_model_reference/model_consts/shared.py
def get_known_tags() -> list[str]:
    """Return a snapshot of all known tags as a list."""
    return sorted(_TAG_REGISTRY.values())

register_tag

register_tag(tag: str | StrEnum) -> None

Register a new known tag.

Source code in src/horde_model_reference/model_consts/shared.py
def register_tag(tag: str | StrEnum) -> None:
    """Register a new known tag."""
    _TAG_REGISTRY.register(tag)

is_known_tag

is_known_tag(tag: str | StrEnum) -> bool

Check if a tag is known.

Source code in src/horde_model_reference/model_consts/shared.py
def is_known_tag(tag: str | StrEnum) -> bool:
    """Check if a tag is known."""
    return _TAG_REGISTRY.is_known(tag)