Skip to content

Commit

Permalink
fix: Report censored images correctly (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 authored Sep 26, 2024
1 parent 7f1f915 commit a26fbd9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ repos:
rev: 24.4.2
hooks:
- id: black
exclude: ^hordelib/nodes/.*\..*$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
hooks:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-or-later

# Changelog

# 4.43.2

* Horde more accurately reports which images are nsfw or csam censored

# 4.43.1

* Fix to prevent limit_max_steps picking up WPs with empty model lists
Expand Down
7 changes: 5 additions & 2 deletions horde/classes/stable/processing_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ def log_aborted_generation(self):
)

def set_generation(self, generation, things_per_sec, **kwargs):
if kwargs.get("censored", False):
self.censored = True
state = kwargs.get("state", "ok")
for metadata in kwargs.get("gen_metadata", []):
if metadata.get('value') == 'csam':
state = 'csam'
else:
state = 'censored'
if state in ["censored", "csam"]:
self.censored = True
db.session.commit()
Expand Down
2 changes: 1 addition & 1 deletion horde/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later

HORDE_VERSION = "4.43.1 "
HORDE_VERSION = "4.43.2 "

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

0 comments on commit a26fbd9

Please sign in to comment.