Closed strouder closed 8 months ago
onnxruntime
package does not seem to be correctly installed or working.
you can try forcing reinstallation of all requirements using webui --reinstall
, but other than that, search why onnxruntime
may be broken.
@vladmandic rembg being a built-in feature is also breaking installations.
@vladmandic i tried deleting rembg in the builtin extensions and restarted webui and didnt get errors... when i closed and relaunched webui, the rembg problem is there again.
I just reinstalled and got this error:
Using VENV: D:\AI\Vladimir\venv
18:19:39-365517 INFO Starting SD.Next
18:19:39-365517 INFO Python 3.10.9 on Windows
18:19:39-475303 INFO Version: app=sd.next updated=2023-11-03 hash=dc79cec1
url=https://github.com/vladmandic/automatic/tree/master
18:19:39-710877 INFO Latest published version: 044c31473b0c86c2351d1ff56322337f9d08010b 2023-11-10T05:40:52Z
18:19:39-726503 INFO Platform: arch=AMD64 cpu=AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD system=Windows
release=Windows-10-10.0.22621-SP0 python=3.10.9
18:19:39-726503 INFO nVidia CUDA toolkit detected: nvidia-smi present
18:19:39-726503 INFO Installing package: torch torchvision --index-url https://download.pytorch.org/whl/cu121
18:19:45-341312 INFO Forcing reinstall of all packages
18:19:45-341312 INFO Verifying requirements
18:19:45-341312 INFO Installing package: setuptools
18:19:47-489974 INFO Installing package: addict
18:19:49-709761 INFO Installing package: aenum
18:19:51-988482 INFO Installing package: aiohttp
18:19:54-285942 INFO Installing package: anyio
18:19:56-563612 INFO Installing package: appdirs
18:19:58-507040 INFO Installing package: astunparse
18:20:00-674509 INFO Installing package: blendmodes
18:20:03-873968 INFO Installing package: clean-fid
18:20:06-030793 INFO Installing package: easydev
18:20:07-975995 INFO Installing package: extcolors
18:20:09-939354 INFO Installing package: facexlib
18:20:12-132385 INFO Installing package: filetype
18:20:14-100835 INFO Installing package: future
18:20:16-066274 INFO Installing package: gdown
18:20:18-265374 INFO Installing package: gfpgan
18:20:21-590772 INFO Installing package: GitPython
18:20:23-567971 INFO Installing package: httpcore
18:20:25-548273 INFO Installing package: inflection
18:20:27-728678 INFO Installing package: jsonmerge
18:20:29-884292 INFO Installing package: kornia
18:20:32-108484 INFO Installing package: lark
18:20:34-087059 INFO Installing package: lmdb
18:20:36-608864 INFO Installing package: lpips
18:20:39-299500 INFO Installing package: omegaconf
18:20:41-576523 INFO Installing package: open-clip-torch
18:20:43-773268 INFO Installing package: opencv-contrib-python-headless
18:20:45-777813 INFO Installing package: piexif
18:20:47-926844 INFO Installing package: psutil
18:20:49-950177 INFO Installing package: pyyaml
18:20:51-906145 INFO Installing package: resize-right
18:20:54-016494 INFO Installing package: rich
18:20:56-008367 INFO Installing package: safetensors
18:20:57-985041 INFO Installing package: scipy
18:20:59-992562 INFO Installing package: tb_nightly
18:21:02-256596 INFO Installing package: toml
18:21:04-185603 INFO Installing package: torchdiffeq
18:21:06-083388 INFO Installing package: voluptuous
18:21:07-996781 INFO Installing package: yapf
18:21:09-941419 INFO Installing package: scikit-image
18:21:12-152868 INFO Installing package: basicsr
18:21:14-207695 INFO Installing package: fasteners
18:21:16-105452 INFO Installing package: dctorch
18:21:18-019248 INFO Installing package: compel==2.0.2
18:21:19-991018 INFO Installing package: torchsde==0.2.6
18:21:21-924547 INFO Installing package: antlr4-python3-runtime==4.9.3
18:21:23-822308 INFO Installing package: requests==2.31.0
18:21:25-751326 INFO Installing package: tqdm==4.66.1
18:21:27-706475 INFO Installing package: accelerate==0.20.3
18:21:29-656636 INFO Installing package: opencv-python-headless==4.7.0.72
18:21:31-617304 INFO Installing package: diffusers==0.21.4
18:21:33-561940 INFO Installing package: einops==0.4.1
18:21:35-475362 INFO Installing package: gradio==3.43.2
18:21:38-048198 INFO Installing package: huggingface_hub==0.17.1
18:21:40-031102 INFO Installing package: numexpr==2.8.4
18:21:42-016805 INFO Installing package: numpy==1.24.4
18:21:44-087739 INFO Installing package: numba==0.57.1
18:21:46-094746 INFO Installing package: pandas==1.5.3
18:21:48-117908 INFO Installing package: protobuf==3.20.3
18:21:50-235175 INFO Installing package: pytorch_lightning==1.9.4
18:21:52-305573 INFO Installing package: transformers==4.30.2
18:21:54-313074 INFO Installing package: tomesd==0.1.3
18:21:56-304421 INFO Installing package: urllib3==1.26.15
18:21:58-531464 INFO Installing package: Pillow==9.5.0
18:22:01-323500 INFO Installing package: timm==0.9.7
18:22:03-299767 INFO Installing package: pydantic==1.10.13
18:22:05-322399 INFO Installing package: typing-extensions==4.8.0
18:22:07-314306 INFO Verifying packages
18:22:07-314306 INFO Installing package: git+https://github.com/openai/CLIP.git
18:22:13-025506 INFO Installing package:
git+https://github.com/patrickvonplaten/invisible-watermark.git@remove_onnxruntime_depedency
18:22:18-781447 INFO Installing package: onnxruntime==1.15.1
18:22:20-922040 INFO Installing package: pi-heif
18:22:23-015849 INFO Installing package: tensorflow==2.13.0
18:22:34-077708 INFO Verifying repositories
18:22:38-827120 INFO Verifying submodules
18:22:50-584635 INFO Extensions enabled: ['clip-interrogator-ext', 'Lora', 'sd-extension-chainner',
'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg',
'a1111-sd-webui-lycoris', 'adetailer', 'sd-webui-prompt-history']
18:22:50-589160 WARNING Extensions duplicates: ['sd-webui-controlnet']
18:22:50-589740 INFO Verifying requirements
18:22:50-589740 INFO Installing package: setuptools
18:22:52-735281 INFO Installing package: addict
18:22:54-684745 INFO Installing package: aenum
18:22:56-727725 INFO Installing package: aiohttp
18:22:59-027583 INFO Installing package: anyio
18:23:01-285565 INFO Installing package: appdirs
18:23:03-251777 INFO Installing package: astunparse
18:23:05-210477 INFO Installing package: blendmodes
18:23:08-097049 INFO Installing package: clean-fid
18:23:10-128838 INFO Installing package: easydev
18:23:12-054778 INFO Installing package: extcolors
18:23:14-009882 INFO Installing package: facexlib
18:23:15-976166 INFO Installing package: filetype
18:23:18-144786 INFO Installing package: future
18:23:20-072440 INFO Installing package: gdown
18:23:22-051438 INFO Installing package: gfpgan
18:23:24-996351 INFO Installing package: GitPython
18:23:26-966797 INFO Installing package: httpcore
18:23:28-909014 INFO Installing package: inflection
18:23:30-858322 INFO Installing package: jsonmerge
18:23:32-991141 INFO Installing package: kornia
18:23:34-928392 INFO Installing package: lark
18:23:36-843530 INFO Installing package: lmdb
18:23:38-802113 INFO Installing package: lpips
18:23:40-770335 INFO Installing package: omegaconf
18:23:42-708150 INFO Installing package: open-clip-torch
18:23:44-688572 INFO Installing package: opencv-contrib-python-headless
18:23:46-681753 INFO Installing package: piexif
18:23:48-621837 INFO Installing package: psutil
18:23:50-649187 INFO Installing package: pyyaml
18:23:52-578550 INFO Installing package: resize-right
18:23:54-523192 INFO Installing package: rich
18:23:56-547184 INFO Installing package: safetensors
18:23:58-560641 INFO Installing package: scipy
18:24:00-622417 INFO Installing package: tb_nightly
18:24:02-984257 INFO Installing package: toml
18:24:04-933562 INFO Installing package: torchdiffeq
18:24:06-957348 INFO Installing package: voluptuous
18:24:08-873885 INFO Installing package: yapf
18:24:10-912230 INFO Installing package: scikit-image
18:24:13-234595 INFO Installing package: basicsr
18:24:15-273922 INFO Installing package: fasteners
18:24:17-210968 INFO Installing package: dctorch
18:24:19-164074 INFO Installing package: compel==2.0.2
18:24:21-160629 INFO Installing package: torchsde==0.2.6
18:24:23-096690 INFO Installing package: antlr4-python3-runtime==4.9.3
18:24:25-016452 INFO Installing package: requests==2.31.0
18:24:27-033812 INFO Installing package: tqdm==4.66.1
18:24:29-043197 INFO Installing package: accelerate==0.20.3
18:24:31-038164 INFO Installing package: opencv-python-headless==4.7.0.72
18:24:33-087245 INFO Installing package: diffusers==0.21.4
18:24:35-120054 INFO Installing package: einops==0.4.1
18:24:37-187848 INFO Installing package: gradio==3.43.2
18:24:40-953003 INFO Installing package: huggingface_hub==0.17.1
18:24:42-947371 INFO Installing package: numexpr==2.8.4
18:24:44-926070 INFO Installing package: numpy==1.24.4
18:24:51-432246 INFO Installing package: numba==0.57.1
18:24:53-509308 INFO Installing package: pandas==1.5.3
18:24:55-598119 INFO Installing package: protobuf==3.20.3
18:24:57-722810 INFO Installing package: pytorch_lightning==1.9.4
18:24:59-758339 INFO Installing package: transformers==4.30.2
18:25:01-749610 INFO Installing package: tomesd==0.1.3
18:25:03-696617 INFO Installing package: urllib3==1.26.15
18:25:05-641486 INFO Installing package: Pillow==9.5.0
18:25:08-611927 INFO Installing package: timm==0.9.7
18:25:10-660824 INFO Installing package: pydantic==1.10.13
18:25:12-762419 INFO Installing package: typing-extensions==4.8.0
18:25:14-764819 INFO Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
18:25:14-765340 INFO Command line args: ['--reinstall'] reinstall=True
18:25:21-698316 INFO Engine: backend=Backend.ORIGINAL compute=cuda mode=no_grad device=cuda
cross-optimization="Scaled-Dot-Product"
18:25:21-753783 INFO Device: device=NVIDIA GeForce RTX 3080 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8801
driver=537.58
18:25:22-361904 INFO Available VAEs: path="models\VAE" items=0
18:25:22-362414 INFO Skipping conflicting extension: extensions\sd-webui-controlnet
18:25:22-372438 INFO Available models: path="models\Stable-diffusion" items=15 time=0.01s
18:25:24-184888 INFO Extension: script='extensions-builtin\sd-webui-agent-scheduler\scripts\task_scheduler.py' Using sqlite file: extensions-builtin\sd-webui-agent-scheduler\task_scheduler.sqlite3
18:25:24-690420 INFO Extension: script='extensions-builtin\sd-webui-controlnet\scripts\controlnet.py' Warning:
ControlNet failed to load SGM - will use LDM instead.
18:25:24-692442 INFO Extension: script='extensions-builtin\sd-webui-controlnet\scripts\controlnet.py' ControlNet
preprocessor location:
D:\AI\Vladimir\extensions-builtin\sd-webui-controlnet\annotator\downloads
18:25:24-699928 INFO Extension: script='extensions-builtin\sd-webui-controlnet\scripts\hook.py' Warning: ControlNet
failed to load SGM - will use LDM instead.
18:25:25-737854 ERROR Module load: extensions-builtin\stable-diffusion-webui-rembg\scripts\api.py: ImportError
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮│ D:\AI\Vladimir\modules\script_loading.py:21 in load_module ││ ││ 20 │ │ │ with contextlib.redirect_stdout(io.StringIO()) as stdout: ││ ❱ 21 │ │ │ │ module_spec.loader.exec_module(module) ││ 22 │ │ │ setup_logging() # reset since scripts can hijaack logging ││ in exec_module:883 ││ in _call_with_frames_removed:241 ││ ││ D:\AI\Vladimir\extensions-builtin\stable-diffusion-webui-rembg\scripts\api.py:7 in <module> ││ ││ 6 ││ ❱ 7 import rembg ││ 8 ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\__init__.py:5 in <module> ││ ││ 4 ││ ❱ 5 from .bg import remove ││ 6 from .session_factory import new_session ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\bg.py:21 in <module> ││ ││ 20 ││ ❱ 21 from .session_factory import new_session ││ 22 from .sessions import sessions_class ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\session_factory.py:4 in <module> ││ ││ 3 ││ ❱ 4 import onnxruntime as ort ││ 5 ││ ││ D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\__init__.py:56 in <module> ││ ││ 55 if import_capi_exception: ││ ❱ 56 │ raise import_capi_exception ││ 57 ││ ││ D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\__init__.py:37 in <module> ││ ││ 36 │ from onnxruntime.capi._pybind_state import create_and_register_allocator # noqa: F4 ││ ❱ 37 │ from onnxruntime.capi._pybind_state import create_and_register_allocator_v2 # noqa: ││ 38 │ from onnxruntime.capi._pybind_state import disable_telemetry_events # noqa: F401 │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ImportError: cannot import name 'create_and_register_allocator_v2' from 'onnxruntime.capi._pybind_state'
(D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\capi\_pybind_state.py)
18:25:25-791818 ERROR Module load: extensions-builtin\stable-diffusion-webui-rembg\scripts\postprocessing_rembg.py:
ImportError
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮│ D:\AI\Vladimir\modules\script_loading.py:21 in load_module ││ ││ 20 │ │ │ with contextlib.redirect_stdout(io.StringIO()) as stdout: ││ ❱ 21 │ │ │ │ module_spec.loader.exec_module(module) ││ 22 │ │ │ setup_logging() # reset since scripts can hijaack logging ││ in exec_module:883 ││ in _call_with_frames_removed:241 ││ ││ D:\AI\Vladimir\extensions-builtin\stable-diffusion-webui-rembg\scripts\postprocessing_rembg.py:3 in <module> ││ ││ 2 import gradio as gr ││ ❱ 3 import rembg ││ 4 from modules import scripts_postprocessing ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\__init__.py:5 in <module> ││ ││ 4 ││ ❱ 5 from .bg import remove ││ 6 from .session_factory import new_session ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\bg.py:21 in <module> ││ ││ 20 ││ ❱ 21 from .session_factory import new_session ││ 22 from .sessions import sessions_class ││ ││ D:\AI\Vladimir\venv\lib\site-packages\rembg\session_factory.py:4 in <module> ││ ││ 3 ││ ❱ 4 import onnxruntime as ort ││ 5 ││ ││ D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\__init__.py:56 in <module> ││ ││ 55 if import_capi_exception: ││ ❱ 56 │ raise import_capi_exception ││ 57 ││ ││ D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\__init__.py:37 in <module> ││ ││ 36 │ from onnxruntime.capi._pybind_state import create_and_register_allocator # noqa: F4 ││ ❱ 37 │ from onnxruntime.capi._pybind_state import create_and_register_allocator_v2 # noqa: ││ 38 │ from onnxruntime.capi._pybind_state import disable_telemetry_events # noqa: F401 │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ImportError: cannot import name 'create_and_register_allocator_v2' from 'onnxruntime.capi._pybind_state'
(D:\AI\Vladimir\venv\lib\site-packages\onnxruntime\capi\_pybind_state.py)
18:25:27-762395 INFO Extension: script='extensions\adetailer\scripts\!adetailer.py' [-] ADetailer initialized.
version: 23.11.0, num models: 9
18:25:28-295884 INFO Extensions time: 5.72s { clip-interrogator-ext=0.76s Lora=0.28s sd-extension-chainner=0.09s
sd-extension-system-info=0.05s sd-webui-agent-scheduler=0.42s sd-webui-controlnet=0.52s
stable-diffusion-webui-images-browser=0.26s stable-diffusion-webui-rembg=0.84s
a1111-sd-webui-lycoris=0.26s adetailer=1.70s sd-webui-prompt-history=0.53s }
18:25:28-571497 INFO Loading UI theme: name=black-teal style=Dark base=style.css
18:25:30-948826 INFO Local URL: http://127.0.0.1:7860/
18:25:30-952591 INFO Initializing middleware
18:25:31-169286 INFO [AgentScheduler] Task queue is empty
18:25:31-169286 INFO [AgentScheduler] Registering APIs
18:25:31-315269 INFO Select: model="Model15-photon_v1 [ec41bd2a82]"
Loading weights: D:\AI\Vladimir\models\Stable-diffusion\Model15-photon_v1.safetensors ━━━━━━━━━━━━━━━ 0.0/2.1 GB -:--:--18:25:31-395786 INFO Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16
context=no_grad fp16=True bf16=False
18:25:31-860883 INFO LDM: LatentDiffusion: Running in eps-prediction mode
18:25:31-862415 INFO LDM: DiffusionWrapper has 859.52 M params.
18:25:31-862415 INFO Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline
file="D:\AI\Vladimir\models\Stable-diffusion\Model15-photon_v1.safetensors" size=2034MB
18:25:33-487922 INFO Cross-attention: optimization=Scaled-Dot-Product options=[]
18:25:33-745213 INFO Loaded embeddings: loaded=22 skipped=3 time=0.25s
18:25:33-752768 INFO Model loaded in 2.43s { config=0.06s create=0.45s apply=0.73s vae=0.35s move=0.54s
embeddings=0.25s }
18:25:34-042464 INFO Model load finished: {'ram': {'used': 7.0, 'total': 31.92}, 'gpu': {'used': 3.19, 'total':
10.0}, 'retries': 0, 'oom': 0} cached=0
18:25:34-267248 INFO Startup time: 19.50s { torch=5.69s gradio=0.56s libraries=1.32s extensions=5.72s
face-restore=0.20s upscalers=0.14s ui-extra-networks=0.22s ui-txt2img=0.08s ui-img2img=0.12s
ui-settings=0.14s ui-extensions=1.59s ui-defaults=0.07s launch=0.23s api=0.09s
app-started=0.27s checkpoint=2.95s }
18:26:08-309171 INFO MOTD: N/A
18:26:12-525169 INFO Browser session: client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0)
Gecko/20100101 Firefox/119.0
i cannot troubleshoot why onnxruntime
is not correct on your system, but i've just made loading rembg
an optional item, so if it fails, it will just disable itself and not impact the rest of sdnext.
Issue Description
I have errors when running vlad... before it was doing fine until i installed reactorforce on the extensions list. I already uninstalled it but now it gives me errors when i run the bat file. I dont think this is an extension issue because the error is not about reactorforce... but about rembg.py
Version Platform Description
Version: 0.57.1
Name: numpy Version: 1.24.4 Summary: Fundamental package for array computing in Python Home-page: https://www.numpy.org Author: Travis E. Oliphant et al. Author-email: License: BSD-3-Clause Location: d:\ai\vladimir\venv\lib\site-packages Requires: Required-by: accelerate, altair, basicsr, blendmodes, clean-fid, contourpy, dctorch, diffusers, facexlib, filterpy, fvcore, gfpgan, gradio, h5py, imageio, invisible-watermark, lpips, matplotlib, mediapipe, numba, numexpr, onnx, onnxruntime, opencv-contrib-python, opencv-contrib-python-headless, opencv-python, opencv-python-headless, opt-einsum, pandas, PyMatting, pytorch-lightning, PyWavelets, rembg, scikit-image, scipy, seaborn, tb-nightly, tensorboard, tensorflow-intel, tifffile, torchmetrics, torchsde, torchvision, transformers, ultralytics
Relevant log output
No response
Backend
Original
Model
SD 1.5
Acknowledgements