BlafKing / sd-civitai-browser-plus

Extension to access CivitAI via WebUI: download, delete, scan for updates, list installed models, assign tags, and boost downloads with multi-threading.
GNU Affero General Public License v3.0
309 stars 53 forks source link

[Bug]: CivitAI Browser Plus import error in SD.Next #146

Closed brknsoul closed 9 months ago

brknsoul commented 9 months ago

Describe the bug.

CBP results in this error when loading in SD.Next;

18:37:52-860302 ERROR    Module load: extensions\sd-civitai-browser-plus\scripts\civitai_gui.py: ImportError                                                   
┌───────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────┐
│ E:\SM\Data\Packages\SD.Next Web UI\modules\script_loading.py:25 in load_module                                                                              │
│                                                                                                                                                             │
│   24 │   │   │   with contextlib.redirect_stdout(io.StringIO()) as stdout:                                                                                  │
│ > 25 │   │   │   │   module_spec.loader.exec_module(module)                                                                                                 │
│   26 │   │   │   setup_logging() # reset since scripts can hijaack logging                                                                                  │
│ in exec_module:883                                                                                                                                          │
│ in _call_with_frames_removed:241                                                                                                                            │
│                                                                                                                                                             │
│ E:\SM\Data\Packages\SD.Next Web UI\extensions\sd-civitai-browser-plus\scripts\civitai_gui.py:3 in <module>                                                  │
│                                                                                                                                                             │
│     2 import gradio as gr                                                                                                                                   │
│ >   3 from modules import script_callbacks, shared, launch_utils                                                                                            │
│     4 import os                                                                                                                                             │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ImportError: cannot import name 'launch_utils' from 'modules' (unknown location)

Steps to reproduce the problem.

Install CBP, launch SD.Next

Expected behavior

... to load and not produce errors

System info

Python 3.10.11 on Windows
Version: app=sd.next updated=2023-12-19 hash=00281e15 url=https://github.com/vladmandic/automatic/tree/master
Platform: arch=AMD64 cpu=Intel64 Family 6 Model 158 Stepping 11, GenuineIntel system=Windows release=Windows-10-10.0.19045-SP0

Console logs

18:37:52-860302 ERROR    Module load: extensions\sd-civitai-browser-plus\scripts\civitai_gui.py: ImportError                                                   
┌───────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────┐
│ E:\SM\Data\Packages\SD.Next Web UI\modules\script_loading.py:25 in load_module                                                                              │
│                                                                                                                                                             │
│   24 │   │   │   with contextlib.redirect_stdout(io.StringIO()) as stdout:                                                                                  │
│ > 25 │   │   │   │   module_spec.loader.exec_module(module)                                                                                                 │
│   26 │   │   │   setup_logging() # reset since scripts can hijaack logging                                                                                  │
│ in exec_module:883                                                                                                                                          │
│ in _call_with_frames_removed:241                                                                                                                            │
│                                                                                                                                                             │
│ E:\SM\Data\Packages\SD.Next Web UI\extensions\sd-civitai-browser-plus\scripts\civitai_gui.py:3 in <module>                                                  │
│                                                                                                                                                             │
│     2 import gradio as gr                                                                                                                                   │
│ >   3 from modules import script_callbacks, shared, launch_utils                                                                                            │
│     4 import os                                                                                                                                             │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ImportError: cannot import name 'launch_utils' from 'modules' (unknown location)

Additional information

No response

BlafKing commented 9 months ago

Thanks for reporting!

I've published a quick hotfix which should hopefully resolve this issue! :)