divamgupta / diffusionbee-stable-diffusion-ui

Diffusion Bee is the easiest way to run Stable Diffusion locally on your M1 Mac. Comes with a one-click installer. No dependencies or technical knowledge needed.
https://diffusionbee.com
GNU Affero General Public License v3.0
12.63k stars 630 forks source link

Auto generated file names / auto-save #39

Open YoavGivati opened 2 years ago

YoavGivati commented 2 years ago

by default should save images to a designated folder with <timestamp>.png. naming things is the hardest part.

alternatively could name files a filename-safe-version-of-the-prompt-1.png that increments.

moonpost commented 2 years ago

would be a nice option to have!

kintz09 commented 2 years ago

I'm so happy I found this installer, it makes it so easy and allows me to use my own resources!

I was going to request this same feature.

I found myself going through and saving each generated image to a folder of my choosing with the file name being the prompt. It would amazing if this was an option in the application. I imagine the user could choose the location to be saved and could say what they want the file name to be. For example, the default setting could be the prompt text. Although, I do wonder what would happen when the prompt text is too long for a file name.

Ultimately, I'd like the process of saving my work to be automated. It would even be acceptable to me if each image generated was assigned a unique id and the file name was the unique id. Then maybe in a CSV or some other file, the unique id and prompt text could be saved.

I'm sure everyone has their own preferences and process, so the solution should be simple and generic to start.

jemueller commented 2 years ago

plus one... this would be really helpful and useful to have all the images autosave for sorting later instead of having to click and name and save each one.

thanks

elbowdonkey commented 2 years ago

One of the SD forks I've used handled image saving pretty well. It'd create a directory, the name of which would be a "path-safe" version of the prompt you used. This same fork was optimized for batch processing, so create a directory for each prompt works pretty well since you'd typically generate 10-50 images from a single prompt. I'd love something like that with DiffusionBee, especially since it's considerably slower than the other rig I've been using (which has a Nvidia A6000 GPU).

Slower processing means longer waiting, making the idea of batch processing and automatic saving even more valuable.

moonpost commented 2 years ago

that sounds great. what kind of speeds do you get per image? on my Mac Studio Ultra its about 15-18 seconds per image

elbowdonkey commented 2 years ago

On an 8 core M1 Pro, using this M1 optimized fork of stable diffusion, I'm seeing it take about 60 seconds per 512x512 image with steps set to 50, guidance scale of 7.5.

60 seconds per image seems a bit slow, though maybe I've been spoiled by the A6000.

15-18 seconds per image sounds is great. It also shows the difference between an M1 Ultra and the M1 Pro.

scottschram commented 2 years ago

Mac Studio taking 11 seconds for 25 steps, 22 seconds for 50 steps 512x512.

It uses ~40% of (one?) CPU.

Model Name: Mac Studio Model Identifier: Mac13,2 Chip: Apple M1 Ultra Total Number of Cores: 20 (16 performance and 4 efficiency) Memory: 64 GB It goes to 100% (of all?) GPU usage according to activity monitor, so the limiting factor is probably this: GPU Cores: 48

Delighted to have something useful for this hardware to do!

scottschram commented 2 years ago

The files are auto-saved with incrementing numbers in /tmp/samples . For example: 00082.png

In terminal, you can open a finder window there like this.

cd /tmp/samples open .

I don't know how long they stay there before auto-deletion. Maybe up to the next reboot.

iangilman commented 2 years ago

As of version 0.3.0, the images are no longer being saved in /tmp. Does anyone know where they have moved to? I realize the history is persistent now, but I don't want to have to hit save image individually for each and every image in the history!

jemueller commented 2 years ago

its in ~/.diffusionbee/images now

iangilman commented 2 years ago

Awesome, thank you! That's a better place for it than /tmp 😄

barryanders commented 2 years ago

that sounds great. what kind of speeds do you get per image? on my Mac Studio Ultra its about 15-18 seconds per image

@elbowdonkey @scottschram Are you guys seeing a speed difference on DiffusionBee since you last posted results a couple months ago with your M1 Ultra? I'm on a M1 Pro, 16 GPU cores, 16gb ram, and am getting the 512x512 images in about 25 seconds for 35 steps on version 1.4.3 using v1.5 of SD.

moonpost commented 2 years ago

With v1.4.3 my Mac Studio M1 Ultra is taking about 8 seconds for 25 steps, and about 15 seconds for 50 steps 512x512.

Model Name: Mac Studio Model Identifier: Mac13,2 Chip: Apple M1 Ultra Memory: 64 GB CPU Cores: 20 GPU Cores: 48

scottschram commented 2 years ago

I'm getting about 7 seconds for 25 steps and 12 seconds for 50 steps. (Only counting the generation with the progress bar).

Model Name: Mac Studio Model Identifier: Mac13,2 Chip: Apple M1 Ultra Total Number of Cores: 20 (16 performance and 4 efficiency) Memory: 64 GB GPU Cores: 48