Haidra-Org / horde-worker-reGen

The default client software to create images for the AI-Horde
https://aihorde.net/
GNU Affero General Public License v3.0
93 stars 42 forks source link

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

Closed rbrtcs1 closed 1 month ago

rbrtcs1 commented 1 month ago

I just quickly typed this up on my phone, so it’s definitely worth double checking for correctness.

But I think this should fix the “censored” value inside each generation object to actually be whether that image was censored instead of the current situation which is if any image in the batch was censored.

rbrtcs1 commented 1 month ago

Well it seems like the gen metadata at this stage is the model from the sdk rather than a dict. Not sure what the correct way is to access the ‘type’ attribute for comparison (as a string). But it seems that that is the issue failing the tests here.

db0 commented 1 month ago

The censored payload from the worker is obsolete and discarded on the horde in favour of parsing gen_metadata as can be seen here https://github.com/Haidra-Org/AI-Horde/blob/b520fe3c2c998e7141dfe1e111003834448de186/horde/classes/stable/processing_generation.py#L91

This was an old boolean for the whole job, before we were doing batches, so it's by nature inaccurate.

rbrtcs1 commented 1 month ago

It’s possible I’m misunderstanding something here, but my understanding is as follows:

  1. the worker sets the censored value equal to true if any image in the batch was censored. It is false only if all images in the batch are ok.
  2. the horde server receives that value, then overrides to it to true if the submitted job has a censored gen_metadata.

This seems to me that when 1 image in a batch was censored but the others were not, they would still all be marked as censored. Unless I’m misunderstanding the aihorde code and the censored value defaults to False. (Each good image in that batch would start as censored=true, then the horde server wouldn’t override them, leaving them set to true)

db0 commented 1 month ago

Look at this change from today https://github.com/Haidra-Org/AI-Horde/commit/8fab6e4c48e3713b557e1b01eb3af8d8224639d5

rbrtcs1 commented 1 month ago

I must have missed that, looks good!