Skip to content

horde_sdk.ai_horde_api.apimodels.generate.rate

AestheticRating

Bases: HordeAPIObjectBaseModel

Represents an aesthetic rating for an image.

v2 API Model: AestheticRating

Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
class AestheticRating(HordeAPIObjectBaseModel):
    """Represents an aesthetic rating for an image.

    v2 API Model: `AestheticRating`
    """

    id_: str = Field(
        alias="id",
        description="The UUID of image being rated.",
    )
    """The UUID of image being rated."""

    rating: int
    """The aesthetic rating 1-10 for this image."""

    artifacts: int
    """The artifacts rating for this image.
    0 for flawless generation that perfectly fits to the prompt.
    1 for small, hardly recognizable flaws. 2 small flaws that can easily be spotted, but don not harm the aesthetic
    experience.
    3 for flaws that look obviously wrong, but only mildly harm the aesthetic experience.
    4 for flaws that look obviously wrong & significantly harm the aesthetic experience.
    5 for flaws that make the image look like total garbage."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return "AestheticRating"

id_ class-attribute instance-attribute

id_: str = Field(
    alias="id", description="The UUID of image being rated."
)

The UUID of image being rated.

rating instance-attribute

rating: int

The aesthetic rating 1-10 for this image.

artifacts instance-attribute

artifacts: int

The artifacts rating for this image. 0 for flawless generation that perfectly fits to the prompt. 1 for small, hardly recognizable flaws. 2 small flaws that can easily be spotted, but don not harm the aesthetic experience. 3 for flaws that look obviously wrong, but only mildly harm the aesthetic experience. 4 for flaws that look obviously wrong & significantly harm the aesthetic experience. 5 for flaws that make the image look like total garbage.

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return "AestheticRating"

AestheticsPayload

Bases: HordeAPIObjectBaseModel

Represents the payload for rating images.

v2 API Model: AestheticsPayload

Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
class AestheticsPayload(HordeAPIObjectBaseModel):
    """Represents the payload for rating images.

    v2 API Model: `AestheticsPayload`
    """

    best: str | None = None
    """The UUID of the best image in this generation batch (only used when 2+ images generated).
    If 2+ aesthetic ratings are also provided, then they take precedence if they're not tied."""

    ratings: list[AestheticRating]
    """The aesthetic ratings for each image in the batch."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return "AestheticsPayload"

best class-attribute instance-attribute

best: str | None = None

The UUID of the best image in this generation batch (only used when 2+ images generated). If 2+ aesthetic ratings are also provided, then they take precedence if they're not tied.

ratings instance-attribute

ratings: list[AestheticRating]

The aesthetic ratings for each image in the batch.

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return "AestheticsPayload"

RateResponse

Bases: HordeResponseBaseModel

The response to a rating submission, including the reward amount.

Represents the data returned from the /v2/generate/rate/{id} endpoint with http status code 200.

v2 API Model: GenerationSubmitted

Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
class RateResponse(HordeResponseBaseModel):
    """The response to a rating submission, including the reward amount.

    Represents the data returned from the /v2/generate/rate/{id} endpoint with http status code 200.

    v2 API Model: `GenerationSubmitted`
    """

    reward: float
    """The reward for the rating."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return "GenerationSubmitted"

reward instance-attribute

reward: float

The reward for the rating.

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return "GenerationSubmitted"

RateRequest

Bases: AestheticsPayload, BaseAIHordeRequest

Submit ratings for a batch of images.

Represents a POST request to the /v2/generate/rate/{id} endpoint.

v2 API Model: AestheticsPayload

Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@Unhashable
@Unequatable
class RateRequest(AestheticsPayload, BaseAIHordeRequest):
    """Submit ratings for a batch of images.

    Represents a POST request to the /v2/generate/rate/{id} endpoint.

    v2 API Model: `AestheticsPayload`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return "AestheticsPayload"

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.POST

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_generate_rate_id

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[RateResponse]:
        return RateResponse

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return "AestheticsPayload"

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.POST

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_generate_rate_id

get_default_success_response_type classmethod

get_default_success_response_type() -> type[RateResponse]
Source code in horde_sdk/ai_horde_api/apimodels/generate/rate.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[RateResponse]:
    return RateResponse