Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.45k stars 262 forks source link

SD.Next | Cannot Import CodeFormer Module #140

Closed videogamingeducation closed 10 months ago

videogamingeducation commented 10 months ago

First, confirm

What happened?

I followed the instructions to install reactor step by step in Windows 11 and I'm getting this. It used to work before.

19:02:34-691462 ERROR Module load: extensions\sd-webui-reactor\scripts\reactor_api.py: ImportError ╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮ │ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_api.py:17 in │ │ │ │ 16 │ │ ❱ 17 from scripts.reactor_swapper import EnhancementOptions, swap_face │ │ 18 from scripts.reactor_logger import logger │ │ │ │ D:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in │ │ │ │ 12 from modules.face_restoration import FaceRestoration │ │ ❱ 13 from modules import codeformer_model │ │ 14 from modules.upscaler import UpscalerData │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location) 19:02:34-724692 ERROR Module load: extensions\sd-webui-reactor\scripts\reactor_faceswap.py: ImportError ╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮ │ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_faceswap.py:26 in │ │ │ │ 25 from scripts.reactor_logger import logger │ │ ❱ 26 from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, r │ │ 27 from scripts.reactor_version import version_flag, app_title │ │ │ │ D:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in │ │ │ │ 12 from modules.face_restoration import FaceRestoration │ │ ❱ 13 from modules import codeformer_model │ │ 14 from modules.upscaler import UpscalerData │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location) 19:02:34-736693 ERROR Module load: extensions\sd-webui-reactor\scripts\reactor_swapper.py: ImportError ╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮ │ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in │ │ │ │ 12 from modules.face_restoration import FaceRestoration │ │ ❱ 13 from modules import codeformer_model │ │ 14 from modules.upscaler import UpscalerData │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location)

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

Sysinfo

Windows 11 RTX 3070 SDNext

Relevant console log

19:02:34-691462 ERROR    Module load: extensions\sd-webui-reactor\scripts\reactor_api.py: ImportError
╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_api.py:17 in <module>                                   │
│                                                                                                                  │
│    16                                                                                                            │
│ ❱  17 from scripts.reactor_swapper import EnhancementOptions, swap_face                                          │
│    18 from scripts.reactor_logger import logger                                                                  │
│                                                                                                                  │
│ D:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in <module>                               │
│                                                                                                                  │
│    12 from modules.face_restoration import FaceRestoration                                                       │
│ ❱  13 from modules import codeformer_model                                                                       │
│    14 from modules.upscaler import UpscalerData                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location)
19:02:34-724692 ERROR    Module load: extensions\sd-webui-reactor\scripts\reactor_faceswap.py: ImportError
╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_faceswap.py:26 in <module>                              │
│                                                                                                                  │
│    25 from scripts.reactor_logger import logger                                                                  │
│ ❱  26 from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, r                   │
│    27 from scripts.reactor_version import version_flag, app_title                                                │
│                                                                                                                  │
│ D:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in <module>                               │
│                                                                                                                  │
│    12 from modules.face_restoration import FaceRestoration                                                       │
│ ❱  13 from modules import codeformer_model                                                                       │
│    14 from modules.upscaler import UpscalerData                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location)
19:02:34-736693 ERROR    Module load: extensions\sd-webui-reactor\scripts\reactor_swapper.py: ImportError
╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ D:\automatic\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:\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:13 in <module>                               │
│                                                                                                                  │
│    12 from modules.face_restoration import FaceRestoration                                                       │
│ ❱  13 from modules import codeformer_model                                                                       │
│    14 from modules.upscaler import UpscalerData                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'codeformer_model' from 'modules' (unknown location)

Additional information

No response

Gourieff commented 10 months ago

Do you use SD.Next? I will take a look later

halfblack commented 10 months ago

Can confirm same in latest SD.Next

Gourieff commented 10 months ago

Fixed https://github.com/Gourieff/sd-webui-reactor/commit/4e877445ba722250204b9d2b81e69b0f9e136b7c