InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Uploaded images lose metadata

Open realstevewarner opened this issue 2 years ago • 18 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

Windows

GPU

cuda

VRAM

No response

What happened?

When you create an image with Invoke, it adds metadata to the file. This metadata can be seen by clicking the Info button in the WebUI. If you drag the created image into the Uploads area, then click the Info button, it will say that No Metadata is available. However if you take the same image and drop it into Automatic1111, it will read the metadata. Invoke is somehow failing to read the metadata on uploaded images, or even images that have been dragged from the Generation window to the Uploads window.

Screenshots

01 - Metadata 02 - No Metadata

Additional context

No response

Contact Details

[email protected], Steve Warner#1284 on Discord

realstevewarner avatar Jan 31 '23 17:01 realstevewarner

@psychedelicious This is actually an enhancement request, but is something that I have bumped into on several occasions myself and wish there were a fix for. I have a whole bunch of images on my external disk from earlier versions of invokeai, and I wish I could upload them and easily retrieve their metadata.

lstein avatar Feb 03 '23 22:02 lstein

@realstevewarner @lstein

I'm pretty sure that the metadata is readable, but you have to refresh the page. The server doesn't read the metadata correctly when first uploading an image.

Going to file this under no-fix because this will be a non-issue on the new server/API.

psychedelicious avatar Feb 04 '23 02:02 psychedelicious

That's weird. Okay. So I checked and yes, it does show the metadata once I refresh the page. Strange that we'd have to do that. But you're saying the next version of Invoke this won't be required? I'm not sure what the new server/api is.

realstevewarner avatar Feb 04 '23 02:02 realstevewarner

@realstevewarner

We have v2.3.0 pending release. It will not be fixed in that.

The bug is in the current web server - we are really trying to not making any more changes to it because any work there will be lost once we move to a new server. I can't give a solid ETA on the release that will fix this, sorry. If it turns out to take longer than expected, maybe we can address this sooner.

psychedelicious avatar Feb 04 '23 03:02 psychedelicious

Okay. Thanks for the update. Happy to hear there's a workaround at least. One last question. If I refresh my browser, it resets all my prompt settings, size, sampler, etc. Any way to avoid that if I'm just trying to get metadata on an imported image?

realstevewarner avatar Feb 04 '23 03:02 realstevewarner

@realstevewarner You shouldn't lose anything on refresh - that's a different bug.

Please try Reset Web UI from Settings (gear icon @ top right) then refresh the page (this will definitely clear out all the your settings). Then try entering a prompt, wait a second for it to save, and refresh the page. Does it remember it now?

psychedelicious avatar Feb 04 '23 03:02 psychedelicious

Nope. It wipes out all my settings. Keeps the model, fortunately. But my prompt, seed, sampler, CFG, etc. all go away. I know I can get those back by right clicking on the last generated image and pressing "use all." So it's not a crisis. Just an annoyance.

realstevewarner avatar Feb 04 '23 04:02 realstevewarner

@realstevewarner

Hmm. Please refresh your browser while on InvokeAI and see if there is any output in the javascript console. Here's how to open the javascript console on most browsers.

  1. Do you see any output? Please copy and paste everything there if so.

  2. After double-checking that you are on the InvokeAI UI page, paste localStorage.clear() in the console and press Enter to fully reset the InvokeAI UI. Then try changing some settings and see if they persist. Any luck?

psychedelicious avatar Feb 04 '23 05:02 psychedelicious

  1. I opened the Javascript console for the Invoke web UI page while Invoke was running and refreshed the page. Here's what I got.
    Javascript error

I then did a full UI reset (from the Gear icon) and refreshed the page. The Javascript panel showed: Reset Error

  1. Once on the Invoke UI page, I tried the localStorage.clear() command into the command line console but it would not allow user input. I tried typing the command directly but it would not accept it. It seems that I can't type into the command line interface while in WebUI mode. So I tried to force the command by putting it into the prompt field of the webUI. I figured it might pass the command down to the console. Nope. It generated the following image. LOL.

image

The issue isn't Invoke, though. It's my browser. I'm using Brave (with all protective shields turned off). On a whim, I tried running the WebUI in Firefox and it was able to save all the settings even after a refresh. Moreover, I didn't get the error loading in thumbnails that I normally get in Brave. At least not to the same prevelance. It's definitely a browser issue. I'll look into the Brave settings a bit more and see if there's anything else I can do to get it to work better.

Many thanks for the ongoing support!

realstevewarner avatar Feb 05 '23 21:02 realstevewarner

Thanks for the troubleshooting, and great find re: brave. I'll download that browser and see if I can recreate the issue.

To clarify I meant the browser JavaScript console not the command line where you start the server. If you couldn't type into the JavaScript console... well, that's really weird!

psychedelicious avatar Feb 05 '23 21:02 psychedelicious

Ah! Okay. I'm dumb. LOL. I typed that into the Javascript console and it said "undefined"

image

But once I refreshed the page, it kept all the settings! I can't explain that at all. But it worked!

realstevewarner avatar Feb 05 '23 22:02 realstevewarner

Yes, that's the expected output. Something in the browser's storage of your settings had gone sideways. localStorage.clear() is the nuke-everything-button.

Glad it's working! Just to confirm, does this fix the issue for Brave?

psychedelicious avatar Feb 05 '23 22:02 psychedelicious

With regards to the issue of it losing the settings once I refresh, absolutely. And as noted earlier, refreshing seems to fix the metadata issue of uploaded images. The only outstanding issue I see is the occasional missing thumbnail. The UI throws out an error and I get a "broken" icon. The images are still there, however. I just can't get a preview of them.

image

image

realstevewarner avatar Feb 05 '23 22:02 realstevewarner

Thanks, I'll need to look into that. Do the thumbnails for those specific images never ever display, or only sometimes display?

psychedelicious avatar Feb 06 '23 05:02 psychedelicious

It's random. If I refresh the page, some will display. Others will not. It's usually about 3 to 5 that just don't show up, but refreshing will make them show up and others not.

Thanks again for your help with this!

realstevewarner avatar Feb 06 '23 15:02 realstevewarner

Ok, gotcha. I'll keep this in mind as we work on migrating to the new server.

psychedelicious avatar Feb 06 '23 20:02 psychedelicious

I just tested with RC7 and the only way I can get the metadata in an uploaded image to display is by resetting the WebGUI and then reloading. Just a reload doesn't seem to do it. I don't consider this a blocking issue, but something to keep in mind.

lstein avatar Feb 08 '23 22:02 lstein

That really shouldn't be needed. The gallery data isn't persisted to the browser. I have a feeling something is funky in localStorage and sometimes the UI Reset isn't clearing everything out properly. I need to dedicate a chunk of time to this class of problem, but it's really hard to reproduce.

psychedelicious avatar Feb 08 '23 22:02 psychedelicious

There has been no activity in this issue for 14 days. If this issue is still being experienced, please reply with an updated confirmation that the issue is still being experienced with the latest release.

github-actions[bot] avatar Mar 12 '23 06:03 github-actions[bot]