speed up install and config
							parent
							
								
									17db6ea2b4
								
							
						
					
					
						commit
						054f693815
					
				| @ -1,4 +1,4 @@ | ||||
| #!/bin/bash | ||||
| autoflake --in-place --remove-unused-variables -r --remove-all-unused-imports . | ||||
| mypy --install-types | ||||
| mypy --non-interactive --install-types | ||||
| pre-commit run --all-files | ||||
|  | ||||
| @ -0,0 +1 @@ | ||||
| [{"analyzerName":"intellisense-members-lstm-pylance","languageName":"python","identity":{"modelId":"E61945A9A512ED5E1A3EE3F1A2365B88F8FE","outputId":"E4E9EADA96734F01970E616FAB2FAC19","modifiedTimeUtc":"2020-08-11T14:06:50.811Z"},"filePath":"E61945A9A512ED5E1A3EE3F1A2365B88F8FE_E4E9EADA96734F01970E616FAB2FAC19","lastAccessTimeUtc":"2023-08-14T21:58:14.988Z"}] | ||||
| @ -1,18 +1,27 @@ | ||||
| import os | ||||
| from modules import scripts | ||||
| from modules.shared import opts | ||||
| 
 | ||||
| # Defining the absolute path for the 'faceswaplab' directory inside 'models' directory | ||||
| MODELS_DIR = os.path.abspath(os.path.join("models", "faceswaplab")) | ||||
| # Defining the absolute path for the 'analysers' directory inside 'MODELS_DIR' | ||||
| ANALYZER_DIR = os.path.abspath(os.path.join(MODELS_DIR, "analysers")) | ||||
| # Defining the absolute path for the 'parser' directory inside 'MODELS_DIR' | ||||
| FACE_PARSER_DIR = os.path.abspath(os.path.join(MODELS_DIR, "parser")) | ||||
| # Defining the absolute path for the 'faces' directory inside 'MODELS_DIR' | ||||
| FACES_DIR = os.path.abspath(os.path.join(MODELS_DIR, "faces")) | ||||
| 
 | ||||
| # Constructing the path for 'references' directory inside the 'extensions' and 'sd-webui-faceswaplab' directories, based on the base directory of scripts | ||||
| REFERENCE_PATH = os.path.join( | ||||
|     scripts.basedir(), "extensions", "sd-webui-faceswaplab", "references" | ||||
| ) | ||||
| 
 | ||||
| VERSION_FLAG: str = "v1.2.1" | ||||
| # Defining the version flag for the application | ||||
| VERSION_FLAG: str = "v1.2.2" | ||||
| # Defining the path for 'sd-webui-faceswaplab' inside the 'extensions' directory | ||||
| EXTENSION_PATH = os.path.join("extensions", "sd-webui-faceswaplab") | ||||
| 
 | ||||
| # The NSFW score threshold. If any part of the image has a score greater than this threshold, the image will be considered NSFW. | ||||
| NSFW_SCORE_THRESHOLD: float = 0.7 | ||||
| # Defining the NSFW score threshold. Any image part with a score above this value will be treated as NSFW (Not Safe For Work) | ||||
| NSFW_SCORE_THRESHOLD: float = opts.data.get("faceswaplab_nsfw_threshold", 0.7)  # type: ignore | ||||
| # Defining the expected SHA1 hash value for 'INSWAPPER' | ||||
| EXPECTED_INSWAPPER_SHA1 = "17a64851eaefd55ea597ee41e5c18409754244c5" | ||||
|  | ||||
| @ -0,0 +1,18 @@ | ||||
| from types import ModuleType | ||||
| 
 | ||||
| 
 | ||||
| def check_install() -> None: | ||||
|     # Very ugly hack :( due to sdnext optimization not calling install.py every time if git log has not changed | ||||
|     import importlib.util | ||||
|     import sys | ||||
|     import os | ||||
| 
 | ||||
|     current_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     check_install_path = os.path.join(current_dir, "..", "..", "install.py") | ||||
|     spec = importlib.util.spec_from_file_location("check_install", check_install_path) | ||||
|     if spec != None: | ||||
|         check_install: ModuleType = importlib.util.module_from_spec(spec) | ||||
|         sys.modules["check_install"] = check_install | ||||
|         spec.loader.exec_module(check_install)  # type: ignore | ||||
|         check_install.check_install()  # type: ignore | ||||
|         #### End of ugly hack :( ! | ||||
					Loading…
					
					
				
		Reference in New Issue