Closed d3x-at closed 3 months ago
@d3x-at Thank you for the heads up, I'll edit my code base when you publish the new release. Maybe with a few UI changes, too. One thing I was excited about was parsing the text blob of metadata. I had trouble parsing through it last time. If you could suggest how I can go about or add a feature to return the metadata as a dict, that'd be very beneficial, as due to that I cannot extend the options populated in my UI.
If i understand your code right, you went into PromptInfo.parameters
, which is raw data of whatever the original image generating software put in there, be it a string, json or whatever. You should almost never need to go into that property.
If you want to access the data as parsed by sd-parsers , look at PromptInfo.prompts, .models, .samplers, .metadata or similar properties as is done in the example scripts. From 0.3.1 you can also simply print() the ParserManager.parse()
result to see what's in there.
I think that should answer your concerns about accessing the information as dict or similar. If not, feel free to follow up!
I meant how the parsed_data.metadata does not have appropriate keys and values when compared with the raw parameters.
PS: Thank you for the code above, it reduced my code length by a mile...
I meant how the parsed_data.metadata does not have appropriate keys and values when compared with the raw parameters.
Yes, this is how it is intended. As stated in the README.md PromptInfo.metadata only contains information that cannot be attributed to either prompts, samplers or models.
Hello there!
Just wanted to drop a quick heads-up that 0.4 will be coming soon (-ish), which might simplify a few things on the user side!
Looking at your code, with the current "pre-0.4" state (
pip3 install git+https://github.com/d3x-at/sd-parsers
), it might look like below.If you find anything unclear in how to use this library or have ideas on how to structure the data in a better way, please drop me a Note!