From b8aadd7faa5fc3e1bf07bfc83ec2e04133679db3 Mon Sep 17 00:00:00 2001 From: AEmotionStudio <163354043+AEmotionStudio@users.noreply.github.com> Date: Tue, 20 Jan 2026 02:27:42 -0800 Subject: [PATCH] fix(image_node): add section header when only dimensions are displayed When add_dimensions or resize_to_power_of_2 was enabled but add_date, add_time, and include_format_in_message were all disabled, dimensions would be appended to the Discord message without the "Image Information:" section header. Now checks if dimensions will be added but no other metadata exists, and adds the section header in that case. Fixes issue identified in PR #35 review. Co-Authored-By: Claude Opus 4.5 --- nodes/image_node.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/nodes/image_node.py b/nodes/image_node.py index 3441347..9298cf6 100644 --- a/nodes/image_node.py +++ b/nodes/image_node.py @@ -445,17 +445,26 @@ class DiscordSendSaveImage: # Add image info if available if "message_prefix" in image_info: info_message = image_info["message_prefix"] - + + # Check if we need to add dimensions + has_resize_dimensions = "original_dimensions" in image_info and "resized_dimensions" in image_info + has_dimensions = "dimensions" in image_info + + # Add section header if dimensions will be added but no other metadata exists + if (has_resize_dimensions or has_dimensions) and not info_message: + info_message = "\n\n**Image Information:**\n" + # Add dimensions info if available - if "original_dimensions" in image_info and "resized_dimensions" in image_info: + if has_resize_dimensions: info_message += f"**Original Dimensions:** {image_info['original_dimensions']}\n" info_message += f"**Resized Dimensions:** {image_info['resized_dimensions']} (Power of 2)\n" - elif "dimensions" in image_info: + elif has_dimensions: info_message += f"**Dimensions:** {image_info['dimensions']}\n" - + # Add the complete info message to the Discord message - discord_message += info_message - print("Added image information to Discord message") + if info_message: + discord_message += info_message + print("Added image information to Discord message") # Add prompts after image info if available (decoupled from image info presence) if "prompt_message" in image_info: