mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
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.
This commit is contained in:
@@ -135,7 +135,7 @@ class ExifUtils:
|
||||
recipe_metadata_marker = f"Recipe metadata: {recipe_metadata_json}"
|
||||
|
||||
# Append to existing user comment or create new one
|
||||
new_user_comment = user_comment + "\n" + recipe_metadata_marker if user_comment else recipe_metadata_marker
|
||||
new_user_comment = f"{user_comment}, {recipe_metadata_marker}" if user_comment else recipe_metadata_marker
|
||||
|
||||
# Write back to the image
|
||||
return ExifUtils.update_user_comment(image_path, new_user_comment)
|
||||
@@ -154,6 +154,10 @@ class ExifUtils:
|
||||
if recipe_marker_index == -1:
|
||||
return user_comment
|
||||
|
||||
# If recipe metadata is not at the start, remove the preceding ", "
|
||||
if recipe_marker_index >= 2 and user_comment[recipe_marker_index-2:recipe_marker_index] == ", ":
|
||||
recipe_marker_index -= 2
|
||||
|
||||
# Remove the recipe metadata part
|
||||
# First, find where the metadata ends (next line or end of string)
|
||||
next_line_index = user_comment.find("\n", recipe_marker_index)
|
||||
|
||||
Reference in New Issue
Block a user