arenasys / stable-diffusion-webui-model-toolkit

A Multipurpose toolkit for managing, editing and creating models.
MIT License
508 stars 34 forks source link

IndexError at startup when --data-dir option is specified #26

Closed nonnonstop closed 1 year ago

nonnonstop commented 1 year ago

Steps to reproduce

  1. Enable this extension
  2. Start webui with --data-dir option like --data-dir=/webui/data

The following error occurs at startup.

Error executing callback ui_tabs_callback for /webui/data/extensions/stable-diffusion-webui-model-toolkit/scripts/toolkit_gui.py
Traceback (most recent call last):
  File "/webui/modules/script_callbacks.py", line 125, in ui_tabs_callback
    res += c.callback() or []
  File "/webui/data/extensions/stable-diffusion-webui-model-toolkit/scripts/toolkit_gui.py", line 696, in on_ui_tabs
    import_dropdown = gr.Dropdown(label="File", choices=name_list, value=name_list[0], interactive=True)
IndexError: list index out of range

Additional info

The path of models directory is changed when the --data-dir option is specified. As a result, no models are found.

This issue may be fixed by #25.

arenasys commented 1 year ago

merged that PR

nonnonstop commented 1 year ago

Fixed. Thank you.