kabachuha / sd-webui-text2video

Auto1111 extension implementing text2video diffusion models (like ModelScope or VideoCrafter) using only Auto1111 webui dependencies
Other
1.28k stars 107 forks source link

[Bug]: Error loading script: text2vid.py #105

Closed ImmortalPie closed 1 year ago

ImmortalPie commented 1 year ago

Is there an existing issue for this?

Are you using the latest version of the extension?

What happened?

When I launch auto1111 webui I get this error message:

Error loading script: text2vid.py Traceback (most recent call last): File "C:\SD\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\SD\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\SD\stable-diffusion-webui\extensions\sd-webui-text2video\scripts\text2vid.py", line 33, in from modelscope.t2v_pipeline import TextToVideoSynthesis, tensor2vid ModuleNotFoundError: No module named 'modelscope.t2v_pipeline'

The tab for the extension does not show up. Reinstalling the extension does not change anything.

Steps to reproduce the problem

  1. Launch webui
  2. See error

What should have happened?

No error and the extension just works.

WebUI and Deforum extension Commit IDs

webui commit id - 22bcc7be428c94e9408f589966c2040187245d81 txt2vid commit id - 1e32b561786f8763a2f87fcd122bc18804e4a7ab

What GPU were you using for launching?

3090 24GB

On which platform are you launching the webui backend with the extension?

Local PC setup (Windows)

Settings

Launch options: --opt-sdp-attention --port 7861

Console logs

Loading A111 WebUI Launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 i   Settings file found, loading
 →   Updating Settings File  ✓
 i   Launcher Version 1.7.0
 i   Found a custom WebUI Config
 i   No Launcher launch options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 →   Checking requirements :
 i   Python 3.10.6150.1013 found in registry:  C:\Users\theim\AppData\Local\Programs\Python\Python310\
 i   Clearing PATH of any mention of Python
 →   Adding python 3.10 to path  ✓
 i   Git found and already in PATH:  c:\program files\git\cmd\git.exe
 i   Automatic1111 SD WebUI found:  C:\SD\stable-diffusion-webui
 i   One or more checkpoint models were found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Loading Complete, opening launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 i   Arguments are now: --opt-sdp-attention --port 7861
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Webui
 ✓   Done
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: a1111-stable-diffusion-webui-vram-estimator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: canvas-zoom
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: openpose-editor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: sd-extension-system-info
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: sd-webui-3d-open-pose-editor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: sd-webui-aspect-ratio-helper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: sd-webui-controlnet
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: sd-webui-text2video
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: Stable-Diffusion-Webui-Civitai-Helper
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: stable-diffusion-webui-depthmap-script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: stable-diffusion-webui-state
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: text-to-video-synthesis-webui
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ↺   Updating Extension: ultimate-upscale-for-automatic1111
 ✓   Done
 i   Arguments are now: --opt-sdp-attention --port 7861
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  WEBUI LAUNCHING VIA EMS LAUNCHER, EXIT THIS WINDOW TO STOP THE WEBUI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 !   Any error happening after 'commit hash : XXXX' is not related to the launcher. Please report them on Automatic1111's github instead :
 ☁   https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cancel
venv "C:\SD\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI

Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt5 requirement for depthmap script

Installing requirements

Launching Web UI with arguments: --autolaunch --opt-sdp-attention --port 7861
No module 'xformers'. Proceeding without it.
C:\SD\stable-diffusion-webui\venv\lib\site-packages\torchvision\transforms\functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
  warnings.warn(
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: C:\SD\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json
Error loading script: text2vid.py
Traceback (most recent call last):
  File "C:\SD\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "C:\SD\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\SD\stable-diffusion-webui\extensions\sd-webui-text2video\scripts\text2vid.py", line 33, in <module>
    from modelscope.t2v_pipeline import TextToVideoSynthesis, tensor2vid
ModuleNotFoundError: No module named 'modelscope.t2v_pipeline'

2023-04-12 11:11:17,949 - modelscope - INFO - PyTorch version 2.0.0+cu118 Found.
2023-04-12 11:11:17,951 - modelscope - INFO - TensorFlow version 2.12.0 Found.
2023-04-12 11:11:17,951 - modelscope - INFO - Loading ast index from C:\Users\theim\.cache\modelscope\ast_indexer
2023-04-12 11:11:18,064 - modelscope - INFO - Loading done! Current index file version is 1.4.1, with md5 9e8827f43490c3a4d08077715252d77d and a total number of 842 components indexed
Loading weights [1a189f0be6] from C:\SD\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned.safetensors
Creating model from config: C:\SD\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: C:\SD\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying scaled dot product cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 3.8s (load weights from disk: 0.5s, create model: 0.3s, apply weights to model: 0.5s, apply half(): 0.5s, load VAE: 0.1s, move model to device: 0.6s, load textual inversion embeddings: 1.3s).
[VRAMEstimator] No stats available, run benchmark first
Running on local URL:  http://127.0.0.1:7861

To create a public link, set `share=True` in `launch()`.
Startup time: 16.5s (import torch: 3.5s, import gradio: 0.8s, import ldm: 0.4s, other imports: 0.9s, load scripts: 4.1s, load SD checkpoint: 4.1s, create ui: 2.4s, gradio launch: 0.2s).

Additional information

Works fine with a fresh install webui and just the extension added, no idea why it wont work with my current setup.

kabachuha commented 1 year ago

Try making a fresh reinstall of webui (of course, backup your models, outputs, etc, but not the venv and any configuration files). In my experience, it's an environment issue

ImmortalPie commented 1 year ago

That's what I ended up doing, could not figure it out. A fresh install and then adding all my extensions, models and settings back from scratch was the only way I could get it working again. I'll mark as closed, as you said likely a one off issue with my env, not necessarily an issue with the extension.

dathide commented 1 year ago

I had a similar issue with a fresh installation of A1111 1.3.2

Error loading script: api_t2v.py
Traceback (most recent call last):
  File "/home/sapien/m2/ai-vid/a1111-vid/modules/scripts.py", line 263, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/sapien/m2/ai-vid/a1111-vid/modules/script_loading.py", line 10, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/sapien/m2/ai-vid/a1111-vid/extensions/text2video/scripts/api_t2v.py", line 33, in <module>
    from t2v_helpers.video_audio_utils import find_ffmpeg_binary
ModuleNotFoundError: No module named 't2v_helpers'

I fixed it by reinstalling the extension without a custom directory name Edit: I think it could also be fixed by changing line 10 in extensions/txt2vid extension dir/scripts/api_t2v.py to match the extension dir