Closed tusharbhutt closed 1 year ago
@tusharbhutt, hello!
It is file that describes a text format in which exiftool should write its output.
To use this or other format file with exiftool you should save it somewhere on your disk (prefer pathes without spaces), and then add -p "X:\Path\To\Your\Format\File\exif.fmt"
to the arguments when launch exiftool application. In Windows that could be done via a .bat file or a shortcut .lnk or directly in the command prompt.
You can read more about -p
key here: https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat
My orignal purpose is to use it with ImageGlass image viewer while working in Stable Diffusion UI. https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1569#discussioncomment-4175458
Thanks! Doesn't seem to be a way to split the positive and negative prompt, is there?
Row #5 contans only positive prompt in one line. https://github.com/Eugenii10/exiftool-sd-format/blob/35fe9b172fdfe38c168455d41e92798b3bcd40fd/exif.fmt#L5
Row #6 contains only positive prompt in multi-line view. https://github.com/Eugenii10/exiftool-sd-format/blob/35fe9b172fdfe38c168455d41e92798b3bcd40fd/exif.fmt#L6
Row #7 contains only negative prompt. https://github.com/Eugenii10/exiftool-sd-format/blob/35fe9b172fdfe38c168455d41e92798b3bcd40fd/exif.fmt#L7
Apologies for the late reply and thanks, I will see if Exiftool can read this and then import that data into Lightroom somehow.
No problems. If you want to see image metadata (EXIF) in the Lightroom in your custom format, then you probably need to edit it first with the help of the same ExifTool (https://exiftool.org/#writing). You may also need to use jpg format. Or maybe this plugin can convert metadata on the fly at runtime only, like ImageGlass does. According to its description you can manually specify additional command line arguments for ExifTool. But it is a paid plugin and may not work with latest Lightroom versions. https://www.photographers-toolbox.com/products/jbeardsworth/jbcapturetimetoexif/index.php?sec=use I don't work with Lightroom, so I can't say for sure.
I added the file in and put in the path; EXIFToolGui cannot see the output from it in the output log. EXIFtool itself can output to the console if I drag & drop the file into the program itself with the -p -k flags. I'll have to figure out how to write the tags from the PNG fields in your file format to the XMP-LR fields, as separate fields and not one big lump
I can already do this on my own, but cannot break up the SD PNG info properly like you have it with this command:
XMP-LR:HierarchicalSubject<Parameters
.... but that make it one big lumpy mess. So I have to somehow map your file format to something like
-sep "\t" XMP-LR:HierarchicalSubject<Parameters
Well, if the problem is in the Exiftool output, then just write one tag at a time. Create different exiftool format file for each tag, then call application with a wanted format file to get the only one specified tag at the current call in the app output. And repeat this for all wanted tags.
Also delete all unnecessary output text from the format file, like "SD Prompt\tPrompt\t"
from the row #5.
But with this approach you will meet another problem. Rows #8 and #9 contains for
loops, which iterate over all parameters, so the code doesn't isolate each parameter individually. This will need significant Perl code changes.
If the image viewer doesn't have native support of Exiftool and you choose to rewrite metadata in the image files before open/import them in the image viewer, then using a Python script would be a better solution for this. Python language is much easier to use, more modern and powerful than Perl. Automatic1111 GUI repository has already big chunks of code for image metadata reading and writing, so it can be re-used in your script. You can try to ask for help on the Automatic1111 repository discussions or on the special Python forums/resources.
My original intention with Exiftool and formatting was to represent SD PNG metadata in a more elegant way without any regular additional actions needed from the user. If I had to re-write metadata each time after the image generation, I would definitely look in the direction of a Python script.
Hi, How can I use this with ExifTool to view/extract the data? Does the file go into a custom folder and how is it called by ExifTool for use? Thanks for any help you can provide