Git Product home page Git Product logo

sd-webui-prompt-history's Introduction

sd-webui-prompt-history's People

Contributors

alzera avatar namkazt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sd-webui-prompt-history's Issues

TypeError 'float' object cannot be interpreted as an integer - when enabling Automatic Save in settings

Kind of new to the SD ecosystem. Been tinkering for a few days with it, getting more and more extensions, today especially, so this might be as well some conflict with other extensions. My latest experiments were to save the state of checkpoint and ControlNet settings.

version 9a97eeff
Fri Jun 16 09:39:37 2023

I'm getting this error when I try to generate with any settings. ControlNet is disabled

Error completing request███████████████████████████████████████████████████████████████| 21/21 [00:01<00:00, 11.05it/s]
Arguments: ('task(nb2r8smmhldxhxv)', 'sunset in the mountains', '', [], 21, 16, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002342CEB1660>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002342CEB0D90>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002342CEB3940>, None, False, '0', 'M:\AI\stable-diffusion-webui\extensions/sd-webui-faceswap/models\inswapper_128.onnx', 'CodeFormer', 1, '', 1, 1, False, True, False, False, 0, None, [], 0, False, [], [], False, 0, 1, False, False, 0, None, [], -2, False, [], False, 0, None, None, False, 1, 0, '', '', 20, True, 20, True, 4, 0.4, 7, 512, 512, True, 88, False, 'None', False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, None, None, False, None, None, False, 50, True, 0, '', '', 20, True, 20, True, 4, 0.4, 7, 512, 512, True, 88, False, 'None') {}
Traceback (most recent call last):
File "M:\AI\stable-diffusion-webui\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "M:\AI\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "M:\AI\stable-diffusion-webui\modules\txt2img.py", line 57, in txt2img
processed = processing.process_images(p)
File "M:\AI\stable-diffusion-webui\extensions\sd-webui-prompt-history\lib_history\image_process_hijacker.py", line 25, in process_images
global_state.add_config( uuid.uuid4().hex, res.prompt[:64], shared.opts.sd_model_checkpoint, res.infotexts[0], res.images[0])
File "M:\AI\stable-diffusion-webui\extensions\sd-webui-prompt-history\scripts\prompt_history_script.py", line 69, in add_config
img = img.resize((new_width, new_height), Image.LANCZOS)
File "M:\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 2193, in resize
return self._new(self.im.resize(size, resample, box))
TypeError: 'float' object cannot be interpreted as an integer

mpatibility with SD.Next from VLAD

This is great extension and working very well with A1111, sadly I am getting error when using it with SD.Next Vlads fork from A1111.

20:40:48-409139 ERROR    gradio call: AttributeError
╭────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────╮
│ F:\!AI\StableDiffusion\automatic\modules\call_queue.py:34 in f                                                                                         │
│                                                                                                                                                        │
│    33 │   │   │   try:                                                                                                                                 │
│ ❱  34 │   │   │   │   res = func(*args, **kwargs)                                                                                                      │
│    35 │   │   │   │   progress.record_results(id_task, res)                                                                                            │
│                                                                                                                                                        │
│ F:\!AI\StableDiffusion\automatic\modules\txt2img.py:56 in txt2img                                                                                      │
│                                                                                                                                                        │
│   55 │   if processed is None:                                                                                                                         │
│ ❱ 56 │   │   processed = processing.process_images(p)                                                                                                  │
│   57 │   p.close()                                                                                                                                     │
│                                                                                                                                                        │
│ F:\!AI\StableDiffusion\automatic\extensions\sd-webui-prompt-history\lib_history\image_process_hijacker.py:25 in process_images                         │
│                                                                                                                                                        │
│   24 │   # add result to history                                                                                                                       │
│ ❱ 25 │   global_state.add_config( uuid.uuid4().hex, res.prompt[:64], shared.opts.sd_model_che                                                          │
│   26 │   return res                                                                                                                                    │
│                                                                                                                                                        │
│ F:\!AI\StableDiffusion\automatic\extensions\sd-webui-prompt-history\scripts\prompt_history_script.py:76 in add_config                                  │
│                                                                                                                                                        │
│    75 │   │   img = img.resize((new_width, new_height), Image.LANCZOS)                                                                                 │
│ ❱  76 │   │   images.save_image_with_geninfo(img, None, os.path.join(global_state.history_path                                                         │
│    77 │   else:                                                                                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'modules.images' has no attribute 'save_image_with_geninfo'

please add support for vlads SD.Next: https://github.com/vladmandic/automatic

Problem with Automatic1111 1.6

In 1.6 version of automatic1111 web ui the thumbnail are broken and not visible, the image are not written in the data folder of extension, pagination not work anymore

Feature Request

It would be nice to be able to select multiple history items and batch delete.

img2img History

I like this extension. I would suggest to add functionality to store the history of the img2img. You could store the image as a hash value if needed. I look forward to your updates!

No prompt info saved on Lora/checkpoints previews

Hi, kind of a weird and minor issue, but reporting anyway

How to reproduce:

  • Install the extension
  • Generate any image
  • Go to a LORA or checkpoint
  • Open settings
  • Click replace preview
  • Go to PNG info tab
  • Put the preview you just generated (the one saved in your model folder)

Expected: it gives all the generation info for that image
Actual: it says "None"
Screenshot 2023-10-30 220703

It never ever works for me on Collab and RunPods

Only saw this working once when installed on local PC. On other platforms - showing Error or infinite loading
Maybe try to test it? Now it useless and only wasting people time struggling to make it run.

image

Attribute error

AttributeError: module 'modules.images' has no attribute 'save_image_with_geninfo'
100%|█████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 8.50it/s]
12:32:34-610368 ERROR Exception: module 'modules.images' has no attribute 'save_image_with_geninfo'
12:32:34-611370 ERROR Arguments: args=('task(7dn3cjeb090c7dn)', 'Handsome Disney prince, Pixar style', '',
['Default_Negative'], 20, 0, False, False, 1, 1, 6, 1, -1.0, -1.0, 0, 0, 0, False, 512, 512,
False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96,
96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2,
0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2,
-1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2,
'', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False,
2048, 128, True, True, True, False, False, 7, 100, 'Constant', 0, 'Constant', 0, 4,
<scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002DC5B30D030>,
<scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002DC5B1B0FA0>,
<scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002DC5B2375B0>,
False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '',
'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0,
'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4,
'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True,
'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False,
'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28,
'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_restore_face': False, 'ad_controlnet_model':
'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0,
'ad_controlnet_guidance_end': 1}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt':
'', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0,
'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4,
'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True,
'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False,
'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28,
'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_restore_face': False, 'ad_controlnet_model':
'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0,
'ad_controlnet_guidance_end': 1}, None, False, '0',
'C:\automatic\extensions/sd-webui-faceswap/models\inswapper_128.onnx', 'CodeFormer', 1, '',
1, 1, False, True, False, '1:1,1:2,1:2', '0:0,0:0,0:1', '0.2,0.8,0.8', 150, 0.2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, False, False, 'positive', 'comma', 0, False, False, '', 7, '', [], 0,
'', [], 0, '', [], True, False, False, False, 0, False, None, None, False, None, None, False,
None, None, False, 50) kwargs={}
12:32:34-618376 ERROR gradio call: AttributeError
╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮
│ C:\automatic\modules\call_queue.py:34 in f │
│ │
│ 33 │ │ │ try: │
│ ❱ 34 │ │ │ │ res = func(*args, **kwargs) │
│ 35 │ │ │ │ progress.record_results(id_task, res) │
│ │
│ C:\automatic\modules\txt2img.py:56 in txt2img │
│ │
│ 55 │ if processed is None: │
│ ❱ 56 │ │ processed = processing.process_images(p) │
│ 57 │ p.close() │
│ │
│ C:\automatic\extensions\sd-webui-prompt-history\lib_history\image_process_hijacker.py:29 in process_images │
│ │
│ 28 │ img = res.images[0] │
│ ❱ 29 │ images.save_image_with_geninfo(img, None, os.path.join(global_state.history_path, f" │
│ 30 │ # add result to history │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'modules.images' has no attribute 'save_image_with_geninfo'

Windows11, Firefox

Settings No Longer Match Instructions - Data Storage Path - No Images Display

I have the latest Automatic1111 on Mac M1 with latest MacOS. When I go to Settings > Uncategorized > Prompt History, I see the following settings:

  1. Enable Checkbox (checked)
  2. Data Storage Path - this is empty because I have no idea what I'm supposed to enter into this field.
  3. Preview thumbnail size in table - 96.
  4. Number of history items to display per page - 15.
  5. Automatic Save checkbox (checked).
  6. Save Thumbnail is set to "Thumbnail" (other choices are "none" or "full".

After deleting and reloading this extension because I cannot get images to display in the Preview column, nor when clicking on a row and looking to the "Preview" box on the right. THAT is still a problem. On top of that, now I have no idea what to put into the Data Storage Path.

Does this simply not work on Mac M1 chips?

Request: Option to use last image rather than grid

When clicking on a prompt that has a lot of generations, therefore a large grid file, the interface takes a while to respond.

Solution: Option that uses the last(or first, doesn't matter) generated image rather than the last grid.

Error while no prompts saved.

Hello again, just noticed when I added an extension to the fresh sd setup, that there is an error on the Prompt History tab and error gone only when I'm generated first image and restarted sd.

Feature request

This may help many people.

  1. History page number input: So the user has an option other than the Prev & Next

  2. Gallery View : User than hover over the pics and have something like a [Lightbox] popout hovering

  3. Export option: Not sure if already have this feature or workaround. From time to time the Web-UI A1111 crashes and needs to be reinstalled, but would like to have all the history migrated to new fresh install.

Your extension is very useful and make working more efficient....Thank you for creating this.

Issues with un clickable buttons

2023-09-23_22-57-27

The buttons the checkboxes can't be checked, the next button needs to be pressed outside the box. It had worked a few days ago but now is unusable. Anything inside the border, but if I increase Number of history items display per page, anything outside the border will work

Keep up the good work very useful and simple to use, while it lasted. :)

Something in data folder preventing Automatic1111 from reloading UI

Hello, for the past week I have been having an issue where reloading UI in Automatic1111 will be stuck, so I would have to restart the entire application for it to work again. I use https://github.com/AbdBarho/stable-diffusion-webui-docker to run, so I am not sure if there are any additional error messages that might show, but I do not see any in my console. Today when making a fresh copy of Automatic1111, I copied the old data folder from this extension to the new copy. After this, the same issue (stuck on reloading UI) occurred, so I deleted data folder and it is fine now.

Please let me know if you would like to investigate if there is no other cause you can think of that I can try, I can email my data.json file to you. Thanks!

Configurable directory to store history

Please add a text box in UI Settings to configure the directory where history data will be saved.
Useful to use HDD not SSD or just in case of reinstall.
Thank you :)

favorites or bookmarks

Hello! it would be very convenient to highlight or add some promts in favorites or bookmarks to have not only the history, but also the most frequently used promts in quick access

Conflict with AnimateDiff

I could not get AnimateDiff to run it's final GIF preview after image generation. It comes up with the a series of errors that ends with:
AttributeError: 'str' object has no attribute 'height'

After disabling this extension, all works fine. I run about 18 extensions, this the only one giving problems for AnimateDiff

GradioDeprecationWarning: The `style` method is deprecated.

WARNING:py.warnings:C:\stable-diffusion\Packages\stable-diffusion-webui\extensions\sd-webui-prompt-history\scripts\prompt_history_script.py:146: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead.
preview_image = gr.Image(
I get this warning every load.

[Feature Request/Possible bug?] Include refiner as part of the history.

The refiner model and the point at which it was switched are displayed as part of the output after image generation. It's not included in the prompt history.

I'm not sure if this is because it's a new feature (I think), which would make this a feature request, or if it was an oversight, which might make this more of a bug.

Either way, I think the refiner and the point it was switched are necessary/very useful to include in the prompt history so it could be re-applied.

[BUG] Breaks the "Reload UI" functionality (via the top-right button in "Settings")

For some reason, when using this extension, restarting the UI via the "Reload UI" button in "Settings" doesn't work:

image

It simply displays Restarting UI... in the console and hangs forever, not even Ctrl+C will interrupt it.

I've also tested running the server with DEBUG verbosity; no additional information about why reload UI could've frozen was displayed in the console.

"Apply and restart UI" in the Extensions tab does still work, that effectively restarts the entire server though.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'unnamed_endpoints')

There's a bug on the very first attempt to open this. I have included the console log as the title. Below is the part of the client/js/dist/index.js file that appears to be causing the issue.

function submit(endpoint, data, event_data) {
        let fn_index;
        let api_info;
        if (typeof endpoint === "number") {
          fn_index = endpoint;
          api_info = api.unnamed_endpoints[fn_index];
        } else {
          const trimmed_endpoint = endpoint.replace(/^\//, "");
          fn_index = api_map[trimmed_endpoint];
          api_info = api.named_endpoints[endpoint.trim()];
        }

Show small thumbnails in the list

It would be nice if you could show small thumbnails on lists left side . It would be more intuitive to select item instead of clicking each one to find image that you have in memory ;)

Thank you!

Displaying origin (dynamic) prompt

Hello!
First of all - thanks for the great extension, I was already thinking to create something similar.

I had an idea saving positive/negative origin prompts from text boxes to keep dynamic prompts as is. I see that in the left column there are part of origin prompt but it isn't possible to use it because full one that is under an thumbnail is already precessed dynamic prompt. Is there any way to keep origin one?

image

"Delete all" button

It'd be awesome to have a clear all button for all saved images/prompts in prompt history.

Is recording scripts used and their parameters part of the roadmap?

currently history does not get recorded when using scripts, i.e. does not record the history when x/y/z plot script usage and parameters are used. is this on the roadmap or out of scope. since script usage and parameters are already capable of being recorded, is it merely a matter of reading those log entries into a new 'prompt history by script' section. apologies for my asking as I green when it comes to using the github. I will explore expanding the script myself if it's not accomplished elsewhere, or if you consider it out of scope. Thank you for writing this, it's simple and clean and works well. I am unfamiliar with many prompt history/saving/loading techniques, so anything to help ease the burden can be a big help.

Delete selected is too big

I have an issue that there is a box that says Delete Selected that prevents me from clicking on the images
obraz
This happends in chrome and edge. I recently updated - was fine before.

Missing thumbnails in SD.Next due to naming scheme.

It appears that SD.Next auto prefixes a 5-padded sequence number to image filenames.

So PH looks for af93b01e63994f51914fa1062bd692eb.jpg but can't find it, since the file name is 00000-af93b01e63994f51914fa1062bd692eb.jpg

Appears broken

Hey,
Not sure what's this page supposed to show.
Could you also add more instructions incase I'm doing something wrong.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.