优化config中video的读取逻辑
This commit is contained in:
@@ -29,7 +29,7 @@ Usage:
|
||||
if config_manager.validate():
|
||||
print("Config is valid!")
|
||||
"""
|
||||
from .schema import PixelleVideoConfig, LLMConfig, ComfyUIConfig, TTSSubConfig, ImageSubConfig
|
||||
from .schema import PixelleVideoConfig, LLMConfig, ComfyUIConfig, TTSSubConfig, ImageSubConfig, VideoSubConfig
|
||||
from .manager import ConfigManager
|
||||
from .loader import load_config_dict, save_config_dict
|
||||
|
||||
@@ -42,6 +42,7 @@ __all__ = [
|
||||
"ComfyUIConfig",
|
||||
"TTSSubConfig",
|
||||
"ImageSubConfig",
|
||||
"VideoSubConfig",
|
||||
"ConfigManager",
|
||||
"config_manager",
|
||||
"load_config_dict",
|
||||
|
||||
@@ -135,6 +135,10 @@ class ConfigManager:
|
||||
"image": {
|
||||
"default_workflow": self.config.comfyui.image.default_workflow,
|
||||
"prompt_prefix": self.config.comfyui.image.prompt_prefix,
|
||||
},
|
||||
"video": {
|
||||
"default_workflow": self.config.comfyui.video.default_workflow,
|
||||
"prompt_prefix": self.config.comfyui.video.prompt_prefix,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,12 +59,22 @@ class ImageSubConfig(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class VideoSubConfig(BaseModel):
|
||||
"""Video-specific configuration (under comfyui.video)"""
|
||||
default_workflow: Optional[str] = Field(default=None, description="Default video workflow (optional)")
|
||||
prompt_prefix: str = Field(
|
||||
default="Minimalist black-and-white matchstick figure style illustration, clean lines, simple sketch style",
|
||||
description="Prompt prefix for all video generation"
|
||||
)
|
||||
|
||||
|
||||
class ComfyUIConfig(BaseModel):
|
||||
"""ComfyUI configuration (includes global settings and service-specific configs)"""
|
||||
comfyui_url: str = Field(default="http://127.0.0.1:8188", description="ComfyUI Server URL")
|
||||
runninghub_api_key: Optional[str] = Field(default=None, description="RunningHub API Key (optional)")
|
||||
tts: TTSSubConfig = Field(default_factory=TTSSubConfig, description="TTS-specific configuration")
|
||||
image: ImageSubConfig = Field(default_factory=ImageSubConfig, description="Image-specific configuration")
|
||||
video: VideoSubConfig = Field(default_factory=VideoSubConfig, description="Video-specific configuration")
|
||||
|
||||
|
||||
class TemplateConfig(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user