Sygil-Dev / sygil-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
7.85k stars 889 forks source link

[Bug]: Settings broken without GPU #1782

Open jangrewe opened 1 year ago

jangrewe commented 1 year ago

What happened?

I only have 2GB VRAM on my "server", and because of that i always run out of memory even with all (i think) the optimizations enabled. So i tried skipping the --gpus all, as i found some discussions and PR that suggest using only the CPU should also work (even if it's a bit slow).

Unfortunately, when going to the Settings page, i then immediately get an error because no GPU is found: "IndexError: list index out of range"

File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script
    exec(code, module.__dict__)
File "/sd/scripts/webui_streamlit.py", line 203, in <module>
    layout()
File "/opt/conda/lib/python3.8/site-packages/loguru/_logger.py", line 1251, in catch_wrapper
    return function(*args, **kwargs)
File "/sd/scripts/webui_streamlit.py", line 192, in layout
    layout()
File "/opt/conda/lib/python3.8/site-packages/loguru/_logger.py", line 1251, in catch_wrapper
    return function(*args, **kwargs)
File "/sd/scripts/Settings.py", line 56, in layout
    help=f"Select which GPU to use. Default: {device_list[0]}").split(":")[0])

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Firefox

Where are you running the webui?

Linux

Custom settings

No response

Relevant log output

ERROR      @ 2023-05-06 20:40:32 | __main__:layout:192 - An error has been caught in function 'layout', process 'MainProcess' (29), thread 'ScriptRunner.scriptThread' (139908492556032):
Traceback (most recent call last):

  File "/opt/conda/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x7f3f2b67cca0>
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    │    └ <function Thread.run at 0x7f3f2b67c9d0>
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
    │    │        │    └ ()
    │    │        └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
    │    └ <bound method ScriptRunner._run_script_thread of ScriptRunner(_session_id='f726daa9-eb6c-4b21-9f41-e32ea06a1a81', _main_scrip...
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 298, in _run_script_thread
    self._run_script(request.rerun_data)
    │    │           │       └ <property object at 0x7f3f1275e400>
    │    │           └ ScriptRequest(type=<ScriptRequestType.RERUN: 'RERUN'>, _rerun_data=RerunData(query_string='', widget_states=widgets {
    │    │               id: "...
    │    └ <function ScriptRunner._run_script at 0x7f3f12640040>
    └ ScriptRunner(_session_id='f726daa9-eb6c-4b21-9f41-e32ea06a1a81', _main_script_path='/sd/scripts/webui_streamlit.py', _uploade...
  File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script
    exec(code, module.__dict__)
         │     │      └ <member '__dict__' of 'module' objects>
         │     └ <module '__main__' from '/sd/scripts/webui_streamlit.py'>
         └ <code object <module> at 0x7f3f0853b3a0, file "/sd/scripts/webui_streamlit.py", line 22>

  File "/sd/scripts/webui_streamlit.py", line 203, in <module>
    layout()
    └ <function layout at 0x7f3e0bb93dc0>

> File "/sd/scripts/webui_streamlit.py", line 192, in layout
    layout()
    └ <function layout at 0x7f3e0b7765e0>

  File "/sd/scripts/Settings.py", line 56, in layout
    help=f"Select which GPU to use. Default: {device_list[0]}").split(":")[0])

IndexError: list index out of range
ERROR      @ 2023-05-06 20:40:32 | __main__:<module>:203 - An error has been caught in function '<module>', process 'MainProcess' (29), thread 'ScriptRunner.scriptThread' (139908492556032):
Traceback (most recent call last):

  File "/opt/conda/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x7f3f2b67cca0>
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    │    └ <function Thread.run at 0x7f3f2b67c9d0>
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
    │    │        │    └ ()
    │    │        └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
    │    └ <bound method ScriptRunner._run_script_thread of ScriptRunner(_session_id='f726daa9-eb6c-4b21-9f41-e32ea06a1a81', _main_scrip...
    └ <Thread(ScriptRunner.scriptThread, started 139908492556032)>
  File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 298, in _run_script_thread
    self._run_script(request.rerun_data)
    │    │           │       └ <property object at 0x7f3f1275e400>
    │    │           └ ScriptRequest(type=<ScriptRequestType.RERUN: 'RERUN'>, _rerun_data=RerunData(query_string='', widget_states=widgets {
    │    │               id: "...
    │    └ <function ScriptRunner._run_script at 0x7f3f12640040>
    └ ScriptRunner(_session_id='f726daa9-eb6c-4b21-9f41-e32ea06a1a81', _main_script_path='/sd/scripts/webui_streamlit.py', _uploade...
  File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script
    exec(code, module.__dict__)
         │     │      └ <member '__dict__' of 'module' objects>
         │     └ <module '__main__' from '/sd/scripts/webui_streamlit.py'>
         └ <code object <module> at 0x7f3f0853b3a0, file "/sd/scripts/webui_streamlit.py", line 22>

> File "/sd/scripts/webui_streamlit.py", line 203, in <module>
    layout()
    └ <function layout at 0x7f3e0bb93dc0>

  File "/sd/scripts/webui_streamlit.py", line 192, in layout
    layout()
    └ <function layout at 0x7f3e0b7765e0>

  File "/sd/scripts/Settings.py", line 56, in layout
    help=f"Select which GPU to use. Default: {device_list[0]}").split(":")[0])

IndexError: list index out of range
2023-05-06 20:40:32.481 Uncaught app exception
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 563, in _run_script
    exec(code, module.__dict__)
  File "/sd/scripts/webui_streamlit.py", line 203, in <module>
    layout()
  File "/opt/conda/lib/python3.8/site-packages/loguru/_logger.py", line 1251, in catch_wrapper
    return function(*args, **kwargs)
  File "/sd/scripts/webui_streamlit.py", line 192, in layout
    layout()
  File "/opt/conda/lib/python3.8/site-packages/loguru/_logger.py", line 1251, in catch_wrapper
    return function(*args, **kwargs)
  File "/sd/scripts/Settings.py", line 56, in layout
    help=f"Select which GPU to use. Default: {device_list[0]}").split(":")[0])
IndexError: list index out of range

Code of Conduct