vladmandic / automatic

SD.Next: Advanced Implementation Generative Image Models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.75k stars 431 forks source link

[Issue]: CLIP does not get automatically installed #843

Closed tigers2020 closed 1 year ago

tigers2020 commented 1 year ago

Issue Description

I delete venv reinstall from new -requirements.txt

after install finish, I am getting this error..

No module 'xformers'. Proceeding without it.

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ C:\Users\hyper\webUI\SeatIt\automatic\launch.py:141 in <module>                                                      │
│                                                                                                                      │
│   140                                                                                                                │
│ ❱ 141     instance = start_server(immediate=True, server=None)                                                       │
│   142     while True:                                                                                                │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\launch.py:116 in start_server                                                  │
│                                                                                                                      │
│   115     server = importlib.util.module_from_spec(module_spec)                                                      │
│ ❱ 116     module_spec.loader.exec_module(server)                                                                     │
│   117     if args.test:                                                                                              │
│ in exec_module:883                                                                                                   │
│ in _call_with_frames_removed:241                                                                                     │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\webui.py:34 in <module>                                                        │
│                                                                                                                      │
│    33 import ldm.modules.encoders.modules # pylint: disable=W0611,C0411                                              │
│ ❱  34 from modules import extra_networks, ui_extra_networks_checkpoints # pylint: disable=C041                       │
│    35 from modules import extra_networks_hypernet, ui_extra_networks_hypernets, ui_extra_netwo                       │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\modules\ui_extra_networks_checkpoints.py:5 in <module>                         │
│                                                                                                                      │
│    4                                                                                                                 │
│ ❱  5 from modules import shared, ui_extra_networks, sd_models                                                        │
│    6                                                                                                                 │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\modules\ui_extra_networks.py:11 in <module>                                    │
│                                                                                                                      │
│    10 from modules import shared                                                                                     │
│ ❱  11 from modules.images import read_info_from_image                                                                │
│    12 from modules.generation_parameters_copypaste import image_from_url_text                                        │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\modules\images.py:16 in <module>                                               │
│                                                                                                                      │
│    15                                                                                                                │
│ ❱  16 from modules import sd_samplers, shared, script_callbacks, errors                                              │
│    17 from modules.shared import opts, log                                                                           │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\modules\sd_samplers.py:1 in <module>                                           │
│                                                                                                                      │
│ ❱  1 from modules import sd_samplers_compvis, sd_samplers_kdiffusion, shared                                         │
│    2                                                                                                                 │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\modules\sd_samplers_kdiffusion.py:4 in <module>                                │
│                                                                                                                      │
│     3 import torch                                                                                                   │
│ ❱   4 import k_diffusion.sampling                                                                                    │
│     5 from modules import prompt_parser, devices, sd_samplers_common                                                 │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\repositories\k-diffusion\k_diffusion\__init__.py:1 in <module>                 │
│                                                                                                                      │
│ ❱ 1 from . import augmentation, config, evaluation, external, gns, layers, models, sampling,                         │
│   2 from .layers import Denoiser                                                                                     │
│                                                                                                                      │
│ C:\Users\hyper\webUI\SeatIt\automatic\repositories\k-diffusion\k_diffusion\evaluation.py:6 in <module>               │
│                                                                                                                      │
│     5 from cleanfid.inception_torchscript import InceptionV3W                                                        │
│ ❱   6 import clip                                                                                                    │
│     7 from resize_right import resize                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'clip'

so I am manually install clip as pip install clip, I am getting another error.

pip install clip
Collecting clip
  Using cached clip-0.2.0.tar.gz (5.5 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\hyper\AppData\Local\Temp\pip-install-dp7gruwz\clip_a8b027a20d344ef4a84809938f1b1598\setup.py", line 29, in <module>
          long_description=open('README.rst').read() + '\n\n' +
      UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1428: illegal multibyte sequence
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Version Platform Description

No response

vladmandic commented 1 year ago

No module 'xformers'. Proceeding without it.

That is NOT and error.

so I am manually install clip as pip install clip

And you install wrong package as clip that sits on pypy is someone stealing a name and nothing else. Correct clip is installed by installer. You should also not install anything from requirements.txt yourself, that is what installer is for.

So instead of all this, better question is if you delete VENV and just run webui, what happens?

tigers2020 commented 1 year ago

there keep popping missing modulers and at the end. endless loop freeze at Installing mmcv-full. I am using python 3.11.4 would be matter?

vladmandic commented 1 year ago

python 3.11 is not supported. installer clearly says that at the very beginning - it will even refuse to run unless you run with --experimental flag.

which tells me you're running something else and not just webui.bat - otherwise you'd see that message and nothing else would happen.

tigers2020 commented 1 year ago

I delete everything, fresh download from git, python 3.10. still, I am getting missing modules. first was clip. install manually, rembg pops. and clip_interggorator. after that freeze at

ModuleNotFoundError: No module named 'rembg'
20:32:48-091914 INFO     Running extension preloading
20:32:48-092915 INFO     Installing openmim
20:32:50-880227 INFO     Installing mmcv-full
vladmandic commented 1 year ago

installing clip manually just causes problems - i already said, that's the wrong package. run webui alone, with clean venv and upload setup.log here (delete it before if you already have it).

vladmandic commented 1 year ago

any updates?

tigers2020 commented 1 year ago

oh, it was outdated extension issued. that I try to install. ddetailer. now I have different issue with that graphic memory is not unloaded but stay in cash when you try overload work that more capacity than your graphic card. and have some warning what restart server.

 Server shutdown requested
Traceback (most recent call last):
  File "C:\Users\hyper\webUI\SeatIt\automatic\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\hyper\webUI\SeatIt\automatic\venv\lib\site-packages\gradio\blocks.py", line 1299, in process_api
    result = await self.call_function(
  File "C:\Users\hyper\webUI\SeatIt\automatic\venv\lib\site-packages\gradio\blocks.py", line 1022, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\hyper\webUI\SeatIt\automatic\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\hyper\webUI\SeatIt\automatic\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
asyncio.exceptions.CancelledError
vladmandic commented 1 year ago

First one I think I just fixed 2h ago.

Second one is normal, there is even message just before that says to ignore it. Those are aborts for open connections towards browser - no way to hide them without hiding some other really important stuff.

vladmandic commented 1 year ago

closing the issue as resolved. for any vram issues, we can continue under different thread.