Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Report censored images correctly #453

Merged
merged 6 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading