Commit Graph

16 Commits

Author SHA1 Message Date
Will Miao
441af82dbd fix: update EXIF metadata extraction method for better compatibility with non-JPEG formats 2025-06-20 11:15:05 +08:00
Will Miao
c4c926070d fix: Update optimize_image method to handle image validation and error logging, and adjust metadata preservation logic. 2025-04-15 12:31:17 +08:00
Will Miao
4933dbfb87 Refactor ExifUtils by removing unused methods and imports
- Removed the extract_user_comment and update_user_comment methods to streamline the ExifUtils class.
- Cleaned up unnecessary imports and reduced code complexity, focusing on essential functionality for image metadata extraction.
2025-04-02 11:14:05 +08:00
Will Miao
dec757c23b Refactor image metadata handling in RecipeRoutes and ExifUtils
- Replaced the download function for images from Twitter to Civitai in recipe_routes.py.
- Updated metadata extraction from user comments to a more comprehensive image metadata extraction method in ExifUtils.
- Enhanced the appending of recipe metadata to utilize the new metadata extraction method.
- Added a new utility function to download images from Civitai.
2025-03-27 14:56:37 +08:00
Will Miao
8e653e2173 Refactor recipe saving process to utilize workflow JSON and enhance Lora handling
- Updated the recipe saving logic to accept a workflow JSON input instead of individual fields like name, tags, and metadata.
- Implemented parsing of the workflow to extract generation parameters and Lora stack, improving the recipe creation process.
- Enhanced error handling for missing workflow data and invalid Lora formats.
- Removed deprecated code related to individual field handling, streamlining the recipe saving functionality.
- Updated the front-end widget to send the workflow JSON directly, simplifying the data preparation process.
2025-03-21 17:28:20 +08:00
Will Miao
d4f300645d Enhance ExifUtils to extract prompts from node references in workflows
- Updated the logic in ExifUtils to first identify KSampler nodes and store references to positive and negative prompt nodes.
- Added a helper function to follow these references and extract text content from CLIP Text Encode nodes.
- Implemented a fallback mechanism to extract prompts using traditional methods if references are not available.
- Improved code readability with additional comments and structured handling of node data.
2025-03-21 11:32:51 +08:00
Will Miao
4ee32f02c5 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.
2025-03-21 11:11:09 +08:00
Will Miao
5cfae7198d Refactor recipe metadata handling and update CSS styles
- Moved the recipe metadata appending logic to occur after the JSON creation for better workflow.
- Adjusted the user comment formatting in ExifUtils to include a newline for improved readability.
- Reduced the maximum height of the recipe modal bottom section for better layout consistency.
2025-03-20 19:53:05 +08:00
Will Miao
f9c54690b0 Refactor logging and improve image optimization in RecipeRoutes and ExifUtils
- Removed print statements for initialization and setup in RecipeRoutes to reduce console clutter and improve logging practices.
- Updated image optimization parameters in RecipeRoutes to enhance image quality by increasing the target width.
- Modified user comment handling in ExifUtils to ensure proper formatting when appending recipe metadata, improving metadata consistency.
2025-03-19 14:50:36 +08:00
Will Miao
c3aaef3916 Enhance image handling and EXIF metadata processing in RecipeRoutes and ExifUtils
- Implemented image optimization in RecipeRoutes, resizing and converting uploaded images to WebP format while preserving metadata.
- Updated ExifUtils to support EXIF data handling for WebP images, ensuring compatibility with various image formats.
- Added a new method for optimizing images, allowing for better performance and quality in image uploads.
2025-03-19 14:17:37 +08:00
Will Miao
8a871ae643 Refactor EXIF data extraction and enhance recipe metadata parsing
- Updated ExifUtils to handle both JPEG/TIFF and non-JPEG/TIFF images for extracting UserComment from EXIF data, improving compatibility with various image formats.
- Introduced A1111MetadataParser to support parsing of images with A1111 metadata format, extracting prompts, negative prompts, and LoRA information.
- Enhanced error handling and logging for metadata parsing processes, ensuring better traceability and debugging capabilities.
2025-03-18 20:36:58 +08:00
Will Miao
e2191ab4b4 Refactor recipe metadata processing in RecipeRoutes
- Introduced a new RecipeParserFactory to streamline the parsing of recipe metadata from user comments, supporting multiple formats.
- Removed legacy metadata extraction logic from RecipeRoutes, delegating responsibilities to the new parser classes.
- Enhanced error handling for cases where no valid parser is found, ensuring graceful responses.
- Updated the RecipeScanner to improve the handling of LoRA metadata and reduce logging verbosity for better performance.
2025-03-18 18:54:22 +08:00
Will Miao
4264dd19a8 Enhance recipe metadata handling in RecipeRoutes and ExifUtils
- Added functionality to extract and process existing recipe metadata from images, including LoRA details and Civitai information.
- Updated ExifUtils to manage recipe metadata more effectively, including appending and removing metadata from user comments.
- Improved the ImportManager to utilize recipe metadata for setting default recipe names and tags when importing shared recipes.
2025-03-18 16:49:04 +08:00
Will Miao
78f8d4ecc7 Add sharing functionality for recipes
- Introduced new endpoints for sharing recipes and downloading shared images in RecipeRoutes.
- Implemented logic to process recipe images and append metadata to EXIF data.
- Updated RecipeCard component to handle sharing via API calls, providing user feedback during the process.
- Enhanced error handling for missing recipe IDs and failed API responses.
2025-03-18 14:52:21 +08:00
Will Miao
250e8445bb checkpoint 2025-03-09 12:29:24 +08:00
Will Miao
e6aafe8773 Add recipes checkpoint 2025-03-08 23:10:24 +08:00