refactor: 移除旧的comfyui_client模块,重构API路由以使用新的comfy_workflow和queue_manager,提升代码结构和可维护性

This commit is contained in:
iHeyTang
2025-08-14 14:29:17 +08:00
parent f6f07a094f
commit 6240b98c5b
8 changed files with 889 additions and 873 deletions

View File

@@ -6,6 +6,7 @@ from typing import List
class ComfyUIServer(BaseModel):
"""定义单个ComfyUI服务器的配置模型。"""
http_url: str
ws_url: str
input_dir: str
@@ -16,10 +17,13 @@ class Settings(BaseSettings):
"""
应用配置类,通过.env文件加载环境变量。
"""
model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
# [核心改动] 使用JSON字符串来定义一个服务器列表
COMFYUI_SERVERS_JSON: str = '[{"http_url": "http://127.0.0.1:8188", "ws_url": "ws://127.0.0.1:8188/ws", "input_dir": "/comfyui/input", "output_dir": "/comfyui/output"}]'
COMFYUI_SERVERS_JSON: str = (
'[{"http_url": "http://127.0.0.1:8188", "ws_url": "ws://127.0.0.1:8188/ws", "input_dir": "/comfyui/input", "output_dir": "/comfyui/output"}]'
)
DB_FILE: str = "/db/workflows_service.sqlite"
# S3 和 AWS 配置保持不变
@@ -45,4 +49,4 @@ class Settings(BaseSettings):
raise e
settings = Settings()
settings = Settings()