diff --git a/docs/request_field_names_and_descriptions.json b/docs/request_field_names_and_descriptions.json index 5465e95..bbcd9f9 100644 --- a/docs/request_field_names_and_descriptions.json +++ b/docs/request_field_names_and_descriptions.json @@ -113,6 +113,12 @@ "types": [ "bool" ] + }, + "extra_slow_workers": { + "description": "Whether to use the super slow workers.", + "types": [ + "bool" + ] } }, "AlchemyDeleteRequest": { @@ -443,6 +449,12 @@ "bool" ] }, + "extra_slow_workers": { + "description": "When True, allows extra slow workers to pick up this request.", + "types": [ + "bool" + ] + }, "workers": { "description": "A list of worker IDs to use for this request. If empty, any worker can pick up the request. Using this incurs\nand extra kudos cost.", "types": [ @@ -596,15 +608,13 @@ "models": { "description": "The models this worker can generate.", "types": [ - "list[str]", - "None" + "list[str]" ] }, "name": { "description": "The Name of the Worker.", "types": [ - "str", - "None" + "str" ] }, "nsfw": { @@ -714,6 +724,18 @@ "types": [ "bool" ] + }, + "extra_slow_worker": { + "description": "Marks the worker as extra slow.", + "types": [ + "bool" + ] + }, + "limit_max_steps": { + "description": "Prevents the worker picking up jobs with more steps than the model average.", + "types": [ + "bool" + ] } }, "ImageGenerateStatusRequest": { @@ -1192,6 +1214,12 @@ "bool" ] }, + "extra_slow_workers": { + "description": "When True, allows extra slow workers to pick up this request.", + "types": [ + "bool" + ] + }, "workers": { "description": "A list of worker IDs to use for this request. If empty, any worker can pick up the request. Using this incurs\nand extra kudos cost.", "types": [ @@ -1310,15 +1338,13 @@ "models": { "description": "The models this worker can generate.", "types": [ - "list[str]", - "None" + "list[str]" ] }, "name": { "description": "The Name of the Worker.", "types": [ - "str", - "None" + "str" ] }, "nsfw": { diff --git a/docs/response_field_names_and_descriptions.json b/docs/response_field_names_and_descriptions.json index 207d5fe..815603f 100644 --- a/docs/response_field_names_and_descriptions.json +++ b/docs/response_field_names_and_descriptions.json @@ -249,6 +249,13 @@ } }, "UserDetailsResponse": { + "active_generations": { + "description": "The active generations this user has requested.", + "types": [ + "horde_sdk.ai_horde_api.apimodels._users.ActiveGenerations", + "None" + ] + }, "admin_comment": { "description": "(Privileged) Comments from the horde admins about this user.", "types": [ diff --git a/horde_sdk/ai_horde_api/apimodels/__init__.py b/horde_sdk/ai_horde_api/apimodels/__init__.py index 8c9e52e..bb51a23 100644 --- a/horde_sdk/ai_horde_api/apimodels/__init__.py +++ b/horde_sdk/ai_horde_api/apimodels/__init__.py @@ -45,6 +45,7 @@ NewsResponse, ) from horde_sdk.ai_horde_api.apimodels._users import ( + ActiveGenerations, ContributionsDetails, ListUsersDetailsRequest, ListUsersDetailsResponse, @@ -181,6 +182,7 @@ "AIHordeGetTermsRequest", "DocumentFormat", "HordeDocument", + "ActiveGenerations", "ContributionsDetails", "FindUserRequest", "KudosTransferRequest", diff --git a/horde_sdk/ai_horde_api/apimodels/_users.py b/horde_sdk/ai_horde_api/apimodels/_users.py index ca72139..f730db3 100644 --- a/horde_sdk/ai_horde_api/apimodels/_users.py +++ b/horde_sdk/ai_horde_api/apimodels/_users.py @@ -5,6 +5,7 @@ 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 from horde_sdk.consts import _ANONYMOUS_MODEL, HTTPMethod from horde_sdk.generic_api.apimodels import ( APIKeyAllowedInRequestMixin, @@ -94,6 +95,21 @@ class UsageDetails(HordeAPIDataObject): """How many images this user has requested.""" +@Unhashable +@Unequatable +class ActiveGenerations(HordeAPIDataObject): + """A list of generations that are currently active for this user.""" + + text: list[UUID_Identifier] | None = None + """The IDs of the text generations that are currently active for this user.""" + + image: list[UUID_Identifier] | None = None + """The IDs of the image generations that are currently active for this user.""" + + alchemy: list[UUID_Identifier] | None = None + """The IDs of the alchemy generations that are currently active for this user.""" + + @Unhashable @Unequatable class UserDetailsResponse(HordeResponseBaseModel): @@ -102,6 +118,9 @@ class UserDetailsResponse(HordeResponseBaseModel): def get_api_model_name(cls) -> str | None: return "UserDetails" + active_generations: ActiveGenerations | None = None + """The active generations this user has requested.""" + admin_comment: str | None = Field( default=None, ) 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 4730732..95f76a2 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,9 +1,10 @@ { "prompt": "a", "params": { - "sampler_name": "k_dpm_fast", + "sampler_name": "dpmsolver", "cfg_scale": 7.5, "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, "seed": "The little seed that could", "height": 512, "width": 512, @@ -47,12 +48,15 @@ } ], "workflow": "qr_code", + "transparent": false, "steps": 30, "n": 1 }, "nsfw": false, "trusted_workers": false, + "validated_backends": true, "slow_workers": true, + "extra_slow_workers": false, "censor_nsfw": false, "workers": [ "" diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_pop_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_pop_post.json index 80f94de..71b6369 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_pop_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_pop_post.json @@ -11,6 +11,7 @@ "threads": 1, "require_upfront_kudos": false, "amount": 1, + "extra_slow_worker": true, "max_pixels": 262144, "blacklist": [ "" @@ -21,5 +22,6 @@ "allow_post_processing": true, "allow_controlnet": true, "allow_sdxl_controlnet": true, - "allow_lora": true + "allow_lora": true, + "limit_max_steps": true } 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 7220284..7c75502 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 @@ -32,6 +32,7 @@ }, "softprompt": "a", "trusted_workers": false, + "validated_backends": true, "slow_workers": true, "workers": [ "" @@ -50,5 +51,6 @@ ], "disable_batching": false, "allow_downgrade": false, - "webhook": "" + "webhook": "", + "extra_slow_workers": false } diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_pop_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_pop_post.json index 2bb3a82..6efdbff 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_pop_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_pop_post.json @@ -11,6 +11,7 @@ "threads": 1, "require_upfront_kudos": false, "amount": 1, + "extra_slow_worker": true, "max_length": 512, "max_context_length": 2048, "softprompts": [ 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 704497b..6e6b43a 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 @@ -22,6 +22,17 @@ "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], + "active_generations": { + "text": [ + "00000000-0000-0000-0000-000000000000" + ], + "image": [ + "00000000-0000-0000-0000-000000000000" + ], + "alchemy": [ + "00000000-0000-0000-0000-000000000000" + ] + }, "monthly_kudos": { "amount": 0, "last_received": "2021-01-01T00:00:00Z" 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 d6044ba..b064f08 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,8 +1,9 @@ { "payload": { - "sampler_name": "k_dpmpp_2m", + "sampler_name": "k_dpm_adaptive", "cfg_scale": 7.5, "denoising_strength": 0.75, + "hires_fix_denoising_strength": 0.75, "seed": "The little seed that could", "height": 512, "width": 512, @@ -46,6 +47,7 @@ } ], "workflow": "qr_code", + "transparent": false, "prompt": "", "ddim_steps": 30, "n_iter": 1, @@ -65,6 +67,7 @@ "bridge_version": 0, "kudos": 0, "max_pixels": 0, + "step_count": 0, "unsafe_ip": 0, "img2img": 0, "painting": 0, diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_status_news_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_status_news_get_200.json index ba53384..28208f8 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_status_news_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_status_news_get_200.json @@ -2,6 +2,13 @@ { "date_published": "", "newspiece": "", - "importance": "Information" + "importance": "Information", + "tags": [ + "" + ], + "title": "", + "more_info_urls": [ + "" + ] } ] 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 f2ac293..d21fd60 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 @@ -1,5 +1,5 @@ [ - { + { "username": "", "id": 0, "kudos": 0.0, @@ -23,6 +23,17 @@ "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], + "active_generations": { + "text": [ + "00000000-0000-0000-0000-000000000000" + ], + "image": [ + "00000000-0000-0000-0000-000000000000" + ], + "alchemy": [ + "00000000-0000-0000-0000-000000000000" + ] + }, "monthly_kudos": { "amount": 0, "last_received": "2021-01-01T00:00:00Z" 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 704497b..6e6b43a 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 @@ -22,6 +22,17 @@ "sharedkey_ids": [ "00000000-0000-0000-0000-000000000000" ], + "active_generations": { + "text": [ + "00000000-0000-0000-0000-000000000000" + ], + "image": [ + "00000000-0000-0000-0000-000000000000" + ], + "alchemy": [ + "00000000-0000-0000-0000-000000000000" + ] + }, "monthly_kudos": { "amount": 0, "last_received": "2021-01-01T00:00:00Z"