Add functionality to save recipes from the LoRAs widget

- Introduced a new API endpoint to save recipes directly from the LoRAs widget.
- Implemented logic to handle recipe data, including image processing and metadata extraction.
- Enhanced error handling for missing fields and image retrieval.
- Updated the ExifUtils to extract generation parameters from images for recipe creation.
- Added a direct save option in the widget, improving user experience.
This commit is contained in:
Will Miao
2025-03-21 11:11:09 +08:00
parent 2cf4440a1e
commit 4ee32f02c5
6 changed files with 433 additions and 12 deletions

View File

@@ -517,14 +517,10 @@ class RecipeParserFactory:
Appropriate RecipeMetadataParser implementation
"""
if RecipeFormatParser().is_metadata_matching(user_comment):
logger.info("RecipeFormatParser")
return RecipeFormatParser()
elif StandardMetadataParser().is_metadata_matching(user_comment):
logger.info("StandardMetadataParser")
return StandardMetadataParser()
elif A1111MetadataParser().is_metadata_matching(user_comment):
logger.info("A1111MetadataParser")
return A1111MetadataParser()
else:
logger.info("No parser found for this image")
return None