Fixed issue #112

pull/212/head
Alexey Borsky 2023-05-27 15:38:14 +03:00
parent 89ba89d949
commit c3c0972c0a
2 changed files with 15 additions and 9 deletions

View File

@ -1,15 +1,20 @@
import launch
import os
import pkg_resources
req_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.txt")
with open(req_file) as file:
for lib in file:
lib = lib.strip()
if not launch.is_installed(lib):
launch.run_pip(f"install {lib}", f"SD-CN-Animation requirement: {lib}")
for package in file:
try:
package = package.strip()
if '==' in package:
package_name, package_version = package.split('==')
installed_version = pkg_resources.get_distribution(package_name).version
if installed_version != package_version:
launch.run_pip(f"install {package}", f"SD-CN-Animation requirement: changing {package_name} version from {installed_version} to {package_version}")
elif not launch.is_installed(package):
launch.run_pip(f"install {package}", f"SD-CN-Animation requirement: {package}")
except Exception as e:
print(e)
print(f'Warning: Failed to install {package}.')

View File

@ -82,4 +82,5 @@ pip install sckit-image==0.19.2 --no-cache-dir
<!--
* ControlNet with preprocessers like "reference_only", "reference_adain", "reference_adain+attn" are not reseted with video frames to have an ability to control style of the video.
* Fixed an issue because of witch 'processing_strength' UI parameters does not actually affected denoising strength at the fist processing step.
* Fixed issue #112. It will not try to reinstall requirements at every start of webui.
-->