From e2f93540eeddc4cd4124232fdb2f8311c5f9dd0c Mon Sep 17 00:00:00 2001 From: PXL8D Date: Wed, 13 Aug 2025 12:17:22 -0700 Subject: [PATCH] Add comprehensive debug logging for embeddings detection - Added debug logs to _extract_embeddings_from_text to show regex matches - Added debug logs to _extract_embeddings_universal to show text candidates - Will help identify why embeddings are not being detected --- metaman.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/metaman.py b/metaman.py index e675798..cc621d3 100644 --- a/metaman.py +++ b/metaman.py @@ -1295,7 +1295,10 @@ class MetaManLoadImage: all_embeddings = [] seen_embeddings = set() + print(f"MetaMan Embeddings Debug: Scanning {len(text_candidates)} text candidates for embeddings") # Debug log + for candidate in text_candidates: + print(f"MetaMan Embeddings Debug: Checking candidate {candidate['source']}: '{candidate['text'][:50]}...'") # Debug log embeddings_in_text = self._extract_embeddings_from_text(candidate['text']) for embedding in embeddings_in_text: embedding_key = embedding['name'].lower() @@ -1304,6 +1307,8 @@ class MetaManLoadImage: all_embeddings.append(embedding) print(f"MetaMan Universal: Found embedding '{embedding['name']}' in {candidate['source']}") + print(f"MetaMan Embeddings Debug: Final universal embeddings: {all_embeddings}") # Debug log + return all_embeddings def _extract_embeddings_from_text(self, text: str) -> list: @@ -1313,16 +1318,21 @@ class MetaManLoadImage: embeddings = [] text_lower = text.lower() + print(f"MetaMan Embeddings Debug: Scanning text: '{text[:100]}...'") # Debug log + # Pattern 1: embedding:name syntax embedding_pattern = r'embedding:([\w\-_\.]+)' matches = re.findall(embedding_pattern, text, re.IGNORECASE) + print(f"MetaMan Embeddings Debug: Found {len(matches)} embedding: matches: {matches}") # Debug log + for match in matches: name = match.strip() embeddings.append({ 'name': name, 'type': 'embedding' }) + print(f"MetaMan Embeddings Debug: Added embedding '{name}'") # Debug log # Pattern 2: Well-known negative embedding names (even without embedding: prefix) negative_embeddings = [ @@ -1346,6 +1356,9 @@ class MetaManLoadImage: 'name': embedding_name, 'type': 'negative_embedding' }) + print(f"MetaMan Embeddings Debug: Added known negative embedding '{embedding_name}'") # Debug log + + print(f"MetaMan Embeddings Debug: Final embeddings list: {embeddings}") # Debug log return embeddings