From bd64abe113523dc64be84a2327614fbcd0d5ce63 Mon Sep 17 00:00:00 2001 From: tazlin Date: Sun, 3 Nov 2024 12:47:34 -0500 Subject: [PATCH] feat: bare-bones 'style' api update support This just brings the testing up to the point of only failing on the unsupported/not yet added endpoints. See https://github.com/Haidra-Org/AI-Horde/pull/465 for more information. --- .../ai_horde_api/apimodels/_styles.md | 2 + ...response_field_names_and_descriptions.json | 21 ++++++ horde_sdk/ai_horde_api/apimodels/__init__.py | 2 + horde_sdk/ai_horde_api/apimodels/_styles.py | 19 ++++++ horde_sdk/ai_horde_api/apimodels/_users.py | 8 +++ .../ai_horde_api/apimodels/generate/_pop.py | 2 + .../apimodels/generate/text/_pop.py | 2 + horde_sdk/generic_api/utils/swagger.py | 7 +- .../_v2_collections_collection_id_patch.json | 8 +++ .../_v2_collections_post.json | 8 +++ .../_v2_generate_async_post.json | 19 +++--- .../_v2_generate_text_async_post.json | 9 +-- .../_v2_styles_image_post.json | 53 +++++++++++++++ ...age_style_id_example_example_id_patch.json | 4 ++ ...v2_styles_image_style_id_example_post.json | 4 ++ .../_v2_styles_image_style_id_patch.json | 53 +++++++++++++++ .../_v2_styles_text_post.json | 40 ++++++++++++ .../_v2_styles_text_style_id_patch.json | 40 ++++++++++++ ...ction_by_name_collection_name_get_200.json | 13 ++++ ..._collections_collection_id_delete_200.json | 3 + ..._v2_collections_collection_id_get_200.json | 13 ++++ ...2_collections_collection_id_patch_200.json | 10 +++ .../_v2_collections_get_200.json | 15 +++++ .../_v2_collections_post_200.json | 10 +++ .../_v2_find_user_get_200.json | 15 ++++- .../_v2_generate_pop_post_200.json | 17 ++--- .../_v2_generate_text_pop_post_200.json | 7 +- ...yles_image_by_name_style_name_get_200.json | 62 ++++++++++++++++++ .../_v2_styles_image_get_200.json | 64 +++++++++++++++++++ .../_v2_styles_image_post_200.json | 10 +++ .../_v2_styles_image_style_id_delete_200.json | 3 + ...tyle_id_example_example_id_delete_200.json | 3 + ...style_id_example_example_id_patch_200.json | 10 +++ ...tyles_image_style_id_example_post_200.json | 10 +++ .../_v2_styles_image_style_id_get_200.json | 62 ++++++++++++++++++ .../_v2_styles_image_style_id_patch_200.json | 10 +++ ...tyles_text_by_name_style_name_get_200.json | 42 ++++++++++++ .../_v2_styles_text_get_200.json | 44 +++++++++++++ .../_v2_styles_text_post_200.json | 10 +++ .../_v2_styles_text_style_id_delete_200.json | 3 + .../_v2_styles_text_style_id_get_200.json | 42 ++++++++++++ .../_v2_styles_text_style_id_patch_200.json | 10 +++ .../example_responses/_v2_users_get_200.json | 15 ++++- .../_v2_users_user_id_get_200.json | 15 ++++- 44 files changed, 791 insertions(+), 28 deletions(-) create mode 100644 docs/horde_sdk/ai_horde_api/apimodels/_styles.md create mode 100644 horde_sdk/ai_horde_api/apimodels/_styles.py create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_collections_collection_id_patch.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_collections_post.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_post.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_example_id_patch.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_post.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_patch.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_post.json create mode 100644 tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_style_id_patch.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collection_by_name_collection_name_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_delete_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_patch_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collections_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_collections_post_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_by_name_style_name_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_post_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_delete_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_delete_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_patch_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_post_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_patch_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_by_name_style_name_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_post_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_delete_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_get_200.json create mode 100644 tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_patch_200.json diff --git a/docs/horde_sdk/ai_horde_api/apimodels/_styles.md b/docs/horde_sdk/ai_horde_api/apimodels/_styles.md new file mode 100644 index 0000000..f879c89 --- /dev/null +++ b/docs/horde_sdk/ai_horde_api/apimodels/_styles.md @@ -0,0 +1,2 @@ +# _styles +::: horde_sdk.ai_horde_api.apimodels._styles diff --git a/docs/response_field_names_and_descriptions.json b/docs/response_field_names_and_descriptions.json index 815603f..8a98680 100644 --- a/docs/response_field_names_and_descriptions.json +++ b/docs/response_field_names_and_descriptions.json @@ -444,6 +444,13 @@ "int", "None" ] + }, + "styles": { + "description": "The styles this user has created.", + "types": [ + "list[horde_sdk.ai_horde_api.apimodels._styles.ResponseModelStylesUser]", + "None" + ] } }, "HordePerformanceResponse": { @@ -726,6 +733,13 @@ "list[str]", "None" ] + }, + "ttl": { + "description": "The amount of seconds before this job is considered stale and aborted.", + "types": [ + "int", + "None" + ] } }, "JobSubmitResponse": { @@ -1308,6 +1322,13 @@ "str", "None" ] + }, + "ttl": { + "description": "The amount of seconds before this job is considered stale and aborted.", + "types": [ + "int", + "None" + ] } }, "TextStatsModelResponse": { diff --git a/horde_sdk/ai_horde_api/apimodels/__init__.py b/horde_sdk/ai_horde_api/apimodels/__init__.py index 7ba9be4..305882d 100644 --- a/horde_sdk/ai_horde_api/apimodels/__init__.py +++ b/horde_sdk/ai_horde_api/apimodels/__init__.py @@ -44,6 +44,7 @@ NewsRequest, NewsResponse, ) +from horde_sdk.ai_horde_api.apimodels._styles import ResponseModelStylesUser from horde_sdk.ai_horde_api.apimodels._users import ( ActiveGenerations, ContributionsDetails, @@ -210,6 +211,7 @@ "Newspiece", "NewsRequest", "NewsResponse", + "ResponseModelStylesUser", "ListUsersDetailsRequest", "ListUsersDetailsResponse", "ModifyUser", diff --git a/horde_sdk/ai_horde_api/apimodels/_styles.py b/horde_sdk/ai_horde_api/apimodels/_styles.py new file mode 100644 index 0000000..2349cac --- /dev/null +++ b/horde_sdk/ai_horde_api/apimodels/_styles.py @@ -0,0 +1,19 @@ +from enum import auto + +from pydantic import Field +from strenum import StrEnum + +from horde_sdk.generic_api.apimodels import HordeAPIDataObject + + +class StyleType(StrEnum): + """An enum representing the different types of styles.""" + + image = auto() + text = auto() + + +class ResponseModelStylesUser(HordeAPIDataObject): + name: str + id_: str = Field(alias="id") + type_: StyleType = Field(alias="type") diff --git a/horde_sdk/ai_horde_api/apimodels/_users.py b/horde_sdk/ai_horde_api/apimodels/_users.py index 3e3cd6b..8ebb75a 100644 --- a/horde_sdk/ai_horde_api/apimodels/_users.py +++ b/horde_sdk/ai_horde_api/apimodels/_users.py @@ -3,6 +3,7 @@ from pydantic import Field, RootModel from typing_extensions import override +from horde_sdk.ai_horde_api.apimodels._styles import ResponseModelStylesUser from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest from horde_sdk.ai_horde_api.endpoints import AI_HORDE_API_ENDPOINT_SUBPATH from horde_sdk.ai_horde_api.fields import UUID_Identifier @@ -52,6 +53,9 @@ class UserKudosDetails(HordeAPIDataObject): recurring: float | None = Field(0) """The amount of Kudos this user has received from recurring rewards.""" + styled: float | None = Field(0) + """The amount of Kudos this user has received from styling images.""" + class MonthlyKudos(HordeAPIDataObject): amount: int | None = Field(default=None) @@ -85,6 +89,7 @@ class UserRecords(HordeAPIDataObject): fulfillment: UserAmountRecords | None = None request: UserAmountRecords | None = None usage: UserThingRecords | None = None + style: UserAmountRecords | None = None class UsageDetails(HordeAPIDataObject): @@ -264,6 +269,9 @@ def get_api_model_name(cls) -> str | None: """Whether this user has been invited to join a worker to the horde and how many of them. When 0, this user cannot add (new) workers to the horde.""" + styles: list[ResponseModelStylesUser] | None = None + """The styles this user has created.""" + @Unhashable @Unequatable diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_pop.py b/horde_sdk/ai_horde_api/apimodels/generate/_pop.py index 64d70b9..39b97f3 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_pop.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_pop.py @@ -232,6 +232,8 @@ class ImageGenerateJobPopResponse( """(Obsolete) The r2 upload link to use to upload this image.""" r2_uploads: list[str] | None = None """The r2 upload links for each this image. Each index matches the ID in self.ids""" + ttl: int | None = None + """The amount of seconds before this job is considered stale and aborted.""" @field_validator("source_processing") def source_processing_must_be_known(cls, v: str | KNOWN_SOURCE_PROCESSING) -> str | KNOWN_SOURCE_PROCESSING: diff --git a/horde_sdk/ai_horde_api/apimodels/generate/text/_pop.py b/horde_sdk/ai_horde_api/apimodels/generate/text/_pop.py index 164ee57..5143f01 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/text/_pop.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/text/_pop.py @@ -60,6 +60,8 @@ class TextGenerateJobPopResponse( """The soft prompt requested for this generation.""" model: str | None = Field(default=None) """The model requested for this generation.""" + ttl: int | None = None + """The amount of seconds before this job is considered stale and aborted.""" @field_validator("id_", mode="before") def validate_id(cls, v: str | JobID) -> JobID | str: diff --git a/horde_sdk/generic_api/utils/swagger.py b/horde_sdk/generic_api/utils/swagger.py index 538926a..3dd865a 100644 --- a/horde_sdk/generic_api/utils/swagger.py +++ b/horde_sdk/generic_api/utils/swagger.py @@ -449,7 +449,12 @@ def get_endpoint_method_examples( # Iterate through each defined response for the HTTP method. for http_status_code_str, response_definition in endpoint_method_definition.responses.items(): # Convert the HTTP status code string to an HTTPStatusCode object. - http_status_code_object = HTTPStatusCode(int(http_status_code_str)) + try: + http_status_code_object = HTTPStatusCode(int(http_status_code_str)) + except ValueError as e: + logger.error(f"Failed to convert {http_status_code_str} to an HTTPStatusCode object: {e}") + logger.error(f"response_definition: {response_definition}") + raise # Get the response example for this HTTP status code. example_response = self.get_response_example(response_definition) diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_collections_collection_id_patch.json b/tests/test_data/ai_horde_api/example_payloads/_v2_collections_collection_id_patch.json new file mode 100644 index 0000000..0082421 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_collections_collection_id_patch.json @@ -0,0 +1,8 @@ +{ + "name": "My Awesome Collection", + "info": "Collection of optimistic styles", + "public": true, + "styles": [ + "a" + ] +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_collections_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_collections_post.json new file mode 100644 index 0000000..0082421 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_collections_post.json @@ -0,0 +1,8 @@ +{ + "name": "My Awesome Collection", + "info": "Collection of optimistic styles", + "public": true, + "styles": [ + "a" + ] +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_async_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_async_post.json index 95f76a2..09c5584 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_async_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_async_post.json @@ -1,14 +1,12 @@ { "prompt": "a", "params": { - "sampler_name": "dpmsolver", + "sampler_name": "k_euler", "cfg_scale": 7.5, "denoising_strength": 0.75, "hires_fix_denoising_strength": 0.75, - "seed": "The little seed that could", "height": 512, "width": 512, - "seed_variation": 1, "post_processing": [ "GFPGAN" ], @@ -16,9 +14,6 @@ "tiling": false, "hires_fix": false, "clip_skip": 1, - "control_type": "canny", - "image_is_control": false, - "return_control_map": false, "facefixer_strength": 0.75, "loras": [ { @@ -41,14 +36,19 @@ "additionalProp2": {}, "additionalProp3": {} }, + "workflow": "qr_code", + "transparent": false, + "seed": "The little seed that could", + "seed_variation": 1, + "control_type": "canny", + "image_is_control": false, + "return_control_map": false, "extra_texts": [ { "text": "a", "reference": "aaa" } ], - "workflow": "qr_code", - "transparent": false, "steps": 30, "n": 1 }, @@ -81,5 +81,6 @@ "proxied_account": "", "disable_batching": false, "allow_downgrade": false, - "webhook": "https://haidra.net/00000000-0000-0000-0000-000000000000" + "webhook": "https://haidra.net/00000000-0000-0000-0000-000000000000", + "style": "00000000-0000-0000-0000-000000000000" } diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json index 7c75502..129d637 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json @@ -1,13 +1,10 @@ { "prompt": "", "params": { - "n": 1, "frmtadsnsp": false, "frmtrmblln": false, "frmtrmspch": false, "frmttriminc": false, - "max_context_length": 1024, - "max_length": 80, "rep_pen": 1.0, "rep_pen_range": 0.0, "rep_pen_slope": 0.0, @@ -28,7 +25,10 @@ "min_p": 0.0, "smoothing_factor": 0.0, "dynatemp_range": 0.0, - "dynatemp_exponent": 1.0 + "dynatemp_exponent": 1.0, + "n": 1, + "max_context_length": 1024, + "max_length": 80 }, "softprompt": "a", "trusted_workers": false, @@ -52,5 +52,6 @@ "disable_batching": false, "allow_downgrade": false, "webhook": "", + "style": "00000000-0000-0000-0000-000000000000", "extra_slow_workers": false } diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_post.json new file mode 100644 index 0000000..b95c443 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_post.json @@ -0,0 +1,53 @@ +{ + "name": "My Awesome Image Style", + "info": "photorealism excellence.", + "prompt": "{p}{np}", + "params": { + "sampler_name": "k_euler", + "cfg_scale": 7.5, + "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, + "height": 512, + "width": 512, + "post_processing": [ + "GFPGAN" + ], + "karras": false, + "tiling": false, + "hires_fix": false, + "clip_skip": 1, + "facefixer_strength": 0.75, + "loras": [ + { + "name": "Magnagothica", + "model": 1.0, + "clip": 1.0, + "inject_trigger": "a", + "is_version": false + } + ], + "tis": [ + { + "name": "7808", + "inject_ti": "prompt", + "strength": 1.0 + } + ], + "special": { + "additionalProp1": {}, + "additionalProp2": {}, + "additionalProp3": {} + }, + "workflow": "qr_code", + "transparent": false, + "steps": 30 + }, + "public": true, + "nsfw": false, + "tags": [ + "photorealistic" + ], + "models": [ + "stable_diffusion" + ] +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_example_id_patch.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_example_id_patch.json new file mode 100644 index 0000000..d9e3cea --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_example_id_patch.json @@ -0,0 +1,4 @@ +{ + "url": "https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp", + "primary": false +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_post.json new file mode 100644 index 0000000..d9e3cea --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_example_post.json @@ -0,0 +1,4 @@ +{ + "url": "https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp", + "primary": false +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_patch.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_patch.json new file mode 100644 index 0000000..bb6b805 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_image_style_id_patch.json @@ -0,0 +1,53 @@ +{ + "name": "My Awesome Image Style", + "info": "photorealism excellence.", + "prompt": "aaaaaaa", + "params": { + "sampler_name": "k_euler", + "cfg_scale": 7.5, + "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, + "height": 512, + "width": 512, + "post_processing": [ + "GFPGAN" + ], + "karras": false, + "tiling": false, + "hires_fix": false, + "clip_skip": 1, + "facefixer_strength": 0.75, + "loras": [ + { + "name": "Magnagothica", + "model": 1.0, + "clip": 1.0, + "inject_trigger": "a", + "is_version": false + } + ], + "tis": [ + { + "name": "7808", + "inject_ti": "prompt", + "strength": 1.0 + } + ], + "special": { + "additionalProp1": {}, + "additionalProp2": {}, + "additionalProp3": {} + }, + "workflow": "qr_code", + "transparent": false, + "steps": 30 + }, + "public": true, + "nsfw": false, + "tags": [ + "photorealistic" + ], + "models": [ + "stable_diffusion" + ] +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_post.json new file mode 100644 index 0000000..5849084 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_post.json @@ -0,0 +1,40 @@ +{ + "name": "My Awesome Text Style", + "info": "Dark, brooding vibes", + "prompt": "{p}", + "params": { + "frmtadsnsp": false, + "frmtrmblln": false, + "frmtrmspch": false, + "frmttriminc": false, + "rep_pen": 1.0, + "rep_pen_range": 0.0, + "rep_pen_slope": 0.0, + "singleline": false, + "temperature": 0.0, + "tfs": 0.0, + "top_a": 0.0, + "top_k": 0.0, + "top_p": 0.001, + "typical": 0.0, + "sampler_order": [ + 0 + ], + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], + "min_p": 0.0, + "smoothing_factor": 0.0, + "dynatemp_range": 0.0, + "dynatemp_exponent": 1.0 + }, + "public": true, + "nsfw": false, + "tags": [ + "dark" + ], + "models": [ + "llama3" + ] +} diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_style_id_patch.json b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_style_id_patch.json new file mode 100644 index 0000000..4e26f27 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_styles_text_style_id_patch.json @@ -0,0 +1,40 @@ +{ + "name": "My Awesome Text Style", + "info": "Dark, brooding vibes", + "prompt": "aaaaaaa", + "params": { + "frmtadsnsp": false, + "frmtrmblln": false, + "frmtrmspch": false, + "frmttriminc": false, + "rep_pen": 1.0, + "rep_pen_range": 0.0, + "rep_pen_slope": 0.0, + "singleline": false, + "temperature": 0.0, + "tfs": 0.0, + "top_a": 0.0, + "top_k": 0.0, + "top_p": 0.001, + "typical": 0.0, + "sampler_order": [ + 0 + ], + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], + "min_p": 0.0, + "smoothing_factor": 0.0, + "dynatemp_range": 0.0, + "dynatemp_exponent": 1.0 + }, + "public": true, + "nsfw": false, + "tags": [ + "dark" + ], + "models": [ + "llama3" + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collection_by_name_collection_name_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collection_by_name_collection_name_get_200.json new file mode 100644 index 0000000..2f91d08 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collection_by_name_collection_name_get_200.json @@ -0,0 +1,13 @@ +{ + "id": "", + "name": "a", + "type": "image", + "info": "a", + "public": true, + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_delete_200.json new file mode 100644 index 0000000..3a3319e --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_delete_200.json @@ -0,0 +1,3 @@ +{ + "message": "OK" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_get_200.json new file mode 100644 index 0000000..2f91d08 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_get_200.json @@ -0,0 +1,13 @@ +{ + "id": "", + "name": "a", + "type": "image", + "info": "a", + "public": true, + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_patch_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_patch_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collections_collection_id_patch_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collections_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collections_get_200.json new file mode 100644 index 0000000..2d2a387 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collections_get_200.json @@ -0,0 +1,15 @@ +[ + { + "id": "", + "name": "a", + "type": "image", + "info": "a", + "public": true, + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000" + } + ] + } +] diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_collections_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_collections_post_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_collections_post_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_find_user_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_find_user_get_200.json index 6e6b43a..a461c22 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_find_user_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_find_user_get_200.json @@ -13,12 +13,20 @@ "admin": 0, "received": 0, "recurring": 0, - "awarded": 0 + "awarded": 0, + "styled": 0 }, "worker_count": 0, "worker_ids": [ "00000000-0000-0000-0000-000000000000" ], + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000", + "type": "image" + } + ], "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], @@ -75,6 +83,11 @@ "image": 0, "text": 0, "interrogation": 0 + }, + "style": { + "image": 0, + "text": 0, + "interrogation": 0 } } } diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_pop_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_pop_post_200.json index b064f08..a608a73 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_pop_post_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_pop_post_200.json @@ -1,13 +1,11 @@ { "payload": { - "sampler_name": "k_dpm_adaptive", + "sampler_name": "k_euler", "cfg_scale": 7.5, "denoising_strength": 0.75, "hires_fix_denoising_strength": 0.75, - "seed": "The little seed that could", "height": 512, "width": 512, - "seed_variation": 1, "post_processing": [ "GFPGAN" ], @@ -15,9 +13,6 @@ "tiling": false, "hires_fix": false, "clip_skip": 1, - "control_type": "canny", - "image_is_control": false, - "return_control_map": false, "facefixer_strength": 0.75, "loras": [ { @@ -40,14 +35,19 @@ "additionalProp2": {}, "additionalProp3": {} }, + "workflow": "qr_code", + "transparent": false, + "seed": "The little seed that could", + "seed_variation": 1, + "control_type": "canny", + "image_is_control": false, + "return_control_map": false, "extra_texts": [ { "text": "a", "reference": "aaa" } ], - "workflow": "qr_code", - "transparent": false, "prompt": "", "ddim_steps": 30, "n_iter": 1, @@ -57,6 +57,7 @@ "ids": [ "00000000-0000-0000-0000-000000000000" ], + "ttl": 0, "skipped": { "worker_id": 0.0, "performance": 0.0, diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json index f130a20..dffb7e4 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json @@ -1,12 +1,9 @@ { "payload": { - "n": 1, "frmtadsnsp": false, "frmtrmblln": false, "frmtrmspch": false, "frmttriminc": false, - "max_context_length": 1024, - "max_length": 80, "rep_pen": 1.0, "rep_pen_range": 0.0, "rep_pen_slope": 0.0, @@ -28,12 +25,16 @@ "smoothing_factor": 0.0, "dynatemp_range": 0.0, "dynatemp_exponent": 1.0, + "n": 1, + "max_context_length": 1024, + "max_length": 80, "prompt": "" }, "id": "", "ids": [ "00000000-0000-0000-0000-000000000000" ], + "ttl": 0, "extra_source_images": [ { "image": "a", diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_by_name_style_name_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_by_name_style_name_get_200.json new file mode 100644 index 0000000..64d22ee --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_by_name_style_name_get_200.json @@ -0,0 +1,62 @@ +{ + "name": "My Awesome Image Style", + "info": "photorealism excellence.", + "prompt": "{p}{np}", + "params": { + "sampler_name": "k_euler", + "cfg_scale": 7.5, + "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, + "height": 512, + "width": 512, + "post_processing": [ + "GFPGAN" + ], + "karras": false, + "tiling": false, + "hires_fix": false, + "clip_skip": 1, + "facefixer_strength": 0.75, + "loras": [ + { + "name": "Magnagothica", + "model": 1.0, + "clip": 1.0, + "inject_trigger": "a", + "is_version": false + } + ], + "tis": [ + { + "name": "7808", + "inject_ti": "prompt", + "strength": 1.0 + } + ], + "special": { + "additionalProp1": {}, + "additionalProp2": {}, + "additionalProp3": {} + }, + "workflow": "qr_code", + "transparent": false, + "steps": 30 + }, + "public": true, + "nsfw": false, + "tags": [ + "photorealistic" + ], + "models": [ + "stable_diffusion" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1", + "examples": [ + { + "url": "https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp", + "primary": false, + "id": "00000000-0000-0000-0000-000000000000" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_get_200.json new file mode 100644 index 0000000..e3b00f1 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_get_200.json @@ -0,0 +1,64 @@ +[ + { + "name": "My Awesome Image Style", + "info": "photorealism excellence.", + "prompt": "{p}{np}", + "params": { + "sampler_name": "k_euler", + "cfg_scale": 7.5, + "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, + "height": 512, + "width": 512, + "post_processing": [ + "GFPGAN" + ], + "karras": false, + "tiling": false, + "hires_fix": false, + "clip_skip": 1, + "facefixer_strength": 0.75, + "loras": [ + { + "name": "Magnagothica", + "model": 1.0, + "clip": 1.0, + "inject_trigger": "a", + "is_version": false + } + ], + "tis": [ + { + "name": "7808", + "inject_ti": "prompt", + "strength": 1.0 + } + ], + "special": { + "additionalProp1": {}, + "additionalProp2": {}, + "additionalProp3": {} + }, + "workflow": "qr_code", + "transparent": false, + "steps": 30 + }, + "public": true, + "nsfw": false, + "tags": [ + "photorealistic" + ], + "models": [ + "stable_diffusion" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1", + "examples": [ + { + "url": "https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp", + "primary": false, + "id": "00000000-0000-0000-0000-000000000000" + } + ] + } +] diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_post_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_post_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_delete_200.json new file mode 100644 index 0000000..3a3319e --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_delete_200.json @@ -0,0 +1,3 @@ +{ + "message": "OK" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_delete_200.json new file mode 100644 index 0000000..3a3319e --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_delete_200.json @@ -0,0 +1,3 @@ +{ + "message": "OK" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_patch_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_patch_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_example_id_patch_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_post_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_example_post_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_get_200.json new file mode 100644 index 0000000..64d22ee --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_get_200.json @@ -0,0 +1,62 @@ +{ + "name": "My Awesome Image Style", + "info": "photorealism excellence.", + "prompt": "{p}{np}", + "params": { + "sampler_name": "k_euler", + "cfg_scale": 7.5, + "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, + "height": 512, + "width": 512, + "post_processing": [ + "GFPGAN" + ], + "karras": false, + "tiling": false, + "hires_fix": false, + "clip_skip": 1, + "facefixer_strength": 0.75, + "loras": [ + { + "name": "Magnagothica", + "model": 1.0, + "clip": 1.0, + "inject_trigger": "a", + "is_version": false + } + ], + "tis": [ + { + "name": "7808", + "inject_ti": "prompt", + "strength": 1.0 + } + ], + "special": { + "additionalProp1": {}, + "additionalProp2": {}, + "additionalProp3": {} + }, + "workflow": "qr_code", + "transparent": false, + "steps": 30 + }, + "public": true, + "nsfw": false, + "tags": [ + "photorealistic" + ], + "models": [ + "stable_diffusion" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1", + "examples": [ + { + "url": "https://lemmy.dbzer0.com/pictrs/image/c9915186-ca30-4f5a-873c-a91287fb4419.webp", + "primary": false, + "id": "00000000-0000-0000-0000-000000000000" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_patch_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_patch_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_image_style_id_patch_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_by_name_style_name_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_by_name_style_name_get_200.json new file mode 100644 index 0000000..0637d5a --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_by_name_style_name_get_200.json @@ -0,0 +1,42 @@ +{ + "name": "My Awesome Text Style", + "info": "Dark, brooding vibes", + "prompt": "{p}", + "params": { + "frmtadsnsp": false, + "frmtrmblln": false, + "frmtrmspch": false, + "frmttriminc": false, + "rep_pen": 1.0, + "rep_pen_range": 0.0, + "rep_pen_slope": 0.0, + "singleline": false, + "temperature": 0.0, + "tfs": 0.0, + "top_a": 0.0, + "top_k": 0.0, + "top_p": 0.001, + "typical": 0.0, + "sampler_order": [ + 0 + ], + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], + "min_p": 0.0, + "smoothing_factor": 0.0, + "dynatemp_range": 0.0, + "dynatemp_exponent": 1.0 + }, + "public": true, + "nsfw": false, + "tags": [ + "dark" + ], + "models": [ + "llama3" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_get_200.json new file mode 100644 index 0000000..0dcc4e4 --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_get_200.json @@ -0,0 +1,44 @@ +[ + { + "name": "My Awesome Text Style", + "info": "Dark, brooding vibes", + "prompt": "{p}", + "params": { + "frmtadsnsp": false, + "frmtrmblln": false, + "frmtrmspch": false, + "frmttriminc": false, + "rep_pen": 1.0, + "rep_pen_range": 0.0, + "rep_pen_slope": 0.0, + "singleline": false, + "temperature": 0.0, + "tfs": 0.0, + "top_a": 0.0, + "top_k": 0.0, + "top_p": 0.001, + "typical": 0.0, + "sampler_order": [ + 0 + ], + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], + "min_p": 0.0, + "smoothing_factor": 0.0, + "dynatemp_range": 0.0, + "dynatemp_exponent": 1.0 + }, + "public": true, + "nsfw": false, + "tags": [ + "dark" + ], + "models": [ + "llama3" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1" + } +] diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_post_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_post_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_delete_200.json new file mode 100644 index 0000000..3a3319e --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_delete_200.json @@ -0,0 +1,3 @@ +{ + "message": "OK" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_get_200.json new file mode 100644 index 0000000..0637d5a --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_get_200.json @@ -0,0 +1,42 @@ +{ + "name": "My Awesome Text Style", + "info": "Dark, brooding vibes", + "prompt": "{p}", + "params": { + "frmtadsnsp": false, + "frmtrmblln": false, + "frmtrmspch": false, + "frmttriminc": false, + "rep_pen": 1.0, + "rep_pen_range": 0.0, + "rep_pen_slope": 0.0, + "singleline": false, + "temperature": 0.0, + "tfs": 0.0, + "top_a": 0.0, + "top_k": 0.0, + "top_p": 0.001, + "typical": 0.0, + "sampler_order": [ + 0 + ], + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], + "min_p": 0.0, + "smoothing_factor": 0.0, + "dynatemp_range": 0.0, + "dynatemp_exponent": 1.0 + }, + "public": true, + "nsfw": false, + "tags": [ + "dark" + ], + "models": [ + "llama3" + ], + "id": "00000000-0000-0000-0000-000000000000", + "creator": "db0#1" +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_patch_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_patch_200.json new file mode 100644 index 0000000..f8255fb --- /dev/null +++ b/tests/test_data/ai_horde_api/example_responses/_v2_styles_text_style_id_patch_200.json @@ -0,0 +1,10 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "message": "", + "warnings": [ + { + "code": "NoAvailableWorker", + "message": "a" + } + ] +} diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_users_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_users_get_200.json index d21fd60..1de1f07 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_users_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_users_get_200.json @@ -14,12 +14,20 @@ "admin": 0, "received": 0, "recurring": 0, - "awarded": 0 + "awarded": 0, + "styled": 0 }, "worker_count": 0, "worker_ids": [ "00000000-0000-0000-0000-000000000000" ], + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000", + "type": "image" + } + ], "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], @@ -76,6 +84,11 @@ "image": 0, "text": 0, "interrogation": 0 + }, + "style": { + "image": 0, + "text": 0, + "interrogation": 0 } } } diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_users_user_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_users_user_id_get_200.json index 6e6b43a..a461c22 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_users_user_id_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_users_user_id_get_200.json @@ -13,12 +13,20 @@ "admin": 0, "received": 0, "recurring": 0, - "awarded": 0 + "awarded": 0, + "styled": 0 }, "worker_count": 0, "worker_ids": [ "00000000-0000-0000-0000-000000000000" ], + "styles": [ + { + "name": "db0#1::style::my awesome style", + "id": "00000000-0000-0000-0000-000000000000", + "type": "image" + } + ], "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], @@ -75,6 +83,11 @@ "image": 0, "text": 0, "interrogation": 0 + }, + "style": { + "image": 0, + "text": 0, + "interrogation": 0 } } }