invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.25k stars 2.4k forks source link

Undo for delete in image gallery #4543

Open mcbexx opened 1 year ago

mcbexx commented 1 year ago

Is there an existing issue for this?

Contact Details

No response

What should this feature add?

Since it is currently not possible to get an deleted image (and its metadata) back into the gallery database by simply retrieving the deleted image(s) from the system recycle bin, an undo function for delete operations (single and multiple images) inside of the image gallery would be a nice feature.

Alternatives

No response

Additional Content

No response

psychedelicious commented 1 year ago

This is probably a good first contribution for the backend. Maybe a bit a more complicated for the frontend, but still pretty approachable.

Backend

The images table in the db already has a deleted_at column, which was added with a view towards a future soft delete feature. We don't use it just yet.

The solution would be to update the db queries to use the deleted_at column instead of actually deleting records. All image queries would need an additional constraint checking if deleted_at is null.

We'd also need HTTP routes to un-delete an image (set its deleted_at to null).

Frontend

On the frontend, we'd need another area to the gallery that displays all deleted images, multi-select functionality and UI to un-delete them.

It's probably best to not worry about categorizing the deleted images - just paginate them. This could use a much simpler pagination and caching strategy than the rest of the gallery, which is a bit involved.

I'm happy to chat if anybody wants to raise their hand for this.

kurayami07734 commented 1 year ago

please assign me to this issue

Millu commented 1 year ago

please assign me to this issue

Can do! Are you in the Discord as well?

kurayami07734 commented 1 year ago

Joined it now

Developer-42 commented 4 months ago

What happend with this? Is it abandoned or already implemented?

psychedelicious commented 4 months ago

@Developer-42 The person who asked to be assigned hasn't worked on it.