stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Save commit number with each generated image

Open blobbfobb opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Append the commit number to the generation information saved as chunks to PNG files and elsewhere this information is saved.

Proposed workflow

  1. Go to the WebUI and generate an image.
  2. Load the generated image in the PNG info tab.
  3. The commit number should be displayed in a field of its own.

Additional information

The same prompts and settings sometimes generate different images after a commit. Sometimes it may be important for someone to be able to recreate an image, e.g. when the prompt has been saved but the image has been lost, and then it would be nice to know which commit the person needs to pull.

Basically it would be nice to have all the information that is relevant to recreating an image (e.g. hardware), but if that is not possible or wanted (e.g. for privacy reasons), adding the commit number should be easy enough.

blobbfobb avatar Feb 19 '23 21:02 blobbfobb

Just a heads up that this could be quite confusing because it is possible to have commit identifiers that no-one else has.

For example, my installation of the webui is I have a separate branch, with extensions installed/committed as submodules and I non-fast-forward merge in master as-and-when I want/need to, tagging the last commit before I do so with the date.. as it makes my experience more stable (I mean, that is effectively what I am doing.. maintaining my own stable branch). However, this means my commit id is unique to my install!

Xyem avatar Feb 22 '23 12:02 Xyem

Was implemented in https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ab4ab4e595e89d1a9a39db70539d5944fdbe47fa

catboxanon avatar Aug 20 '23 12:08 catboxanon

@catboxanon Here is the info saved with a generated image. This is the current commit (https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/68f336bd994bed5442ad95bad6b6ad5564a5409a), I have git pulled yesterday. Where in that info do you see the commit number?

a medium shot portrait of a tantalising blonde woman, nervous anxious afraid, (25-years old, German), (in a luxury shopping mall), sundress, high resolution
Negative prompt: 3d, cartoon, hands, fingers
Steps: 40, Sampler: DPM++ 2M Karras, CFG scale: 6, Seed: 2709964085, Size: 512x768, Model hash: aa78bfa99c, Model: epicrealism_newEra, Denoising strength: 0.5, Hires upscale: 1.5, Hires steps: 20, Hires upscaler: 4xESRGAN, Version: v1.5.1

blobbfobb avatar Aug 21 '23 06:08 blobbfobb

The Version field. It actually tries to use the tag, specifically the output of git describe --tags, and if the program wasn't installed via git then it will use the latest version number in the README.

When running on the dev branch the output of that aforementioned command will actually produce a commit number since it isn't tied to a release tag, like v1.5.1-569-gd02c4da4.

catboxanon avatar Aug 21 '23 07:08 catboxanon

@catboxanon Well, then, why not make the master branch display the commit number as well? Cannot be more than two minute's work...

blobbfobb avatar Aug 24 '23 15:08 blobbfobb

PRs welcome. I personally don't see the benefit in displaying the commit hash when the tag is much more meaningful (and does contain the hash when necessary)

catboxanon avatar Aug 24 '23 15:08 catboxanon

@catboxanon Different versions of Automatic1111 WebUI do not always generate the same image even when all settings are the same. Therefore it is useful to know which version was used. As far as I am aware, reverting to an older version of Automatic1111 requires knowing the commit hash, otherwise you cannot git checkout. But maybe I'm mistaken.

blobbfobb avatar Aug 24 '23 23:08 blobbfobb

git show-ref -s v1.5.1

Any breaking changes that don't allow images to be generated identical are also documented in the wiki. If something can't be replicated that's a problem and should ideally have an issue opened with steps on how to reproduce it (I can still generate identical images from last September for example). If it involves 3rd party extensions though that may complicate it because that's out of our control. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Seed-breaking-changes

catboxanon avatar Aug 24 '23 23:08 catboxanon