diff --git a/CHANGELOG.md b/CHANGELOG.md index b0803755..01efb0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# 4.34.1 + +* fix missing `allow_downgrade` doc from the API +* Add extra horde tax per extra source image + # 4.34.0 * Adds support for Stable Cascade img2img diff --git a/horde/apis/models/kobold_v2.py b/horde/apis/models/kobold_v2.py index 75060426..de5526a5 100644 --- a/horde/apis/models/kobold_v2.py +++ b/horde/apis/models/kobold_v2.py @@ -54,17 +54,6 @@ def __init__(self): help="The seed of the text generation.", location="json", ) - self.generate_parser.add_argument( - "allow_downgrade", - type=bool, - default=False, - required=False, - help=( - "If True, The request and the user or shared key doesn't have enough upfront kudos to perform, " - "it will be downgraded so that it doesn't require upfront kudos. " - ), - location="json", - ) class TextModels(v2.Models): @@ -334,6 +323,13 @@ def __init__(self, api): "Feature is restricted to Trusted users and Patreons." ), ), + "allow_downgrade": fields.Boolean( + default=False, + description=( + "When true and the request requires upfront kudos and the account does not have enough " + "The request will be downgraded in max context and max tokens so that it does not need upfront kudos." + ), + ), "webhook": fields.String( description=( f"Provide a URL where the {horde_title} will send a POST call after each delivered generation. " diff --git a/horde/apis/models/stable_v2.py b/horde/apis/models/stable_v2.py index cde937f6..4e1232d7 100644 --- a/horde/apis/models/stable_v2.py +++ b/horde/apis/models/stable_v2.py @@ -69,17 +69,6 @@ def __init__(self): ), location="json", ) - self.generate_parser.add_argument( - "allow_downgrade", - type=bool, - default=False, - required=False, - help=( - "If True, The request and the user or shared key doesn't have enough upfront kudos to perform, " - "it will be downgraded so that it doesn't require upfront kudos. " - ), - location="json", - ) self.generate_parser.add_argument( "replacement_filter", type=bool, @@ -628,6 +617,13 @@ def __init__(self, api): "Feature is restricted to Trusted users and Patreons." ), ), + "allow_downgrade": fields.Boolean( + default=False, + description=( + "When true and the request requires upfront kudos and the account does not have enough " + "The request will be downgraded in steps and resolution so that it does not need upfront kudos." + ), + ), "webhook": fields.String( required=False, max_length=1024, diff --git a/horde/apis/v2/base.py b/horde/apis/v2/base.py index f7e5eb44..fd3c6dde 100644 --- a/horde/apis/v2/base.py +++ b/horde/apis/v2/base.py @@ -196,7 +196,10 @@ def validate(self): if len(self.args.extra_source_images) > 5: raise e.BadRequest("You can send a maximum of 5 extra source images.", rc="TooManyExtraSourceImages.") if len(self.args.extra_source_images) > 1 and not self.user.trusted and not patrons.is_patron(self.user.id): - raise e.BadRequest("Only trusted users and patrons can send more than 1 extra source images.", rc="MoreThanMinExtraSourceImage.") + raise e.BadRequest( + "Only trusted users and patrons can send more than 1 extra source images.", + rc="MoreThanMinExtraSourceImage.", + ) if self.user.education or self.user.trusted: lim.dynamic_ip_whitelist.whitelist_ip(self.user_ip) self.username = self.user.get_unique_alias() diff --git a/horde/consts.py b/horde/consts.py index fbe0f023..4b2cf0f1 100644 --- a/horde/consts.py +++ b/horde/consts.py @@ -1,4 +1,4 @@ -HORDE_VERSION = "4.34.0" +HORDE_VERSION = "4.34.1" WHITELISTED_SERVICE_IPS = { "212.227.227.178", # Turing Bot