Haoming02 / sd-webui-old-photo-restoration

An Extension for Automatic1111 Webui for Bringing Old Photo Back to Life
MIT License
118 stars 6 forks source link

The repeated requirements installation is (not really) fixed in Webui v1.7.0 #2

Closed ali0une closed 10 months ago

ali0une commented 11 months ago

Hi there!

i've got this message everytime i start A1111 (Linux, v1.7.0)

Checking Requirements for Bringing-Old-Photos-Back-to-Life...

Then a file =2.3.1 is created in /whatever/stable-diffusion-webui/ with the content :

Requirement already satisfied: dominate in ./venv/lib/python3.10/site-packages (2.9.0)

Looks like the cause is somewhere in the preload.py code.

Maybe looking at the way faceswaplab extension checks requirements in the install.py code could help?

Haoming02 commented 11 months ago

Could you try to see if renaming preload.py to install.py fix the issue?

The line Checking Requirements for Bringing-Old-Photos-Back-to-Life... being called every launch is normal. But the line Requirement already satisfied is rather not normal.

And yes, both codes used the same built-in function to check if a package is installed.

ali0une commented 11 months ago

@Haoming02 nope, same thing after renaming preload.py to install.py

Checking Requirements for Bringing-Old-Photos-Back-to-Life...
Installing Old-Photo-Restoration Requirement: dominate>=2.3.1

And this odd =2.3.1 file being created with the same content as above.

Haoming02 commented 11 months ago

Should really be fixed for real this time.

I just looked into the Webui's built-in code, the is_installed function from the launch_utils.py still does not handle the version, which is why when asking for "dominate>=2.3.1", it kept trying to install it again...

And you were indeed correct. faceswaplab's install implementation is more thorough. They just used the same function name

ali0une commented 10 months ago

Many thanks. Really Fixed!