From 9a1ab1c65640d301b3b527704e9ec21dca06930b Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sat, 26 Jul 2025 14:32:53 +0300 Subject: [PATCH] only show lora metadata if it actually exists --- nodes_model_loading.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/nodes_model_loading.py b/nodes_model_loading.py index 891c44b..78be6b4 100644 --- a/nodes_model_loading.py +++ b/nodes_model_loading.py @@ -393,9 +393,9 @@ class WanVideoLoraSelect: if unique_id and PromptServer is not None: try: - # Build table rows for metadata - metadata_rows = "" if metadata: + # Build table rows for metadata + metadata_rows = "" for key, value in metadata.items(): # Format value - handle special cases if isinstance(value, dict): @@ -404,19 +404,17 @@ class WanVideoLoraSelect: formatted_value = "
" + "\n".join([str(item) for item in value]) + "
" else: formatted_value = str(value) - metadata_rows += f"{key}{formatted_value}" - - PromptServer.instance.send_progress_text( - f"
" - f"Metadata" - f"" - f"" - f"{metadata_rows if metadata else ''}" - f"
Metadata
No metadata found
" - f"
", - unique_id - ) + PromptServer.instance.send_progress_text( + f"
" + f"Metadata" + f"" + f"" + f"{metadata_rows}" + f"
Metadata
" + f"
", + unique_id + ) except Exception as e: print(f"Error displaying metadata: {e}") pass