RupertAvery / DiffusionToolkit

Metadata-indexer and Viewer for AI-generated images
MIT License
760 stars 47 forks source link

Adding Metadata info from file/manually #185

Open Aamir3d opened 9 months ago

Aamir3d commented 9 months ago

A lot of images (especially when generated with Fooocus) do not have metadata info. The metadata is in the form of a log file in the output folder.

Additionally, (and someone mentioned this earlier), upscaled images sometimes do not have metadata because of the processing and original metadata being overwritten (example workflow) > detailed prompt with a lot of stuff, output image sent to img2img in A1111, ultimate SD upscale used with a simple prompt like 'highly detailed'. Original detailed prompt is lost.

A good to have functionality would be the possibility to copy/paste metadata from a file (Png/JPG), from a log file, or from the clipboard. This will ensure the file's prompt and basic settings get saved.

RupertAvery commented 9 months ago

One thing I have thought of is to parse the Fooocus log file and link it up with the images. The slight drawback is that I assume the log file will always have previous logs and the parser still has to go through each, and filter out the ones that are already in the database. Not a huge deal, but HTML is a terrible format for parsing, even if I'd probably have to use HTMLAgilityPack to do it.

So my ideas are:

1) Have a separate Fooocus "folder+log file" path configuration 2) Assume files are always int the foocus folder, or, try to process any files without metadata using the Fooocus logfile by matching the filename.

So, one thing is that for now I don't really plan on editing embedded metadata, because of all the different formats. And I've been thinking that people want to update metadata in the original image, but maybe all you need is just to update the metadata in the database.

So yes, I can probably do something like, drag and drop an image into the metadata section to overwrite it. Probably add a sort of lock button to prevent accidental overwrites, and a save button to commit the changes.

So for the Fooocus thing, I will need a log file and some images to work with. To make things clear, I will not embed metadata in the image, I will just use the log file as a source of metadata, the same way that JPG+TXT files work.

Aamir3d commented 9 months ago

Thanks for the clarification. It's not a big deal really, it's a 'nice to have'. Especially in the case when an image was upscaled with 'highly detailed' and prompt information is lost, or an external upscaler like Upscayl is used.