RupertAvery / DiffusionToolkit

Metadata-indexer and Viewer for AI-generated images
MIT License
736 stars 46 forks source link

Aesthetic Score: calcualte for images that do not have initially score saved #151

Open DmytroSokhach opened 9 months ago

DmytroSokhach commented 9 months ago

Is your feature request related to a problem? Please describe. I have bunch of images that do not have "Aesthetic score"

Describe the solution you'd like

  1. I'd like to have a plugin or menu that will allow calculate Aesthetic Score AND save it back into metadata.
  2. From DiffusionToolkit a. find files by search criteria (like AestheticScore == null) b. Apply custom command for those files
  3. From DiffusionToolkit (sounds like min effort one) a. find files by search criteria (like AestheticScore == null) b. Export/Save search list into file

Describe alternatives you've considered

  1. maybe A1111 Extras can do it for batch of files, but I could not find how to do it
  2. Custom Python script that will iterate folders and use https://github.com/vladmandic/sd-extension-aesthetic-scorer

Additional context

Ariloum commented 9 months ago

that aesthetic scorer got a python script named "aesthetic-scorer-cli.py" which you can use in the command line - just feed it with a folder of images you want to score.

also a1111 extras could do that if u batch-upscale with selecting upscale by x1 and no upscaler

DmytroSokhach commented 9 months ago

@Ariloum thank you for a hints. I suspect a1111 extras will not update existing image "Parameters", but produce new files so will loose Date Created, which I need for sorting.

I've actually followed the extension, but CLI had bugs that were showing improperly in DiffusionToolkit So I did fork with bugfixes: https://github.com/DmytroSokhach/sd-extension-aesthetic-scorer , usage is the same. E.g.: python aesthetic-scorer-cli.py --save "#" "D:\Dev\StabilityMatrix\Packages\ComfyUI\output" It now handles images without metadata as well as certain metadata scenarios which were buggy and not showing properly. Cheers! 👌