From 3220a67f1b0699797cef28e2adb0ad6f027331a5 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Tue, 8 Sep 2026 08:45:57 +0200 Subject: [PATCH] Deduplicate Hermes image references --- integrations/hermes-athena-image/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integrations/hermes-athena-image/__init__.py b/integrations/hermes-athena-image/__init__.py index d84b61b..2510d9c 100644 --- a/integrations/hermes-athena-image/__init__.py +++ b/integrations/hermes-athena-image/__init__.py @@ -212,7 +212,10 @@ class AthenaLocalImageProvider(ImageGenProvider): if isinstance(image_url, str) and image_url.strip(): sources.append(image_url.strip()) sources.extend(normalize_reference_images(reference_image_urls) or []) - sources = sources[:4] + # Hermes may expose the primary upload through both ``image_url`` and + # ``reference_image_urls``. Preserve order while removing duplicates; + # restoration deliberately accepts exactly one physical source image. + sources = list(dict.fromkeys(sources))[:4] model = _select_model(kwargs.get("model")) try: encoded_sources = [