invoke-ai / InvokeAI

InvokeAI is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, supports terminal use through a CLI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.22k stars 2.4k forks source link

[bug]: Unable to bulk import images #6103

Open mahlonsmith opened 6 months ago

mahlonsmith commented 6 months ago

Is there an existing issue for this problem?

Operating system

Linux

GPU vendor

Nvidia (CUDA)

GPU model

4080

GPU VRAM

12GB

Version number

4.0.0

Browser

Firefox (latest)

Python dependencies

No response

What happened

Had too much cruft over time, freshly installed v4.0.0. Attempted to bulk import past images, but erroring:

(InvokeAI) mahlon@kazak /zpool/AI/invokeai> invokeai-import-images
===============================================================================
This script will import images generated by earlier versions of
InvokeAI into the currently installed root directory:
   /zpool/AI/invokeai
If this is not what you want to do, type ctrl-C now to cancel.
===============================================================================
= Configuration & Settings
Traceback (most recent call last):
  File "/zpool/AI/invokeai/.venv/bin/invokeai-import-images", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/zpool/AI/invokeai/.venv/lib/python3.11/site-packages/invokeai/frontend/install/import_images.py", line 780, in main
    processor.process()
  File "/zpool/AI/invokeai/.venv/lib/python3.11/site-packages/invokeai/frontend/install/import_images.py", line 698, in process
    config.find_and_load()
  File "/zpool/AI/invokeai/.venv/lib/python3.11/site-packages/invokeai/frontend/install/import_images.py", line 65, in find_and_load
    if not self.confirm_and_load(os.path.abspath(root)):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/zpool/AI/invokeai/.venv/lib/python3.11/site-packages/invokeai/frontend/install/import_images.py", line 77, in confirm_and_load
    if os.path.isabs(db_dir):
       ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 62, in isabs
TypeError: expected str, bytes or os.PathLike object, not NoneType

What you expected to happen

Well, I expected to not receive an error. :-)

How to reproduce the problem

This was a fresh install (using the v4.0.0 installer.) Hoping that's reproducible outside of my environment.

Additional context

No response

Discord username

No response

psychedelicious commented 6 months ago

We'll need to review the image importing script to update it for v4.0.0. Some changes were made to the main app config that might cause problems. I think it will be a fairly simple fix.

I'm curious why you felt the need to create a new install and migration images over - this should result in an install very similar to what you had originally. Did you attempt to update to v4.0.0 and run into some other problem?

mahlonsmith commented 6 months ago

We'll need to review the image importing script to update it for v4.0.0. Some changes were made to the main app config that might cause problems. I think it will be a fairly simple fix.

Good deal! :+1:

I'm curious why you felt the need to create a new install and migration images over - this should result in an install very similar to what you had originally. Did you attempt to update to v4.0.0 and run into some other problem?

I did, but unfortunately I didn't retain the backtrace in my terminal history (it was when I attempted to launch the webui for the first time after using the 3.7.0 updater to 4.0.0.)

I assumed it was just me or my env -- Just in the habit of updating from the existing script and jumped the gun before reading the release notes. ;) I suspect if I just followed the instructions on a major jump and used the new install/upgrade script, it would have worked fine? (Just as well in my case, I was ready to reclaim some disk space from unused models, so no big deal.)

psychedelicious commented 6 months ago

I suspect if I just followed the instructions on a major jump and used the new install/upgrade script, it would have worked fine?

That's certainly the intention!

I'll try to work on the import script later this week.

mcbexx commented 4 months ago

I'll try to work on the import script later this week.

Took a glance over the recent changelogs and couldn't find a reference for this fix - has this been adressed (also in reference to #6188)?

Is it safe again to use the db maintenance script now since the option is (still/again?) available in the launcher?

psychedelicious commented 4 months ago

@mcbexx Sorry, I didn't get to it and the contributor who previously maintained it hasn't been around. I've just removed it from the launcher in #6431.