RupertAvery / DiffusionToolkit

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

[BUG] Image not displayed, The given key was not present #259

Open Kluvwen opened 1 week ago

Kluvwen commented 1 week ago

Using primarily Novel AI, the error The given key was not present in the dictionary. has been occurring frequently as of some updates from them. 9/20/2024 12:26:56 AM: An error occurred while reading C:\Users\Kluvw\Downloads\AI_{{{{{zero pictured}}}}}, castle s-3338614828.png: The given key was not present in the dictionary.

at System.Text.Json.JsonElement.GetProperty(String propertyName) at Diffusion.IO.Metadata.ReadFooocusMREParameters(String data) at Diffusion.IO.Metadata.ReadFromFile(String file) at Diffusion.IO.MetadataScanner.Scan(IEnumerable`1 files)+MoveNext() Version: Diffusion Toolkit 1.7 Fix

Tool: NovelAI

To Reproduce This isn't happenning with every image, however it is happening frequently, with no change in prompt or methodology.

Expected behavior This is not expected, particularly images not showing at all, I was not aware this was an issue for some time until one I'd just added wasn't showing up and checking the log.

Affected Image(s) _{{{{{zero pictured}}}}}, castle s-3338614828

If possible, it would be preferable to show images even if they're producing an error if error allows for images to be shown.

RupertAvery commented 1 week ago

Thanks for finding this.

This build should resolve your issue while I am adding features and bug fixes for the next release.

https://github.com/RupertAvery/DiffusionToolkit/actions/runs/10975406944/artifacts/1962103501

It will also now allow the file to be loaded and viewed even if an error occurs. When a fix does come in, there is an option to Rescan selected images. Images with errors currently are marked with a red warning icon in the thumbnail, and the error information will be viewable in the Metadata as a new tab.

Kluvwen commented 1 week ago

Thanks so much, that looks to resolve both issues. I can close this or leave it open for visibility until the next release.

RupertAvery commented 1 week ago

Yes keep it open for now in case anyone else has the same issue, thanks!