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
This commit is contained in:
+13
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user