thedyze / save-image-extended-comfyui

Extended Save node for ComfyUI
64 stars 6 forks source link

Feature Request: Add metadata "Keywords" as input #19

Open avviano opened 4 months ago

avviano commented 4 months ago

There is currently no ComfyUI node for SAVING IMAGE available anywhere that lets you save keywords generated by WD14 Tagger to the internal PNG metadata (standard PNG meta values are "TITLE", "AUTHOR", "DESCRIPTION", "COMMENT" but also very important is the "KEYWORDS" xmp or adobe.xmp value. Would be great if this could be added as a WIDGET/INPUT.

This is the missing link to be able to use ComfyUI to automatically tag images with keywords and save those keywords directly into the PNG file (not external text file). More on the topic of PNG Meta standards can be found here: https://www.w3.org/TR/png/#11textinfo

Its possible to auto-generate keyword tags for any LOAD IMAGE, using either "MS Kosmos-2 Interrogator" or "WD14 Tagger" or "CXH_JoyTag", but its not possible in any available node to actually save these keywords into the default PNG metadata or XMP info (its only possible to save them as extra text files).

PS: The adobe.xmp can store all kinds of metadata directly in the image which will survive any conversion from PNG to JPG and vice versa. There is a python library available on GIT that can handle adobe xmp meta here:

https://github.com/Lambda-IT/xmp-toolkit

Thanks.

audioscavenger commented 2 months ago

i agree and it seems that it is possible indeed, according to PNG specs. please post your request here - but i must warn you, this does not look easy. I do it easy for Jpeg, with exiftool command line. but from within Comfy + python, that's another story.