cocktailpeanut / breadboard

Stable Diffusion Browser for Windows, Mac, and Linux
https://breadboard.me
376 stars 37 forks source link

LoRA in prompt breaks metadata display #40

Closed joelyoder closed 1 year ago

joelyoder commented 1 year ago

I have a number of images generated using a LoRA in the prompt. All of them say [object Object] in breadboard and are missing other metadata:

image

I believe the < > brackets that are required to use a LoRA in Auto1111 are not getting properly escaped by breadboard when generating the XML, causing parsing of the parameters to fall flat.

Here is what the metadata for the example prompt above is according to PNG info in Auto1111:

parameters

princess zelda, 1girl, artist request, belt, blonde hair, blue shirt, book, boots, expressionless, full body, green eyes, highres, looking at viewer, magic, nintendo, pants, pointy ears, shirt, short hair, simple background, solo, the legend of zelda, the legend of zelda: breath of the wild, the legend of zelda: tears of the kingdom, white background Negative prompt: (painting by bad-artist-anime:0.9), (painting by bad-artist:0.9), watermark, text, error, blurry, jpeg artifacts, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, artist name, (worst quality, low quality:1.4), bad anatomy Steps: 30, Sampler: DPM++ 2M Karras, CFG scale: 9, Seed: 632378813, Size: 512x768, Model hash: 0873291ac5, Model: abyssorangemix2NSFW_abyssorangemix2NSFW **XML:com.adobe.xmp** princess zelda, 1girl, artist request, belt, blonde hair, blue shirt, book, boots, expressionless, full body, green eyes, highres, looking at viewer, magic, nintendo, pants, pointy ears, shirt, short hair, simple background, solo, the legend of zelda, the legend of zelda: breath of the wild, the legend of zelda: tears of the kingdom, white backgroundDPM++ 2M Karras309632378813(painting by bad-artist-anime:0.9), (painting by bad-artist:0.9), watermark, text, error, blurry, jpeg artifacts, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, artist name, (worst quality, low quality:1.4), bad anatomyabyssorangemix2NSFW_abyssorangemix2NSFW0873291ac5automatic1111512768
joelyoder commented 1 year ago

Markdown is messing with the display of the brackets, so here's a screenshot of the PNG Info: image

StrawberryBunny commented 1 year ago

Related to escaping.. Some anime models have facial expression tokens such as :D In order to use these in InvokeAI you must escape the colon. \:D In Breadboard's expanded view this displays as D but if you copy the prompt and paste it you get :D so straight pasting it back in to Invoke will provide very unusual output as colon is used for Invoke's blend syntax.

cocktailpeanut commented 1 year ago

@joelyoder are you using the latest release? There were bugs with metadata parsing that should have been fixed https://github.com/cocktailpeanut/breadboard/releases/tag/0.2.1

If you're still experiencing the problem, can you share the image file, so I can try debugging on my end?

cocktailpeanut commented 1 year ago

And @StrawberryBunny - are you saying an image includes a prompt in the metadata with a backslash \:D but when you copy it from breadboard, it leaves out the \ part? Or are you saying even the original image doesn't include a backslash but you would like breadboard to add a backslash when you copy, so it can be used for invokeAI?

If it's the first case, this will need to be fix, but might be a separate issue, so would appreciate it if you could create a separate issue with the specific image (with the prompt attached) attached.

If it's the second case, that would be kind of tricky because there's no way for breadboard to know which tokens to escape and which to not escape, because every SD app has a different input syntax. Let me know

StrawberryBunny commented 1 year ago

So just checked and recalling a prompt in Invoke (from the gallery) will lose the blackslash, so that's not a breadboard issue. The escape character isn't being added to the data. The data only contains :D However, this is still only displayed as D in the expanded view.

joelyoder commented 1 year ago

@cocktailpeanut yes, I'm using 0.2.1 - link to the image file

cocktailpeanut commented 1 year ago

This should be fixed with 0.4.0 https://www.reddit.com/r/StableDiffusion/comments/111dc2l/breadboard_040_realtime_messenger_for_stable/

Please feel free to close the issue if it's been fixed. Or let me know if I'm missing something.