DiffusionToolkit icon indicating copy to clipboard operation
DiffusionToolkit copied to clipboard

[BUG] Input string was not in a correct format.

Open trunksn1 opened this issue 10 months ago • 5 comments

Sorry, it's me again... I found another issue.

I downloaded a bunch of images from Civitai. On that platform, some users can remove from their pictures the prompt and negative prompt while still keeping the rest of the metadata.

When I open these images in Diffusion Toolkit, they appear to have no metadata at all — see this screenshot:

Additionally, the images are marked with an "Errors" label. Clicking it shows the following error:

Input string was not in a correct format.

at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) at Diffusion.IO.Metadata.ReadA111Parameters(String data) at Diffusion.IO.Metadata.ReadFromFileInternal(String file) at Diffusion.IO.Metadata.ReadFromFile(String file)

However, when I check the same images in Forge using the PNG Info tab, I can confirm that the metadata is still present, just without prompt and negative prompt strings:

It seems like diffusion-toolkit expects those fields to always be there, and fails when they are missing. Ideally, it should still parse and display the rest of the metadata if it's available.

Thanks again for your hard work on this tool!

trunksn1 avatar Apr 04 '25 06:04 trunksn1

Can you post the image here so I can test it? Thanks.

RupertAvery avatar Apr 04 '25 14:04 RupertAvery

it's this one Image

trunksn1 avatar Apr 04 '25 14:04 trunksn1

Thanks, Its caused by the Seed being empty. I've updated the code so that it won't break on fields that are some unexpected value. I'm in the middle of some heavy changes so I won't be able to release a build until it's stable, but thank you for bringing this up

RupertAvery avatar Apr 04 '25 21:04 RupertAvery

A new stable build is up, please try this:

https://github.com/RupertAvery/DiffusionToolkit/actions/runs/14348000145/artifacts/2908080007

RupertAvery avatar Apr 09 '25 03:04 RupertAvery

thank you for the fix! Now I can see the details in "Others" and inside the label "Raw Metadata" being there, while the error label has disappeared.

https://snipboard.io/lQIOqv.jpg

One thing still though is that there is still the red attention sign on the preview of the picture.

https://snipboard.io/x0XmCv.jpg

trunksn1 avatar Apr 15 '25 16:04 trunksn1