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

Added better censored check per-image when submitting job #298

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 4 additions & 1 deletion horde_worker_regen/process_management/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,7 @@ async def _do_upload(new_submit: PendingSubmitJob, image_in_buffer_bytes: bytes)
logger.debug(f"{type(e).__name__}: {e}")
new_submit.retry()
return new_submit

metadata = []
if new_submit.image_result is not None:
metadata = new_submit.image_result.generation_faults
Expand All @@ -2510,13 +2511,15 @@ async def _do_upload(new_submit: PendingSubmitJob, image_in_buffer_bytes: bytes)
logger.error(f"Job {new_submit.job_id} has no state, assuming faulted")
new_submit.completed_job_info.state = GENERATION_STATE.faulted
return new_submit

censored = any(meta.get("type") == "censorship" for meta in metadata)
submit_job_request = submit_job_request_type(
apikey=self.bridge_data.api_key,
id=new_submit.job_id,
seed=seed,
generation="R2", # TODO # FIXME
state=new_submit.completed_job_info.state,
censored=bool(new_submit.completed_job_info.censored), # TODO: is this cast problematic?
censored=censored,
gen_metadata=metadata,
)
logger.debug(f"Submitting job {new_submit.job_id}")
Expand Down
Loading