refactor: Migrate the project functionality and optimize the code structure

This commit is contained in:
hayden
2024-10-12 17:31:11 +08:00
committed by hayden
parent d96aff80c2
commit c1747a79f3
71 changed files with 6741 additions and 1320 deletions

33
py/config.py Normal file
View File

@@ -0,0 +1,33 @@
extension_uri: str = None
model_base_paths: dict[str, list[str]] = {}
setting_key = {
"api_key": {
"civitai": "ModelManager.APIKey.Civitai",
"huggingface": "ModelManager.APIKey.HuggingFace",
},
"download": {
"max_task_count": "ModelManager.Download.MaxTaskCount",
},
}
user_agent = "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
from server import PromptServer
serverInstance = PromptServer.instance
routes = serverInstance.routes
class FakeRequest:
def __init__(self):
self.headers = {}
class CustomException(BaseException):
def __init__(self, type: str, message: str = None) -> None:
self.type = type
self.message = message
super().__init__(message)