Haidra-Org / AI-Horde

A crowdsourced distributed cluster for AI art and text generation
GNU Affero General Public License v3.0
1.06k stars 127 forks source link

Feature: Expose whether worker supports dynamic models or not. #158

Open daveschumaker opened 1 year ago

daveschumaker commented 1 year ago

Hello!

Under some scenarios, users requesting a job from various UIs will experience jobs that never complete. This is primarily attributed to using unsupported resolutions or unsupported post processors.

In order to better serve our users, I would like to see the following fields added to the following endpoint: https://stablehorde.net/api/v2/workers

{
  dynamic: boolean
  post_processors: []
  model_block_list: []
}

On the front end side of things, I image the following scenario:

  1. A user requests an image sized 768 x 512 with the Anything model.
  2. The UI checks this request against existing workers. e.g., Are there any workers explicitly running Anything, or workers that support dynamic models (so that we know Anything will eventually load), or workers that support dynamic models but do not have Anything in their block list. If any of these are true, then check max pixels against requested image size. If that is true, send the request. If not, UI displays a warning about why this request will / may not work.
tazlin commented 1 year ago

For what its worth, just comparing the (number of requested pixels, model name) pair to all of the workers (max_pixels, models) would get you a long way there. If there is no case of a (max_pixels, model) where max_pixels is high enough, then its very likely the request won't get fulfilled soon. You can indicate to the end user that this might be the case as soon as they select the resolution and/or model.

Knowing individual worker preferences regarding dynamic model loading will only give you a slight heads up that workers will get to models with a high queue time or high queue pixels, and it will become an exercise in trying to out predict the horde itself.

Further, as far as I am aware, workers identify themselves to the horde as either supporting post processing or not, and the horde does not discriminate beyond this when selecting a worker for a job (see https://stablehorde.net/api/ -> v2/generate/pop -> 'allow_post_processing'). While this may change in the future, and there may be some merit to that, the path of least resistance right now would be to have the allow_post_processing field added to to the https://stablehorde.net/api/v2/workers endpoint. I will request for this change to be made.