horde_sdk.worker.feature_flags¶
RESULT_RETURN_METHOD ¶
Bases: StrEnum
The method of returning results from a worker.
Source code in horde_sdk/worker/feature_flags.py
base64_post_back
class-attribute
instance-attribute
¶
Base64 post back in the 'job completed' message.
base64_post_back_with_url
class-attribute
instance-attribute
¶
Base64 post back to a given URL without results in the 'job completed' message.
byte_stream
class-attribute
instance-attribute
¶
Byte stream to a given URL without results in the 'job completed' message.
local_write_to_file
class-attribute
instance-attribute
¶
Can write to the local filesystem for jobs originating locally or within a closed environment.
WorkerFeatureFlags ¶
Bases: ABC, BaseModel
Feature flags for a worker.
Source code in horde_sdk/worker/feature_flags.py
model_config
class-attribute
instance-attribute
¶
supported_result_return_methods
class-attribute
instance-attribute
¶
The methods of returning results supported by the worker.
supports_threads
class-attribute
instance-attribute
¶
Whether the worker supports threading.
is_capable_of_features ¶
Check if the worker is capable of handling the requested features.
Parameters:
-
features(GenerationFeatureFlags) –The features to check.
Returns:
-
bool(bool) –True if the worker is capable of handling the requested features, False otherwise.
Source code in horde_sdk/worker/feature_flags.py
get_not_capable_reason_type
abstractmethod
¶
Return the type of the reason for not being capable of handling the requested features.
Returns:
-
type[ReasonTypeVar]–type[ReasonTypeVar]: The (python) type of the reason for not being capable of handling the requested
-
type[ReasonTypeVar]–features.
Source code in horde_sdk/worker/feature_flags.py
reasons_not_capable_of_features
abstractmethod
¶
Return a list of reasons why the worker is not capable of handling the requested features.
Parameters:
-
features(GenerationFeatureFlags) –The features to check.
Returns:
-
list[ReasonTypeVar] | None–list[str] | None: A list of reasons why the worker is not capable of handling the requested features,
-
list[ReasonTypeVar] | None–or None if the worker is capable.
Source code in horde_sdk/worker/feature_flags.py
PerBaselineFeatureFlags ¶
Bases: BaseModel
Represents exhaustive baseline-specific restrictions on a worker feature profile.
None leaves the corresponding flat feature advertisement in effect. Once a map is supplied,
a missing baseline advertises no support for that feature on the omitted baseline.
Source code in horde_sdk/worker/feature_flags.py
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 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 227 228 229 | |
model_config
class-attribute
instance-attribute
¶
schedulers_map
class-attribute
instance-attribute
¶
schedulers_map: (
dict[
KNOWN_IMAGE_GENERATION_BASELINE | str,
list[KNOWN_IMAGE_SCHEDULERS | str],
]
| None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: [
KNOWN_IMAGE_SCHEDULERS.simple,
KNOWN_IMAGE_SCHEDULERS.normal,
KNOWN_IMAGE_SCHEDULERS.exponential,
],
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: [
KNOWN_IMAGE_SCHEDULERS.simple
],
}
],
)
If set, the supported schedulers for each baseline. If unset, it is assumed that all baselines support all schedulers.
A populated map is exhaustive: a baseline absent from it advertises support for no schedulers at
all, not for the flat schedulers list. A worker setting this map must therefore cover every
baseline it serves.
samplers_map
class-attribute
instance-attribute
¶
samplers_map: (
dict[
KNOWN_IMAGE_GENERATION_BASELINE | str,
list[KNOWN_IMAGE_SAMPLERS | str],
]
| None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: [
KNOWN_IMAGE_SAMPLERS.k_lms,
KNOWN_IMAGE_SAMPLERS.k_dpm_2,
KNOWN_IMAGE_SAMPLERS.k_euler,
],
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: [
KNOWN_IMAGE_SAMPLERS.k_lms
],
}
],
)
If set, the supported samplers for each baseline. If unset, it is assumed that all baselines support all samplers.
A populated map is exhaustive: a baseline absent from it advertises support for no samplers at
all, not for the flat samplers list. A worker setting this map must therefore cover every
baseline it serves.
tiling_map
class-attribute
instance-attribute
¶
tiling_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: False,
}
],
)
If set, the supported tiling for each baseline. If unset, it is assumed that all baselines follow the flat tiling flag. A populated map is exhaustive.
hires_fix_map
class-attribute
instance-attribute
¶
hires_fix_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: True,
KNOWN_IMAGE_GENERATION_BASELINE.flux_1: False,
}
],
)
If set, the supported hires fix for each baseline. If unset, it is assumed that all baselines follow the flat hires-fix flag. A populated map is exhaustive.
transparent_map
class-attribute
instance-attribute
¶
transparent_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_cascade: False,
}
],
)
If set, support for transparent generation for each baseline. If unset, all advertised baselines follow the flat transparent flag. A populated map is exhaustive.
controlnet_map
class-attribute
instance-attribute
¶
controlnet_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: False,
}
],
)
If set, support for controlnet for each baseline. If unset, it is assumed that all baselines follow the flat ControlNet feature flags. A populated map is exhaustive.
tis_map
class-attribute
instance-attribute
¶
tis_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: False,
}
],
)
If set, support for TIs for each baseline. If unset, it is assumed that all baselines support the advertised TI sources. A populated map is exhaustive.
loras_map
class-attribute
instance-attribute
¶
loras_map: (
dict[KNOWN_IMAGE_GENERATION_BASELINE | str, bool] | None
) = Field(
default=None,
examples=[
{
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_1: True,
KNOWN_IMAGE_GENERATION_BASELINE.stable_diffusion_xl: False,
}
],
)
If set, support for Loras for each baseline. If unset, it is assumed that all baselines support the advertised LoRA sources. A populated map is exhaustive.
IMAGE_WORKER_NOT_CAPABLE_REASON ¶
Bases: StrEnum
Reasons why a worker is not capable of handling a request.
Source code in horde_sdk/worker/feature_flags.py
clip_skip
class-attribute
instance-attribute
¶
The worker does not support clip skip.
samplers
class-attribute
instance-attribute
¶
The worker does not support the requested samplers.
sampler_solver_knobs
class-attribute
instance-attribute
¶
The worker does not support one or more requested sampler solver knobs.
flow_shift
class-attribute
instance-attribute
¶
The worker does not support model-specific flow shifting.
transparent
class-attribute
instance-attribute
¶
The worker does not support transparent image generation.
schedulers
class-attribute
instance-attribute
¶
The worker does not support the requested schedulers.
hires_fix
class-attribute
instance-attribute
¶
The worker does not support hires fix.
controlnets
class-attribute
instance-attribute
¶
The worker does not support controlnets.
extra_texts
class-attribute
instance-attribute
¶
The worker does not support extra texts.
extra_source_images
class-attribute
instance-attribute
¶
The worker does not support extra source images.
post_processing
class-attribute
instance-attribute
¶
The worker does not support one or more requested post-processors.
source_processing
class-attribute
instance-attribute
¶
The worker does not support the requested source-processing mode.
workflows
class-attribute
instance-attribute
¶
The worker does not support the requested workflow.
unsupported_baseline
class-attribute
instance-attribute
¶
The worker does not support the requested baseline.
unsupported_generation_type
class-attribute
instance-attribute
¶
The supplied requirements describe a different generation domain.
ImageWorkerFeatureFlags ¶
Bases: WorkerFeatureFlags[IMAGE_WORKER_NOT_CAPABLE_REASON]
Represents portable render features advertised by an image worker.
This profile does not describe model residency, resource fit, queue state, worker readiness, or
service policy. Consumers compose those constraints with is_capable_of_features.
Source code in horde_sdk/worker/feature_flags.py
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 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | |
image_generation_feature_flags
instance-attribute
¶
The image generation feature flags for the worker.
per_baseline_feature_flags
class-attribute
instance-attribute
¶
The per baseline feature flags for the worker. This includes the supported schedulers and samplers for each baseline.
backend_clip_skip_representation
class-attribute
instance-attribute
¶
The clip skip representation supported.
sampler_execution_contract_version
class-attribute
instance-attribute
¶
Cumulative SDK execution contract guaranteed by every backend path in this profile.
get_not_capable_reason_type ¶
reasons_not_capable_of_features ¶
reasons_not_capable_of_features(
requested_features: GenerationFeatureFlags,
) -> list[IMAGE_WORKER_NOT_CAPABLE_REASON] | None
Return reasons the advertised worker features do not cover a request.
Parameters:
-
requested_features(GenerationFeatureFlags) –Features required by one image generation.
Returns:
-
list[IMAGE_WORKER_NOT_CAPABLE_REASON] | None–The stable incompatibility reasons, or
Nonewhen every requirement is supported.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_samplers ¶
Return whether the worker supports every requested sampler.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_schedulers ¶
Return whether the worker supports every requested scheduler.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_tiling ¶
Return whether the worker supports tiling for every requested baseline.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_hires_fix ¶
Return whether the worker supports hires fix for every requested baseline.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_transparent ¶
Return whether the worker supports transparency for every requested baseline.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_controlnets ¶
Return whether the worker supports the requested ControlNet configuration.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_tis ¶
Return whether the worker supports every requested textual-inversion source.
Source code in horde_sdk/worker/feature_flags.py
worker_supports_requested_loras ¶
Return whether the worker supports every requested LoRA source.
Source code in horde_sdk/worker/feature_flags.py
ALCHEMY_WORKER_NOT_CAPABLE_REASON ¶
Bases: StrEnum
Reasons why a worker is not capable of handling an alchemy request.
Source code in horde_sdk/worker/feature_flags.py
unsupported_upscaler
class-attribute
instance-attribute
¶
The worker does not support a requested upscaler.
unsupported_facefixer
class-attribute
instance-attribute
¶
The worker does not support a requested facefixer.
unsupported_interrogator
class-attribute
instance-attribute
¶
The worker does not support a requested interrogator.
unsupported_caption_model
class-attribute
instance-attribute
¶
The worker does not support a requested caption model.
unsupported_nsfw_detector
class-attribute
instance-attribute
¶
The worker does not support a requested NSFW detector.
unsupported_vectorizer
class-attribute
instance-attribute
¶
The worker does not support image vectorization.
unsupported_annotation
class-attribute
instance-attribute
¶
The worker does not support controlnet annotation.
unsupported_misc
class-attribute
instance-attribute
¶
The worker does not support a requested miscellaneous feature.
unsupported_generation_type
class-attribute
instance-attribute
¶
The supplied requirements describe a different generation domain.
AlchemyWorkerFeatureFlags ¶
Bases: WorkerFeatureFlags[ALCHEMY_WORKER_NOT_CAPABLE_REASON]
Feature flags for an alchemy worker.
Source code in horde_sdk/worker/feature_flags.py
get_not_capable_reason_type ¶
reasons_not_capable_of_features ¶
reasons_not_capable_of_features(
request: GenerationFeatureFlags,
) -> list[ALCHEMY_WORKER_NOT_CAPABLE_REASON] | None
Return a list of reasons why a worker is not capable of handling an alchemy request.
Source code in horde_sdk/worker/feature_flags.py
union_image_worker_feature_flags ¶
union_image_worker_feature_flags(
profiles: Sequence[ImageWorkerFeatureFlags],
) -> ImageWorkerFeatureFlags
Return the axis-wise union of image worker profiles.
The operation preserves the meaning of exhaustive per-baseline maps. When any input restricts an axis, the union computes that axis independently for every advertised baseline. A flat input contributes its flat values only on its own baselines, and a missing baseline contributes no support. Correlations between separate axes are not representable by this model, so a heterogeneous union is not itself a routeability proof; callers must retain member identity or otherwise prove that emitted combinations are supported.
Parameters:
-
profiles(Sequence[ImageWorkerFeatureFlags]) –Canonical image worker profiles to combine.
Returns:
-
ImageWorkerFeatureFlags–One profile containing every independently advertised feature value.
Raises:
-
ValueError–If no profiles are supplied.