continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.05k stars 253 forks source link

[Bug]: Extension path error after moving and renaming WebUI dir #505

Open ytchen175 opened 5 months ago

ytchen175 commented 5 months ago

Is there an existing issue for this?

Have you read FAQ on README?

What happened?

The extension sd-webui-animatediff not working due to a path error, I traced some code and found this part, I suspect this is the root cause.

In animatediff_mm.py

    def get_model_dir(self):
        model_dir = shared.opts.data.get("animatediff_model_path", os.path.join(self.script_dir, "model"))
        if not model_dir:
            model_dir = os.path.join(self.script_dir, "model")
        return model_dir

Where can I specify or reset the animatediff_model_path in shared.opts.data ?

p.s. Actually, I have a lot of extensions, but only this causes errors.

OS: Windows 11

Steps to reproduce the problem

  1. Install sd-webui-animatediff from any source (WebUI, git pull, etc...)
  2. Execute webui-user.bat
  3. WebUI crashed

What should have happened?

The extension needs to be working.

Commit where the problem happens

webui: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5 extension: sd-webui-animatediff

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

* --xformers
* --upcast-sampling
* --opt-split-attention
* --disable-safe-unpickle

Console logs

*** Error calling: C:\Users\ytc\Desktop\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\sd-webui-animatediff\scripts\animatediff.py/ui
    Traceback (most recent call last):
      File "C:\Users\ytc\Desktop\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\modules\scripts.py", line 547, in wrap_call
        return func(*args, **kwargs)
      File "C:\Users\ytc\Desktop\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\sd-webui-animatediff\scripts\animatediff.py", line 45, in ui
        unit = AnimateDiffUiGroup().render(
      File "C:\Users\ytc\Desktop\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\sd-webui-animatediff\scripts\animatediff_ui.py", line 290, in render
        model_list = self.get_model_list()
      File "C:\Users\ytc\Desktop\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\sd-webui-animatediff\scripts\animatediff_ui.py", line 259, in get_model_list
        os.mkdir(model_dir)
    FileNotFoundError: [WinError 3] The system cannot find the path specified.: 'C:\\Users\\ytc\\Desktop\\stable-diffusion-webui_v1.6.0_t1.13.1\\extensions\\sd-webui-animatediff\\model'

Additional information

I moved and renamed my WebUI folder, and I also installed sd-webui-animatediff before but I removed it by deleting the whole directory, now while I install it, it will cause a path error.

Before move : Desktop/stable-diffusion-webui_v1.6.0_t1.13.1 After move : Desktop/StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI

ytchen175 commented 5 months ago

I noticed that my ui-config.json was broken weirdly, so I deleted ui-config.json and the cache.json, then rerun webui-user.bat, and the above issue was solved!

ytchen175 commented 5 months ago

Nope...I found that the problem still exists, the above part doesn't really solve the issue, so I reopen this.