Skip to content

Commit

Permalink
fix: show allow_downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Mar 25, 2024
1 parent fdac0cd commit 42e22bb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 7 additions & 11 deletions horde/apis/models/kobold_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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. "
Expand Down
18 changes: 7 additions & 11 deletions horde/apis/models/stable_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion horde/apis/v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion horde/consts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HORDE_VERSION = "4.34.0"
HORDE_VERSION = "4.34.1"

WHITELISTED_SERVICE_IPS = {
"212.227.227.178", # Turing Bot
Expand Down

0 comments on commit 42e22bb

Please sign in to comment.