async_
AlchemyAsyncResponse
Bases: HordeResponseBaseModel, JobResponseMixin, ResponseRequiringFollowUpMixin, ContainsMessageResponseMixin
Represents the data returned from the /v2/interrogate/async endpoint with http status code 202.
v2 API Model: RequestInterrogationResponse
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.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_follow_up_returned_params
get_follow_up_default_request_type
classmethod
get_follow_up_request_types
classmethod
get_follow_up_failure_cleanup_request_type
classmethod
get_follow_up_extra_params
Return any additional information required from this response to submit a follow up request.
Source code in horde_sdk/generic_api/apimodels.py
get_follow_up_all_params
Return the required inf from this response to submit any follow up requests warranted from this response.
Note that this dict uses the alias field names (as seen on the API), not the python field names.
get_follow_up_failure_cleanup_params is not included.
This is used for context management.
Returns:
-
list[dict[str, object]]–list[dict[str, object]]: A list of dicts of parameter names and values for each follow up request.
Source code in horde_sdk/generic_api/apimodels.py
get_follow_up_failure_cleanup_params
Return any extra information required from this response to clean up after a failed follow up request.
Note that this dict uses the alias field names (as seen on the API), not the python field names.
This is used for context management.
Source code in horde_sdk/generic_api/apimodels.py
get_follow_up_failure_cleanup_request
Return the request for this response to clean up after a failed follow up request.
Source code in horde_sdk/generic_api/apimodels.py
ignore_failure
Return if the object is in a state which doesn't require failure follow up.
does_target_request_follow_up
Return whether the target_request would follow up on this request.
Parameters:
-
target_request(HordeRequest) –The request to check if it would follow up on this request.
Returns:
-
bool(bool) –Whether the
target_requestwould follow up on this request.
Source code in horde_sdk/generic_api/apimodels.py
validate_id
Ensure that the job ID is not empty.
Source code in horde_sdk/ai_horde_api/apimodels/base.py
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
AlchemyAsyncRequestFormItem
Bases: HordeAPIData
Represents a single form of alchemy to request.
See :class:horde_sdk.generation_parameters.alchemy.consts.KNOWN_ALCHEMY_TYPES for the list of
known alchemy types.
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.py
model_config
class-attribute
instance-attribute
validate_name
Validate the name of the form to request.
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.py
AlchemyAsyncRequest
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin
Data required to request an alchemy job. Alchemy includes upscaling, captioning, etc.
Multiple forms of alchemy can be requested at once.
See :class:horde_sdk.generation_parameters.alchemy.consts.KNOWN_ALCHEMY_TYPES for the list of
known alchemy types.
Represents a POST request to the /v2/interrogate/async endpoint.
v2 API Model: ModelInterrogationInputStable
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 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 | |
forms
instance-attribute
The list of forms (types of post-processing/interrogation/captioning/etc) to request.
source_image
instance-attribute
The public URL of the source image or a base64 string to use.
slow_workers
class-attribute
instance-attribute
Whether to use the slower workers. Costs additional kudos if False.
extra_slow_workers
class-attribute
instance-attribute
Whether to use the super slow workers.
webhook
class-attribute
instance-attribute
Provide a URL where the AI Horde will send a POST call after each delivered generation. The request will include the details of the job as well as the request ID.
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.
validate_at_least_one_form
validate_at_least_one_form(
v: list[AlchemyAsyncRequestFormItem],
) -> list[AlchemyAsyncRequestFormItem]
Ensure at least one form is provided.
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.py
validate_source_image
Validate the source image URL or base64 string.
Source code in horde_sdk/ai_horde_api/apimodels/alchemy/async_.py
get_api_model_name
classmethod
get_http_method
classmethod
get_api_endpoint_subpath
classmethod
get_default_success_response_type
classmethod
get_success_status_response_pairs
classmethod
get_number_of_results_expected
get_extra_fields_to_exclude_from_log
get_sensitive_fields
classmethod
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_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_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.