Files
ComfyUI-Lora-Manager/py/utils/recipe_parsers.py
Will Miao c9f902a8af Refactor recipe metadata parser package for ComfyUI-Lora-Manager
- Implemented the base class `RecipeMetadataParser` for parsing recipe metadata from user comments.
- Created a factory class `RecipeParserFactory` to instantiate appropriate parser based on user comment content.
- Developed multiple parser classes: `ComfyMetadataParser`, `AutomaticMetadataParser`, `MetaFormatParser`, and `RecipeFormatParser` to handle different metadata formats.
- Introduced constants for generation parameters and valid LoRA types.
- Enhanced error handling and logging throughout the parsing process.
- Added functionality to populate LoRA and checkpoint information from Civitai API responses.
- Structured the output of parsed metadata to include prompts, LoRAs, generation parameters, and model information.
2025-05-06 21:11:25 +08:00

39 lines
944 B
Python

"""
Legacy recipe_parsers module that redirects to the new recipes package.
This file is kept for backwards compatibility and now imports the refactored modules.
"""
import logging
import warnings
# Show deprecation warning
warnings.warn(
"The module 'py.utils.recipe_parsers' is deprecated. Use 'py.recipes' instead.",
DeprecationWarning,
stacklevel=2
)
# Import from the new location
from ..recipes.constants import GEN_PARAM_KEYS, VALID_LORA_TYPES
from ..recipes.base import RecipeMetadataParser
from ..recipes.parsers import (
RecipeFormatParser,
ComfyMetadataParser,
MetaFormatParser,
AutomaticMetadataParser
)
from ..recipes.factory import RecipeParserFactory
# Redirect all imports
__all__ = [
'GEN_PARAM_KEYS',
'VALID_LORA_TYPES',
'RecipeMetadataParser',
'RecipeFormatParser',
'ComfyMetadataParser',
'MetaFormatParser',
'AutomaticMetadataParser',
'RecipeParserFactory'
]