Skip to content

Commit

Permalink
fix: more accurate gen_metadata logic; always send nsfw informati…
Browse files Browse the repository at this point in the history
…on (#295)

* No longer send nsfw gen_metadata unless image is replaced

* feat: Reports whether the image is nsfw whether it was censored or not

* chore: version bump

* fix: use latest avail. horde deps

---------

Co-authored-by: db0 <[email protected]>
Co-authored-by: tazlin <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2024
1 parent b4ae8c2 commit 63b5d47
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
- horde_safety==0.2.3
- torch==2.3.1
- ruamel.yaml
- horde_engine==2.15.2
- horde_sdk==0.14.10
- horde_engine==2.15.3
- horde_sdk==0.14.11
- horde_model_reference==0.9.0
- semver
2 changes: 1 addition & 1 deletion horde-bridge.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd /d %~dp0
call runtime python -s -m pip -V

call python -s -m pip uninstall hordelib
call python -s -m pip install horde_sdk~=0.14.10 horde_model_reference~=0.9.0 horde_engine~=2.15.2 horde_safety~=0.2.3 -U
call python -s -m pip install horde_sdk~=0.14.11 horde_model_reference~=0.9.0 horde_engine~=2.15.3 horde_safety~=0.2.3 -U

if %ERRORLEVEL% NEQ 0 (
echo "Please run update-runtime.cmd."
Expand Down
2 changes: 1 addition & 1 deletion horde_worker_regen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

ASSETS_FOLDER_PATH = Path(__file__).parent / "assets"

__version__ = "9.0.4"
__version__ = "9.0.5"


import pkg_resources # noqa: E402
Expand Down
2 changes: 1 addition & 1 deletion horde_worker_regen/_version_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"recommended_version": "9.0.4",
"recommended_version": "9.0.5",
"required_min_version": "9.0.2",
"required_min_version_update_date": "2024-09-26",
"required_min_version_info": {
Expand Down
13 changes: 9 additions & 4 deletions horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,12 +1816,17 @@ def receive_and_handle_process_messages(self) -> None:
completed_job_info.state = GENERATION_STATE.csam
elif message.safety_evaluations[i].is_nsfw:
new_meta_entry = GenMetadataEntry(
type=METADATA_TYPE.censorship,
type=METADATA_TYPE.information,
value=METADATA_VALUE.nsfw,
)
completed_job_info.job_image_results[i].generation_faults.append(new_meta_entry)
if completed_job_info.state != GENERATION_STATE.csam:
completed_job_info.state = GENERATION_STATE.censored
if message.safety_evaluations[i].replacement_image_base64 is not None:
new_meta_entry = GenMetadataEntry(
type=METADATA_TYPE.censorship,
value=METADATA_VALUE.nsfw,
)
completed_job_info.job_image_results[i].generation_faults.append(new_meta_entry)
if completed_job_info.state != GENERATION_STATE.csam:
completed_job_info.state = GENERATION_STATE.censored
else:
completed_job_info.censored = False
# logger.debug([c.generation_faults for c in completed_job_info.job_image_results])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "horde_worker_regen"
version = "9.0.4"
version = "9.0.5"
description = "Allows you to connect to the AI Horde and generate images for users."
authors = [
{name = "tazlin", email = "[email protected]"},
Expand Down
4 changes: 2 additions & 2 deletions requirements.rocm.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
numpy==1.26.4
torch==2.3.1+rocm6.0

horde_sdk~=0.14.10
horde_sdk~=0.14.11
horde_safety~=0.2.3
horde_engine~=2.15.2
horde_engine~=2.15.3
horde_model_reference~=0.9.0

python-dotenv
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
numpy==1.26.4
torch==2.3.1

horde_sdk~=0.14.10
horde_sdk~=0.14.11
horde_safety~=0.2.3
horde_engine~=2.15.2
horde_engine~=2.15.3
horde_model_reference>=0.9.0

python-dotenv
Expand Down

0 comments on commit 63b5d47

Please sign in to comment.