horde_sdk.ai_horde_api.apimodels.generate.pop¶
NoValidRequestFound ¶
Bases: HordeAPIObjectBaseModel
Base class for the number of jobs a worker skipped for, and why.
v2 API Model: NoValidRequestFound
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
blacklist
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a generation with a word that this worker does not accept.
bridge_version
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they require a higher version of the bridge than this worker is running (upgrade if you see this in your skipped list).
kudos
class-attribute
instance-attribute
¶
How many waiting requests were skipped because the user didn't have enough kudos when this worker requires
models
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a different model than what this worker provides.
nsfw
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a nsfw generation which this worker does not provide.
performance
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a higher performance than this worker provides.
untrusted
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a trusted worker which this worker is not.
worker_id
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a specific worker.
is_empty ¶
ImageGenerateJobPopSkippedStatus ¶
Bases: NoValidRequestFound
The number of jobs a worker was skipped for, and why.
v2 API Model: NoValidRequestFoundStable
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
max_pixels
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they demanded a higher size than this worker provides.
unsafe_ip
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they came from an unsafe IP.
img2img
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested img2img.
painting
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested inpainting/outpainting.
post_processing
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested post-processing.
lora
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested loras.
controlnet
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested a controlnet.
step_count
class-attribute
instance-attribute
¶
How many waiting requests were skipped because they requested more steps than this worker provides.
ImageGenerateJobPopPayload ¶
Bases: ImageGenerateParamMixin
Mixin for the additional image generation parameters used in dispatching a job to a worker.
v2 API Model: ModelPayloadRootStable
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
ExtraSourceImageMixin ¶
Bases: ResponseRequiringDownloadMixin
Mixin for jobs which have extra source images.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
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 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 221 222 223 224 225 226 | |
extra_source_images
class-attribute
instance-attribute
¶
Additional uploaded images (as base64) which can be used for further operations.
async_download_extra_source_images
async
¶
async_download_extra_source_images(
client_session: ClientSession, *, max_retries: int = 5
) -> list[ExtraSourceImageEntry] | None
Download the extra source images concurrently.
You can also use get_downloaded_extra_source_images to get the downloaded images later, if needed.
Parameters:
-
client_session(ClientSession) –The aiohttp client session to use for downloading.
-
max_retries(int, default:5) –The maximum number of times to retry downloading an image.
Returns:
-
list[ExtraSourceImageEntry] | None–The downloaded extra source images.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
get_downloaded_extra_source_images ¶
Get the downloaded extra source images.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
PopResponseModelMessage ¶
Bases: _ResponseModelMessageData
The message data which appears in a job pop response.
v2 API Model: _OVERLOADED_MODEL
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
ImageGenerateJobPopResponse ¶
Bases: HordeResponseBaseModel, ResponseRequiringFollowUpMixin, ExtraSourceImageMixin
Contains job data for workers, if any were available. Also contains data for jobs this worker was skipped for.
This is the key response type for all image workers as it contains all assignment data for the worker.
Represents the data returned from the /v2/generate/pop endpoint with http status code 200.
v2 API Model: GenerationPayloadStable
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 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 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |
id_
class-attribute
instance-attribute
¶
(Obsolete) The UUID for this image generation.
payload
instance-attribute
¶
The parameters used to generate this image.
skipped
class-attribute
instance-attribute
¶
skipped: ImageGenerateJobPopSkippedStatus = Field(
default_factory=ImageGenerateJobPopSkippedStatus
)
The reasons this worker was not issued certain jobs, and the number of jobs for each reason.
model
class-attribute
instance-attribute
¶
Which of the available models to use for this request.
source_image
class-attribute
instance-attribute
¶
The URL or Base64-encoded webp to use for img2img.
source_processing
class-attribute
instance-attribute
¶
If source_image is provided, specifies how to process it.
source_mask
class-attribute
instance-attribute
¶
If img_processing is set to 'inpainting' or 'outpainting', this parameter can be optionally provided as the mask of the areas to inpaint. If this arg is not passed, the inpainting/outpainting mask has to be embedded as alpha channel.
r2_upload
class-attribute
instance-attribute
¶
(Obsolete) The r2 upload link to use to upload this image.
r2_uploads
class-attribute
instance-attribute
¶
The r2 upload links for each this image. Each index matches the ID in self.ids
ttl
class-attribute
instance-attribute
¶
The amount of seconds before this job is considered stale and aborted.
messages
class-attribute
instance-attribute
¶
The messages that have been sent to this worker.
source_processing_must_be_known ¶
source_processing_must_be_known(
v: str | KNOWN_IMAGE_SOURCE_PROCESSING,
) -> str | KNOWN_IMAGE_SOURCE_PROCESSING
Ensure that the source processing is in this list of supported source processing.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
validate_id ¶
Validate the ID is not an empty string.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
validate_ids_present ¶
Ensure that either id_ or ids is present.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
get_api_model_name
classmethod
¶
get_follow_up_default_request_type
classmethod
¶
get_follow_up_failure_cleanup_request_type
classmethod
¶
get_follow_up_returned_params ¶
get_follow_up_failure_cleanup_params ¶
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
get_extra_fields_to_exclude_from_log ¶
ignore_failure ¶
get_downloaded_source_image ¶
get_downloaded_source_mask ¶
async_download_source_image ¶
Download the source image concurrently.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
async_download_source_mask ¶
Download the source mask concurrently.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
async_download_additional_data
async
¶
Download all additional images concurrently.
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
download_additional_data ¶
__eq__ ¶
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
__hash__ ¶
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
PopInput ¶
Bases: HordeAPIObjectBaseModel
The input data for a image worker requesting jobs.
v2 API Model: PopInput
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
amount
class-attribute
instance-attribute
¶
The number of jobs to pop at the same time.
bridge_agent
class-attribute
instance-attribute
¶
bridge_agent: str | None = Field(
"unknown:0:unknown",
examples=[
"AI Horde Worker reGen:4.1.0:https://github.com/Haidra-Org/horde-worker-reGen"
],
max_length=1000,
)
The worker name, version and website.
nsfw
class-attribute
instance-attribute
¶
Whether this worker can generate NSFW requests or not.
extra_slow_worker
class-attribute
instance-attribute
¶
If True, marks the worker as very slow. Extra slow workers are excluded from normal requests but users can opt in to use them.
priority_usernames
class-attribute
instance-attribute
¶
The usernames that should be prioritized by this worker.
sampler_execution_contract_version
class-attribute
instance-attribute
¶
Cumulative SDK sampler execution contract guaranteed by this worker process.
require_upfront_kudos
class-attribute
instance-attribute
¶
require_upfront_kudos: bool | None = Field(
default=False,
description="If True, this worker will only pick up requests where the owner has the required kudos to consume already available.",
examples=[False],
)
If True, this worker will only pick up requests where the owner has the required kudos to consume already available.
threads
class-attribute
instance-attribute
¶
threads: int | None = Field(
default=1,
description="How many threads this worker is running. This is used to accurately the current power available in the horde.",
ge=1,
le=50,
)
How many threads this worker is running. This is used to accurately the current power available in the horde.
ImageGenerateJobPopRequest ¶
Bases: BaseAIHordeRequest, APIKeyAllowedInRequestMixin, PopInput
Request additional jobs, if any are available, for an image worker.
This is the key request type for all image workers as it contains all the parameters needed to request a job.
Represents a POST request to the /v2/generate/pop endpoint.
v2 API Model: PopInputStable
Source code in horde_sdk/ai_horde_api/apimodels/generate/pop.py
bridge_version
class-attribute
instance-attribute
¶
The version of the bridge this worker is running.
max_pixels
class-attribute
instance-attribute
¶
The maximum number of pixels this worker can generate.
blacklist
class-attribute
instance-attribute
¶
The list of words this worker will not accept in a prompt.
allow_img2img
class-attribute
instance-attribute
¶
Whether this worker can generate img2img.
allow_painting
class-attribute
instance-attribute
¶
Whether this worker can generate inpainting/outpainting.
allow_unsafe_ipaddr
class-attribute
instance-attribute
¶
Whether this worker will generate from unsafe/VPN IP addresses.
allow_post_processing
class-attribute
instance-attribute
¶
Whether this worker can do post-processing.
allow_controlnet
class-attribute
instance-attribute
¶
Whether this worker can generate using controlnets.
allow_extended_controlnet
class-attribute
instance-attribute
¶
Whether this worker can generate using the extended controlnet control types.
allow_sdxl_controlnet
class-attribute
instance-attribute
¶
Whether this worker can generate using SDXL controlnets.
allow_lora
class-attribute
instance-attribute
¶
Whether this worker can generate using Loras.
limit_max_steps
class-attribute
instance-attribute
¶
Reject jobs whose guaranteed maximum sampler work exceeds the model-average budget.