mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 13:42:12 -03:00
- 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.
39 lines
944 B
Python
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'
|
|
]
|