Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3.0 "delete" in history view does not delete the image #121

Open
mpdehaan opened this issue Sep 25, 2022 · 2 comments
Open

0.3.0 "delete" in history view does not delete the image #121

mpdehaan opened this issue Sep 25, 2022 · 2 comments

Comments

@mpdehaan
Copy link

Thanks for making a really nice distribution for this, very well done! Looking forward to seeing what happens in future updates.

I noticed in 0.3.0 image history is saved in "~/.diffusionbee/images" in the home directory, but many users may not know this. As they use SD over time, this directory will keep growing and getting larger.

I would suggest that pressing "delete" on an image in the "history" tab also deletes the corresponding images in this folder. Alternatively, you may also want to prefix the images with a directory named after the date they are created or something, so it's easier to find/delete old content.

@mattbisme
Copy link

I'm using version 1.5.1 and this is still an issue. It won't be obvious at all to most users that pressing "delete" won't actually delete the saved images.

@thataboy
Copy link

here is a quick and dirty python3 script I use to move to the trash files in ~./diffusionbee/images/ that are no longer in history

#!/usr/bin/env python3

import os
import json
import send2trash

bee_path = os.path.expanduser("~/.diffusionbee")
json_path = os.path.join(bee_path, "data.json")

with open(json_path) as f:
    data = json.load(f)

imgs_array = []

for key in data['history']:
    imgs_array += data['history'][key]['imgs']

imgs_path = os.path.join(bee_path, "images")

for root, dirs, files in os.walk(imgs_path):
    for file in files:
        img_path = os.path.join(root, file)
        if img_path not in imgs_array:
            print("pruning %s " % img_path)
            send2trash.send2trash(img_path)

The script uses send2trash, which you may need to install with

pip3 install send2trash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants