__init__.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. Pixelle-Video Configuration System
  14. Unified configuration management with Pydantic validation.
  15. Usage:
  16. from pixelle_video.config import config_manager
  17. # Access config (type-safe)
  18. api_key = config_manager.config.llm.api_key
  19. # Update config
  20. config_manager.update({"llm": {"api_key": "xxx"}})
  21. config_manager.save()
  22. # Validate
  23. if config_manager.validate():
  24. print("Config is valid!")
  25. """
  26. from .schema import PixelleVideoConfig, LLMConfig, ComfyUIConfig, TTSSubConfig, ImageSubConfig, VideoSubConfig
  27. from .manager import ConfigManager
  28. from .loader import load_config_dict, save_config_dict
  29. # Global singleton instance
  30. config_manager = ConfigManager()
  31. __all__ = [
  32. "PixelleVideoConfig",
  33. "LLMConfig",
  34. "ComfyUIConfig",
  35. "TTSSubConfig",
  36. "ImageSubConfig",
  37. "VideoSubConfig",
  38. "ConfigManager",
  39. "config_manager",
  40. "load_config_dict",
  41. "save_config_dict",
  42. ]