styles
StyleType
Bases: StrEnum
An enum representing the different types of styles.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
ResponseModelStylesUser
Bases: HordeAPIObjectBaseModel
Represents a style created by a user.
v2 API Model: ResponseModelStylesUser
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
type_
class-attribute
instance-attribute
The type of the style.
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
StyleExample
Bases: HordeAPIObjectBaseModel
Represents an example of an image generated by a style.
v2 API Model: StyleExample
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
url
class-attribute
instance-attribute
url: str = Field(
examples=[
"https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp"
]
)
The URL of the image generated by this style.
primary
class-attribute
instance-attribute
When true this image is to be used as the primary example for this style.
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
ModelStyleInputParamsStable
Bases: _BaseImageGenerateParamMixin
The default parameters to use for all generations using a particular style.
v2 API Model: ModelStyleInputParamsStable
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
steps
class-attribute
instance-attribute
The number of steps to use for the generation.
model_config
class-attribute
instance-attribute
height
class-attribute
instance-attribute
The desired output image height.
width
class-attribute
instance-attribute
The desired output image width.
sampler_name
class-attribute
instance-attribute
The sampler to use for this generation. Defaults to KNOWN_IMAGE_SAMPLERS.k_lms.
karras
class-attribute
instance-attribute
Set to True if you want to use the Karras scheduling.
cfg_scale
class-attribute
instance-attribute
The cfg_scale to use for this generation. Defaults to 7.5.
denoising_strength
class-attribute
instance-attribute
The denoising strength to use for this generation. Defaults to 1.
clip_skip
class-attribute
instance-attribute
The number of clip layers to skip.
post_processing
class-attribute
instance-attribute
post_processing: list[
str
| KNOWN_UPSCALERS
| KNOWN_FACEFIXERS
| KNOWN_MISC_POST_PROCESSORS
] = Field(default_factory=list)
A list of post-processing models to use.
post_processing_order
class-attribute
instance-attribute
The order in which to apply post-processing models. Applying upscalers or removing backgrounds before facefixers costs less kudos.
facefixer_strength
class-attribute
instance-attribute
The strength of the facefixer model.
hires_fix
class-attribute
instance-attribute
Set to True if you want to use the hires fix.
hires_fix_denoising_strength
class-attribute
instance-attribute
The strength of the denoising for the hires fix second pass.
loras
class-attribute
instance-attribute
A list of lora parameters to use.
tis
class-attribute
instance-attribute
A list of textual inversion (embedding) parameters to use.
workflow
class-attribute
instance-attribute
The specific comfyUI workflow to use.
transparent
class-attribute
instance-attribute
When true, will generate an image with a transparent background
tiling
class-attribute
instance-attribute
Set to True if you want to use seamless tiling.
special
class-attribute
instance-attribute
Reserved for future use.
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
post_processors_must_be_known
post_processors_must_be_known(
v: list[
str
| KNOWN_UPSCALERS
| KNOWN_FACEFIXERS
| KNOWN_MISC_POST_PROCESSORS
],
) -> list[
str
| KNOWN_UPSCALERS
| KNOWN_FACEFIXERS
| KNOWN_MISC_POST_PROCESSORS
]
Ensure that the post processors are in this list of supported post processors.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
sampler_name_must_be_known
Ensure that the sampler name is in this list of supported samplers.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
StyleStable
Bases: HordeResponseBaseModel, _StyleResponseMixin
The details of a style, including its parameters and examples.
Represents the data returned from the following endpoints and http status codes
- /v2/styles/image_by_name/{style_name} | SingleStyleImageByNameRequest [GET] -> 200
- /v2/styles/image/{style_id} | SingleStyleImageByIDRequest [GET] -> 200
v2 API Model: StyleStable
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
class-attribute
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
examples
class-attribute
instance-attribute
A list of examples of images generated by this style.
shared_key
class-attribute
instance-attribute
The shared key backing this style, if any.
model_config
class-attribute
instance-attribute
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
id_
class-attribute
instance-attribute
The UUID of the style. Use this to use the style or retrieve its information in the future.
creator
class-attribute
instance-attribute
The alias of the user which created this style.
use_count
class-attribute
instance-attribute
The amount of times this style has been used in generations.
sharedkey
class-attribute
instance-attribute
sharedkey: str | None = Field(
default=None,
examples=["00000000-0000-0000-0000-000000000000"],
min_length=36,
max_length=36,
)
The UUID of a shared key which will be used to fulfil this style when active.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
AllStylesImageResponse
Bases: HordeResponseRootModel[list[StyleStable]]
The a list of styles.
Represents the data returned from the /v2/styles/image endpoint with http status code 200.
v2 API Model: _ANONYMOUS_MODEL
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
AllStylesImageRequest
Bases: BaseAIHordeRequest
Request to get image styles. Use page to paginate through the results.
Represents a GET request to the /v2/styles/image endpoint.
v2 API Model: _ANONYMOUS_MODEL
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
sort
class-attribute
instance-attribute
The sort order of the styles.
page
class-attribute
instance-attribute
The page of styles to retrieve. Each page has 25 styles.
tag
class-attribute
instance-attribute
If specified, return only styles with this tag.
model
class-attribute
instance-attribute
If specified, return only styles which use this model.
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_query_fields
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SingleStyleImageByIDRequest
Bases: BaseAIHordeRequest
Request to get a single image style by its ID.
Represents a GET request to the /v2/styles/image/{style_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SingleStyleImageByNameRequest
Bases: BaseAIHordeRequest
Request to get a single image style by its name.
Represents a GET request to the /v2/styles/image_by_name/{style_name} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
ModifyStyleImageResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin, ContainsWarningsResponseMixin
The response to modifying an image style, including any warnings.
Represents the data returned from the following endpoints and http status codes
- /v2/styles/image/{style_id} | ModifyStyleImageRequest [PATCH] -> 200
- /v2/styles/image | CreateStyleImageRequest [POST] -> 200
v2 API Model: StyleModify
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
warnings
class-attribute
instance-attribute
A list of warnings from the API. This is typically an error or warning message, but may also be informational.
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
CreateStyleImageRequest
Bases: _StyleMixin, BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a POST request to the /v2/styles/image endpoint.
v2 API Model: ModelStyleInputStable
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
sharedkey
class-attribute
instance-attribute
sharedkey: str | None = Field(
default=None,
examples=["00000000-0000-0000-0000-000000000000"],
min_length=36,
max_length=36,
)
The UUID of a shared key which will be used to fulfil this style when active.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
is_api_key_required
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
ModifyStyleImageRequest
Bases: _StyleMixin, BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a PATCH request to the /v2/styles/image/{style_id} endpoint.
v2 API Model: ModelStylePatchStable
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
sharedkey
class-attribute
instance-attribute
sharedkey: str | None = Field(
examples=["00000000-0000-0000-0000-000000000000"],
min_length=36,
max_length=36,
)
The UUID of a shared key which will be used to fulfil this style when active.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
is_api_key_required
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
DeleteStyleImageResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin
Indicates that a style was successfully deleted.
Represents the data returned from the /v2/styles/image/{style_id} endpoint with http status code 200.
v2 API Model: SimpleResponse
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
DeleteStyleImageRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a DELETE request to the /v2/styles/image/{style_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
StyleImageExampleModifyResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin, ContainsWarningsResponseMixin
The response to modifying an image style example, including any warnings.
Represents the data returned from the following endpoints and http status codes
- /v2/styles/image/{style_id}/example/{example_id} | StyleImageExampleModifyRequest [PATCH] -> 200
- /v2/styles/image/{style_id}/example | StyleImageExampleAddRequest [POST] -> 200
v2 API Model: StyleModify
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
warnings
class-attribute
instance-attribute
A list of warnings from the API. This is typically an error or warning message, but may also be informational.
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
StyleImageExampleAddRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a POST request to the /v2/styles/image/{style_id}/example endpoint.
v2 API Model: InputStyleExamplePost
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
primary
class-attribute
instance-attribute
When true this image is to be used as the primary example for this style.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
StyleImageExampleDeleteResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin
Indicates that an example was successfully deleted.
Represents the data returned from the /v2/styles/image/{style_id}/example/{example_id} endpoint with http status code 200.
v2 API Model: SimpleResponse
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
StyleImageExampleDeleteRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a DELETE request to the /v2/styles/image/{style_id}/example/{example_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
StyleImageExampleModifyRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Represents a PATCH request to the /v2/styles/image/{style_id}/example/{example_id} endpoint.
v2 API Model: InputStyleExamplePost
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
primary
class-attribute
instance-attribute
When true this image is to be used as the primary example for this style.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
is_api_key_required
classmethod
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
ModelStyleInputParamsKobold
Bases: HordeResponseBaseModel, _BasePayloadKoboldMixin
The parameters than can be set for a text generation style.
v2 API Model: ModelStyleInputParamsKobold
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
dynatemp_exponent
class-attribute
instance-attribute
Dynamic temperature exponent value.
dynatemp_range
class-attribute
instance-attribute
Dynamic temperature range value.
frmtadsnsp
class-attribute
instance-attribute
frmtadsnsp: bool | None = Field(
default=None,
description="Input formatting option. When enabled, adds a leading space to your input if there is no trailing whitespace at the end of the previous action.",
examples=[False],
)
Input formatting option. When enabled, adds a leading space to your input if there is no trailing whitespace at the end of the previous action.
frmtrmblln
class-attribute
instance-attribute
frmtrmblln: bool | None = Field(
default=None,
description="Output formatting option. When enabled, replaces all occurrences of two or more consecutive newlines in the output with one newline.",
examples=[False],
)
Output formatting option. When enabled, replaces all occurrences of two or more consecutive newlines in the output with one newline.
frmtrmspch
class-attribute
instance-attribute
Output formatting option. When enabled, removes #/@%}{+=~|\^<> from the output.
frmttriminc
class-attribute
instance-attribute
frmttriminc: bool | None = Field(
default=None,
description="Output formatting option. When enabled, removes some characters from the end of the output such that the output doesn't end in the middle of a sentence. If the output is less than one sentence long, does nothing.",
examples=[False],
)
Output formatting option. When enabled, removes some characters from the end of the output such that the output doesn't end in the middle of a sentence. If the output is less than one sentence long, does nothing.
min_p
class-attribute
instance-attribute
Min-p sampling value.
rep_pen
class-attribute
instance-attribute
Base repetition penalty value.
rep_pen_range
class-attribute
instance-attribute
Repetition penalty range.
rep_pen_slope
class-attribute
instance-attribute
Repetition penalty slope.
sampler_order
class-attribute
instance-attribute
The sampler order to use for the generation.
singleline
class-attribute
instance-attribute
singleline: bool | None = Field(
default=None,
description="Output formatting option. When enabled, removes everything after the first line of the output, including the newline.",
examples=[False],
)
Output formatting option. When enabled, removes everything after the first line of the output, including the newline.
smoothing_factor
class-attribute
instance-attribute
Quadratic sampling value.
stop_sequence
class-attribute
instance-attribute
The stop sequences to use for the generation.
temperature
class-attribute
instance-attribute
Temperature value.
tfs
class-attribute
instance-attribute
Tail free sampling value.
top_a
class-attribute
instance-attribute
Top-a sampling value.
top_k
class-attribute
instance-attribute
Top-k sampling value.
top_p
class-attribute
instance-attribute
Top-p sampling value.
typical
class-attribute
instance-attribute
Typical sampling value.
use_default_badwordsids
class-attribute
instance-attribute
When True, uses the default KoboldAI bad word IDs.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
StyleKobold
Bases: HordeResponseBaseModel, _StyleResponseMixin
The details of a text style, including its parameters.
Represents the data returned from the following endpoints and http status codes
- /v2/styles/text_by_name/{style_name} | SingleStyleTextByNameRequest [GET] -> 200
- /v2/styles/text/{style_id} | SingleStyleTextByIDRequest [GET] -> 200
v2 API Model: StyleKobold
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
class-attribute
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
model_config
class-attribute
instance-attribute
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
id_
class-attribute
instance-attribute
The UUID of the style. Use this to use the style or retrieve its information in the future.
creator
class-attribute
instance-attribute
The alias of the user which created this style.
use_count
class-attribute
instance-attribute
The amount of times this style has been used in generations.
sharedkey
class-attribute
instance-attribute
sharedkey: str | None = Field(
default=None,
examples=["00000000-0000-0000-0000-000000000000"],
min_length=36,
max_length=36,
)
The UUID of a shared key which will be used to fulfil this style when active.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
AllStylesTextResponse
Bases: HordeResponseRootModel[list[StyleKobold]]
A list of text styles.
Represents the data returned from the /v2/styles/text endpoint with http status code 200.
v2 API Model: _ANONYMOUS_MODEL
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
time_constructed
property
The time the model was constructed (in epoch time).
model_config
class-attribute
instance-attribute
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
AllStylesTextRequest
Bases: BaseAIHordeRequest
Request to get text styles. Use page to paginate through the results.
Represents a GET request to the /v2/styles/text endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
sort
class-attribute
instance-attribute
The sort order of the styles.
page
class-attribute
instance-attribute
The page of styles to retrieve. Each page has 25 styles.
tag
class-attribute
instance-attribute
If specified, return only styles with this tag.
model
class-attribute
instance-attribute
If specified, return only styles which use this model.
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_query_fields
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SingleStyleTextByIDRequest
Bases: BaseAIHordeRequest
Request to get a single text style by its ID.
Represents a GET request to the /v2/styles/text/{style_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
SingleStyleTextByNameRequest
Bases: BaseAIHordeRequest
Request to get a single text style by its name.
Represents a GET request to the /v2/styles/text_by_name/{style_name} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
ModifyStyleTextResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin, ContainsWarningsResponseMixin
The response to modifying a text style, including any warnings.
Represents the data returned from the following endpoints and http status codes
- /v2/styles/text/{style_id} | ModifyStyleTextRequest [PATCH] -> 200
- /v2/styles/text | CreateStyleTextRequest [POST] -> 200
v2 API Model: StyleModify
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
warnings
class-attribute
instance-attribute
A list of warnings from the API. This is typically an error or warning message, but may also be informational.
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
CreateStyleTextRequest
Bases: BaseAIHordeRequest, _StyleMixin, APIKeyAllowedInRequestMixin
Request to create a new text style with the given parameters.
Represents a POST request to the /v2/styles/text endpoint.
v2 API Model: ModelStyleInputKobold
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
is_api_key_required
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
ModifyStyleTextRequest
Bases: BaseAIHordeRequest, _StyleMixin, APIKeyAllowedInRequestMixin
Represents a PATCH request to the /v2/styles/text/{style_id} endpoint.
v2 API Model: ModelStylePatchKobold
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
params
instance-attribute
The parameters to use for all generations using this style, if not set by the user.
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
info
class-attribute
instance-attribute
Extra information or comments about this style provided by its creator.
prompt
instance-attribute
The prompt template which will be sent to generate an image.
The user's prompt will be injected into this. This argument MUST include a '{p}' which specifies the part where the user's prompt will be injected and an '{np}' where the user's negative prompt will be injected (if any)
public
class-attribute
instance-attribute
When true this style will be listed among all styles publicly.
When false, information about this style can only be seen by people who know its ID or name.
nsfw
class-attribute
instance-attribute
When true, it signified this style is expected to generate NSFW images primarily.
tags
class-attribute
instance-attribute
Tags associated with this style.
models
class-attribute
instance-attribute
The models which this style will attempt to use.
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
is_api_key_required
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.
Source code in horde_sdk/generic_api/apimodels.py
DeleteStyleTextResponse
Bases: HordeResponseBaseModel, ContainsMessageResponseMixin
Indicates that a style was successfully deleted.
Represents the data returned from the /v2/styles/text/{style_id} endpoint with http status code 200.
v2 API Model: SimpleResponse
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
message
class-attribute
instance-attribute
A message from the API. This is typically an error or warning message, but may also be informational.
time_constructed
property
The time the model was constructed (in epoch time).
get_api_model_name
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
DeleteStyleTextRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Request to delete a text style by its ID.
Note that this is a privileged operation and requires the API key that created the style or admin/moderator privileges.
Represents a DELETE request to the /v2/styles/text/{style_id} endpoint.
Source code in horde_sdk/ai_horde_api/apimodels/styles.py
model_config
class-attribute
instance-attribute
apikey
class-attribute
instance-attribute
Defaults to ANON_API_KEY. See also .is_api_key_required()
accept
class-attribute
instance-attribute
The 'accept' header field.
client_agent
class-attribute
instance-attribute
The requesting client's agent. You should set this to reflect the name, version and contact information for your client.
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
is_api_key_required
classmethod
get_sensitive_fields
classmethod
get_extra_fields_to_exclude_from_log
Return an additional set of fields to exclude from the log_safe_model_dump method.
log_safe_model_dump
Return a dict of the model's fields, with any sensitive fields redacted.
Source code in horde_sdk/generic_api/apimodels.py
validate_api_key_length
Validate that the API key is the correct length, or is the special ANON_API_KEY.
Source code in horde_sdk/generic_api/apimodels.py
get_api_endpoint_url
classmethod
Return the endpoint URL, including the path to the specific API action defined by this object.
Source code in horde_sdk/generic_api/apimodels.py
get_api_url
classmethod
get_success_status_response_pairs
classmethod
Return a dict of HTTP status codes and the expected HordeResponse.
Defaults to {HTTPStatusCode.OK: cls.get_expected_response_type()}, but may be overridden to support other
status codes.
Source code in horde_sdk/generic_api/apimodels.py
get_header_fields
classmethod
Return a list of field names from this request object that should be sent as header fields.
This is in addition to GenericHeaderFields's values, and possibly the API specific class
which inherits from GenericHeaderFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_query_fields
classmethod
Return a list of field names from this request object that should be sent as query parameters.
This is in addition to GenericQueryFields's values, and possibly the API specific class
which inherits from GenericQueryFields, typically found in the horde_sdk.<api_name>_api.metadata module.
Source code in horde_sdk/generic_api/apimodels.py
get_number_of_results_expected
Return the number of (job) results expected from this request.
Defaults to 1, but may be overridden to dynamically change the number of results expected.
This is factored into context management; if the number of results expected is not met, the job is considered unhandled on an exception and followed up on to attempt to close it.
Source code in horde_sdk/generic_api/apimodels.py
get_requires_follow_up
Return whether this request requires a follow up request(s).
Returns:
-
bool(bool) –Whether this request requires a follow up request to close the job on the server.