-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
feat: add metadata to images #1940
feat: add metadata to images #1940
Conversation
will take a look late Jan / early Feb |
I really like this implementation. I haven't using Fooocus anymore just because I do want my images to have the generation data included. However it doesn't seem to work for me. I merged it and also checked the checkbox then but neither json or automatic1111 seems to work. Still no image data. No idea what I am doing wrong. |
@Eleksar387 Metadata will only be added to images in the output folder (not in browser) until #1932 is merged. Please check if images in the output folder have the metadata format you've selected. |
@mashb1t Understood. That's what I did. As I see the additonal checkbox in the UI I assumed I've merged it correctly. I use Diffusion Toolkit as an image viewer that also displays prompt data. If I check the add metadata button in Fooocus the images do not even appear in this image browser. They do appear if I uncheck it. |
@Eleksar387 the default fooocus metadata format i used is probably not compatible with anything else as it's just a json string in the pnginfo. You might have to use the A1111 format to establish compatibility to their scanner, see https://github.com/RupertAvery/DiffusionToolkit/blob/master/Diffusion.Scanner/MetadataScanner.cs. |
@mashb1t I just checked it again. If I tick "Save Metadata to Images > Automatic1111" the images don't even appear in Diffusion Toolkit. Same if I tick "Fooocus (json)". Although in both cases the images are created and in the folder. But no txt file. If I uncheck "Save Metadata to Images" the images do appear in Diffusion Tookit - but of course without metadata. |
Seems like an issue for their repository, at least they do not display then images with different metadata.
Please confirm the metadata exists in the file. |
You are right! Metadata does exist. Sorry for bothering you. |
I've re-evaluated the impact and it is minor if not not noticable (source of noise pattern generation cpu vs gpu), so the mapping has been adjusted. See also https://www.reddit.com/r/comfyui/comments/15hayzo/comment/juqcpep/ |
Love the #1940 Metadata enhancement. Though I would love it even more if the metadata was not only written as a comment (which is fairly userfull as I as I would like to emphasize) but as EXIF-Datafields (which are realy usefull for search and filtering in any photoediting/-organisation software like Lightroom etc. |
…n steps enum and performance is not the same
…oocus into feature/add-metadata-to-files
Is this ready to pull in to our local fork? |
@eddyizm i'm planning to include this feature in the next release 2.2.0 tomorrow/Monday, incl. jpg and webp support. Feel free to review. |
Nice! I pulled it down to check it out and see where the merge conflicts are at. Not too much work. |
# Conflicts: # modules/async_worker.py # modules/config.py # modules/meta_parser.py # modules/private_logger.py # modules/util.py # webui.py
e.g. raw negative prompt when none is set
@mashb1t Merge to main when ? |
@VictorZakharov when all ToDo's in https://github.com/lllyasviel/Fooocus/milestone/1 are done and the release candidate has been tested. Feel free to already test develop! |
@Benm678 thanks for the hint. I've already considered removing this line in the log header, but wanted to get some feedback first. As there was no feedback from lllyasviel in the last 2-3 weeks i've decided to keep the line and basically wait for feedback of the community. |
@mashb1t I am checking 2.2.0, how do I enter loras? That whole section is gone. |
@VictorZakharov this is off-topic, please open a new discussion/issue if needed. |
Resolves #241 + #1996
Merge #1932 to also enable metadata in images in the browser, not only images in the outputs folder.
This feature is in contrast to #160 and might not be merged, but at least if offers the functionality to whoever wants to use it locally, as there was demand for it.
I've implemented both a Fooocus (json) and A1111 (plain text) meta data scheme, where the latter is 100% compatible with A1111 and Civitai, but can not be used to reproduce the image outside of Fooocus, as there are so many improvements and special things happening in Fooocus it's just not applicable anywhere else.
The A1111 meta data scheme is based on A1111 infotext handling and i've re-implemented the style resolution feature to extract styles and check the corresponding styles checkboxes.
Both schemes might be extended in the future.
This feature also introduces various code optimisations such as extraction of Performance and Steps enums as well as centralisation of values for ControlNet count and LoRA count.
Gradio (setting in Developer Debug Mode)
Default is Fooocus Scheme
Config options
Arg --disable-metadata
--disable-metadata
completely prevents metadata processing and output in GradioMetadata Reader
Fooocus scheme
A1111 scheme
Metadata in files
Speed Fooocus scheme
LCM A1111 scheme (yes, with negative prompt, because it technically exists but doesn't have an influence)
Speed A1111 scheme
Civitai
Speed Fooocus scheme
LCM A1111 scheme
Speed A1111 scheme