lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: loading stable diffusion model: RuntimeError #394

Open Ael07 opened 9 months ago

Ael07 commented 9 months ago

Checklist

What happened?

The directml was working fine, then a reboot of windows update happened in the middle of it, i restart the Web UI, it launches but i get the error loading stable diffusion model: RuntimeError ... that i can't figure out.

Steps to reproduce the problem

  1. launch webui-user.bat
  2. it loads the Web UI
  3. loading stable diffusion model: RuntimeError

What should have happened?

it fails at last part of loading model

Stable diffusion model failed to load

What browsers do you use to access the UI ?

No response

Sysinfo

sysinfo-2024-02-24-22-58.json

Console logs

C:\Users\SD direct ML\stable-diffusion-webui-directml>git pull
Already up to date.
venv "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.7.0
Commit hash: 601f7e3704707d09ca88241e663a763a2493b11a
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
Launching Web UI with arguments: --medvram --use-directml --no-half --precision full --opt-sub-quad-attention --opt-split-attention-v1 --theme dark --autolaunch --disable-safe-unpickle --disable-nan-check
Style database not found: C:\Users\SD direct ML\stable-diffusion-webui-directml\styles.csv
ONNX: selected=DmlExecutionProvider, available=['DmlExecutionProvider', 'CPUExecutionProvider']
[-] ADetailer initialized. version: 24.1.2, num models: 9
ControlNet preprocessor location: C:\Users\SD direct ML\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\downloads
2024-02-24 21:27:43,086 - ControlNet - INFO - ControlNet v1.1.440
2024-02-24 21:27:43,250 - ControlNet - INFO - ControlNet v1.1.440
Loading weights [c2c4cba68e] from C:\Users\SD direct ML\stable-diffusion-webui-directml\models\Stable-diffusion\yassking_colab1111.ckpt
2024-02-24 21:27:43,962 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 8.9s (prepare environment: 10.1s, initialize shared: 2.2s, load scripts: 3.9s, create ui: 0.7s, gradio launch: 0.4s).
Creating model from config: C:\Users\SD direct ML\stable-diffusion-webui-directml\configs\v1-inference.yaml
Applying attention optimization: sub-quadratic... done.
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "C:\Users\y\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\y\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\y\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\initialize.py", line 147, in load_model
    shared.sd_model  # noqa: B018
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\shared_items.py", line 143, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_models.py", line 537, in get_sd_model
    load_model()
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_models.py", line 698, in load_model
    sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_models.py", line 575, in get_empty_cond
    return sd_model.cond_stage_model([""])
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_hijack_clip.py", line 234, in forward
    z = self.process_tokens(tokens, multipliers)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_hijack_clip.py", line 273, in process_tokens
    z = self.encode_with_transformers(tokens)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\sd_hijack_clip.py", line 326, in encode_with_transformers
    outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1538, in _call_impl
    result = forward_call(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 822, in forward
    return self.text_model(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 730, in forward
    hidden_states = self.embeddings(input_ids=input_ids, position_ids=position_ids)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\dml\hijack\transformers.py", line 39, in CLIPTextEmbeddings_forward
    embeddings = inputs_embeds + position_embeddings
RuntimeError: Unspecified error

Stable diffusion model failed to load
Traceback (most recent call last):
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 427, in refresh
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 427, in <listcomp>
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 180, in create_html
    self.items = {x["name"]: x for x in self.list_items()}
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 180, in <dictcomp>
    self.items = {x["name"]: x for x in self.list_items()}
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\extensions-builtin\Lora\ui_extra_networks_lora.py", line 74, in list_items
    item = self.create_item(name, index)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\extensions-builtin\Lora\ui_extra_networks_lora.py", line 61, in create_item
    elif shared.sd_model.is_sdxl and sd_version != network.SdVersion.SDXL:
AttributeError: 'NoneType' object has no attribute 'is_sdxl'
Traceback (most recent call last):
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 427, in refresh
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 427, in <listcomp>
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 180, in create_html
    self.items = {x["name"]: x for x in self.list_items()}
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\ui_extra_networks.py", line 180, in <dictcomp>
    self.items = {x["name"]: x for x in self.list_items()}
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\extensions-builtin\Lora\ui_extra_networks_lora.py", line 74, in list_items
    item = self.create_item(name, index)
  File "C:\Users\SD direct ML\stable-diffusion-webui-directml\extensions-builtin\Lora\ui_extra_networks_lora.py", line 61, in create_item
    elif shared.sd_model.is_sdxl and sd_version != network.SdVersion.SDXL:
AttributeError: 'NoneType' object has no attribute 'is_sdxl'

Additional information

No response

Ael07 commented 9 months ago

Thanks for checking this issue, i deleted the file "venv" and launched the webui-user.bat, it installed all the files and then failed in the launch of the webui with the following error;

Installing requirements for segment_anything Installing requirements for lama_cleaner Launching Web UI with arguments: --medvram --use-directml --no-half --precision full --opt-sub-quad-attention --opt-split-attention-v1 --theme dark --autolaunch --disable-safe-unpickle --disable-nan-check Traceback (most recent call last): File "C:\Users\SD direct ML\stable-diffusion-webui-directml\launch.py", line 48, in main() File "C:\Users\SD direct ML\stable-diffusion-webui-directml\launch.py", line 44, in main start() File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\launch_utils.py", line 663, in start import webui File "C:\Users\SD direct ML\stable-diffusion-webui-directml\webui.py", line 13, in initialize.imports() File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\initialize.py", line 36, in imports shared_init.initialize() File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\shared_init.py", line 31, in initialize directml_do_hijack() File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\dml__init.py", line 69, in directml_do_hijack import modules.dml.hijack # pylint: disable=unused-import File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\dml\hijack\init__.py", line 4, in import modules.dml.hijack.realesrgan_model File "C:\Users\SD direct ML\stable-diffusion-webui-directml\modules\dml\hijack\realesrgan_model.py", line 3, in from realesrgan import RealESRGANer ModuleNotFoundError: No module named 'realesrgan' Press any key to continue . . .

i guess something is wrong with this model Realesrgan ... it fails to import it

Thanks