horde_sdk.consts¶
Constants used by the SDK.
horde_sdk_github_url
module-attribute
¶
PAYLOAD_HTTP_METHODS
module-attribute
¶
UnknownServiceInfo
module-attribute
¶
UnknownServiceInfo = ServiceInfo(
known_identifier=KNOWN_SERVICE.UNKNOWN,
display_name="Unknown Service",
description="This service is not recognized.",
url=None,
)
CustomUnpublishedServiceInfo
module-attribute
¶
CustomUnpublishedServiceInfo = ServiceInfo(
known_identifier=KNOWN_SERVICE.CUSTOM_UNPUBLISHED,
display_name="Custom Unpublished Service",
description="This is a custom unpublished service.",
url=None,
)
AIHordeServiceInfo
module-attribute
¶
AIHordeServiceInfo = ServiceInfo(
known_identifier=KNOWN_SERVICE.AI_HORDE,
display_name="AI Horde",
description="AI Horde is a decentralized, crowd-sourced platform for AI model generation and more.",
url="https://aihorde.net",
)
CivitAIServiceInfo
module-attribute
¶
CivitAIServiceInfo = ServiceInfo(
known_identifier=KNOWN_SERVICE.CIVITAI,
display_name="CivitAI",
description="CivitAI is a platform for AI model hosting and deployment.",
url="https://civitai.com",
)
HTTPMethod ¶
Bases: StrEnum
An enum representing all HTTP methods.
Source code in horde_sdk/consts.py
HTTPStatusCode ¶
Bases: IntEnum
An enum representing all HTTP status codes.
Source code in horde_sdk/consts.py
KNOWN_DISPATCH_SOURCE ¶
Bases: StrEnum
The known sources of a dispatch.
Source code in horde_sdk/consts.py
UNKNOWN
class-attribute
instance-attribute
¶
The source of the dispatch is unknown.
LOCAL_CUSTOM_3RD_PARTY
class-attribute
instance-attribute
¶
The source of the dispatch is a local custom 3rd party API.
AI_HORDE_API_OFFICIAL
class-attribute
instance-attribute
¶
The source of the dispatch is the official AI Horde API.
AI_HORDE_API_FORK
class-attribute
instance-attribute
¶
The source of the dispatch is a fork of the official AI Horde API.
KNOWN_NSFW_DETECTOR ¶
Bases: StrEnum
The NSFW detectors that are known to the API.
Source code in horde_sdk/consts.py
BACKEND_DEFAULT
class-attribute
instance-attribute
¶
The default model for the worker backend.
HORDE_SAFETY
class-attribute
instance-attribute
¶
The AI-Horde horde_safety package.
COMPVIS_SAFETY_CHECKER
class-attribute
instance-attribute
¶
The compvis safety checker model released with stable diffusion.
WORKER_TYPE ¶
Bases: StrEnum
The worker types that are known.
(alchemy, image, text, etc...)
Source code in horde_sdk/consts.py
KNOWN_INFERENCE_BACKEND ¶
Bases: StrEnum
The known generative inference backends.
Source code in horde_sdk/consts.py
IN_MODEL_NAME
class-attribute
instance-attribute
¶
The model name is prepended with the backend name.
CUSTOM_UNPUBLISHED
class-attribute
instance-attribute
¶
The inference backend is a custom, unpublished backend.
HORDE_ALCHEMIST
class-attribute
instance-attribute
¶
The inference backend is the Horde Alchemist.
KOBOLD_CPP
class-attribute
instance-attribute
¶
The inference backend is Kobold CPP.
APHRODITE
class-attribute
instance-attribute
¶
The inference backend is Aphrodite.
KNOWN_ALCHEMY_BACKEND ¶
KNOWN_SERVICE ¶
Bases: StrEnum
The known services that can be used for generation.
Source code in horde_sdk/consts.py
CUSTOM_UNPUBLISHED
class-attribute
instance-attribute
¶
The service is a custom, unpublished service.
ServiceInfo ¶
Bases: BaseModel
Represents information about a service.
Source code in horde_sdk/consts.py
model_config
class-attribute
instance-attribute
¶
known_identifier
class-attribute
instance-attribute
¶
The known identifier for the service, if any.
display_name
class-attribute
instance-attribute
¶
The name of the service.
description
class-attribute
instance-attribute
¶
A description of the service.
get_default_frozen_model_config_dict ¶
Return the default horde-sdk frozen model config dict for a pydantic BaseModel.
Critically, models configured this way will behave differently when used in tests, preventing the use of extra fields being passed to constructors. However, this is not the case in production, where pass-through is allowed and up to implementors to choose to handle.
Source code in horde_sdk/consts.py
get_all_success_status_codes ¶
get_all_error_status_codes ¶
is_success_status_code ¶
Return True if the status code is a success code, False otherwise.
Source code in horde_sdk/consts.py
is_error_status_code ¶
Return True if the status code is an error code, False otherwise.
Source code in horde_sdk/consts.py
register_known_service_info ¶
Register a known service info.
Parameters:
-
service_info(ServiceInfo) –The service info to register.
Raises:
-
ValueError–If the service info is already registered.
Source code in horde_sdk/consts.py
get_known_service_info ¶
Get the known service info for a given service.
Parameters:
-
service(KNOWN_SERVICE) –The known service.
Returns:
-
ServiceInfo(ServiceInfo) –The service info for the given service.