| 1 | # Copyright (C) 2025 AIDC-AI |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | # See the License for the specific language governing permissions and |
| 11 | # limitations under the License. |
| 12 | |
| 13 | """ |
| 14 | Pixelle-Video Configuration System |
| 15 | |
| 16 | Unified configuration management with Pydantic validation. |
| 17 | |
| 18 | Usage: |
| 19 | from pixelle_video.config import config_manager |
| 20 | |
| 21 | # Access config (type-safe) |
| 22 | api_key = config_manager.config.llm.api_key |
| 23 | |
| 24 | # Update config |
| 25 | config_manager.update({"llm": {"api_key": "xxx"}}) |
| 26 | config_manager.save() |
| 27 | |
| 28 | # Validate |
| 29 | if config_manager.validate(): |
| 30 | print("Config is valid!") |
| 31 | """ |
| 32 | from .schema import PixelleVideoConfig, LLMConfig, ComfyUIConfig, TTSSubConfig, ImageSubConfig, VideoSubConfig |
| 33 | from .manager import ConfigManager |
| 34 | from .loader import load_config_dict, save_config_dict |
| 35 | |
| 36 | # Global singleton instance |
| 37 | config_manager = ConfigManager() |
| 38 | |
| 39 | __all__ = [ |
| 40 | "PixelleVideoConfig", |
| 41 | "LLMConfig", |
| 42 | "ComfyUIConfig", |
| 43 | "TTSSubConfig", |
| 44 | "ImageSubConfig", |
| 45 | "VideoSubConfig", |
| 46 | "ConfigManager", |
| 47 | "config_manager", |
| 48 | "load_config_dict", |
| 49 | "save_config_dict", |
| 50 | ] |
| 51 | |
| 52 |