nixified-ai / flake

A Nix flake for many AI projects
GNU Affero General Public License v3.0
656 stars 69 forks source link

Latest version of InvokeAI not working #63

Closed NicoleKai closed 10 months ago

NicoleKai commented 11 months ago

Latest version of invokeai (7b9730e0a75bcd6375b0780aef75e406ea20a9a4) not working on my system. Not sure what could be causing this.

invokeai output log:

2023-11-04 22:45:00.154733553 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:1827 CreateInferencePybindStateModule] Init provider bridge failed.
/nix/store/ds0qkkilzh7mqawssx7z8dmpgk34v7wm-python3.10-torchvision-0.15.2/lib/python3.10/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(
[2023-11-04 22:45:00,815]::[InvokeAI]::INFO --> Patchmatch initialized
[2023-11-04 22:45:00,926]::[InvokeAI]::INFO --> InvokeAI version 3.3.0post3
[2023-11-04 22:45:00,945]::[InvokeAI]::INFO --> GPU device = cuda NVIDIA GeForce RTX 4080
[2023-11-04 22:45:00,955]::[InvokeAI]::INFO --> Scanning /home/nikoru/invokeai/models for new models
[2023-11-04 22:45:01,112]::[InvokeAI]::INFO --> Scanned 9 files and directories, imported 0 models
[2023-11-04 22:45:01,119]::[InvokeAI]::INFO --> Model manager service initialized
[2023-11-04 22:45:01,119]::[InvokeAI]::INFO --> InvokeAI database location is "/home/nikoru/invokeai/databases/invokeai.db"
Traceback (most recent call last):
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/bin/.invokeai-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/frontend/legacy_launch_invokeai.py", line 18, in main
    invoke_cli()
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/app/cli_app.py", line 257, in invoke_cli
    graph_execution_manager = SqliteItemStorage[GraphExecutionState](conn=db_conn, table_name="graph_executions")
  File "/nix/store/pzf6dnxg8gf04xazzjdwarm7s03cbrgz-python3-3.10.12/lib/python3.10/typing.py", line 957, in __call__
    result = self.__origin__(*args, **kwargs)
TypeError: SqliteItemStorage.__init__() missing 1 required positional argument: 'lock'
MatthewCroughan commented 11 months ago

@NicoleKai you have not shown me the command you ran to get into this state. But the upstream program (invokeai) often corrupts its state on disk due to bugs. I would recommend rm -rf ~/invokeai and starting again.

crabdancing commented 11 months ago

I can replicate this issue too with a completely new install. If you clear ~/invokeai (although I'm using /var/lib/invokeai/` and rebuild, it fails in the middle of installing models like so:

[2023-11-06 00:12:06,278]::[InvokeAI]::INFO --> Scanned 9 files and directories, imported 0 models
[2023-11-06 00:12:06,324]::[InvokeAI]::INFO --> Installing https://civitai.com/api/download/models/63006 [1/1]
Traceback (most recent call last):
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/bin/.invokeai-configure-wrapped", line 9, in <module>
    sys.exit(invokeai_configure())
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/backend/install/invokeai_configure.py", line 946, in main
    process_and_execute(opt, models_to_download)
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/frontend/install/model_install.py", line 697, in process_and_execute
    installer.install(selections)
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/backend/install/model_install_backend.py", line 217, in install
    self.heuristic_import(path)
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/backend/install/model_install_backend.py", line 266, in heuristic_import
    models_installed.update({str(model_path_id_or_url): self._install_url(model_path_id_or_url)})
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/backend/install/model_install_backend.py", line 313, in _install_url
    location = download_with_resume(url, Path(staging))
  File "/nix/store/bkgmn0gqi97h94fqs588dvxw3l9yk5gs-python3.10-InvokeAI-3.3.0post3/lib/python3.10/site-packages/invokeai/backend/util/util.py", line 290, in download_with_resume
    file_name = re.search('filename="(.+)"', resp.headers.get("Content-Disposition")).group(1)
  File "/nix/store/pzf6dnxg8gf04xazzjdwarm7s03cbrgz-python3-3.10.12/lib/python3.10/re.py", line 200, in search
    return _compile(pattern, flags).search(string)

Restarting it fixes the issue, and it finishes initializing /var/lib/invokeai/.home But when I try to actually run invokeai to test, it throws the same exact error as what @NicoleKai is reporting.

max-privatevoid commented 10 months ago

The original issue is due to another upstream deprecation https://github.com/invoke-ai/InvokeAI/issues/5003