Spaces:
Runtime error
Runtime error
Update generator.py
Browse files- generator.py +5 -3
generator.py
CHANGED
|
@@ -762,7 +762,8 @@ class RetroArtConverter:
|
|
| 762 |
|
| 763 |
pipe_kwargs["generator"] = generator
|
| 764 |
|
| 765 |
-
# --- START FIX: Use
|
|
|
|
| 766 |
if self.use_compel and self.compel is not None:
|
| 767 |
try:
|
| 768 |
print("Encoding prompts with Compel...")
|
|
@@ -830,7 +831,8 @@ class RetroArtConverter:
|
|
| 830 |
|
| 831 |
print(f" - Face embedding: {face_proj_embeds.shape}, Scale: {boosted_scale:.2f}")
|
| 832 |
|
| 833 |
-
# --- START FIX: Your padding solution ---
|
|
|
|
| 834 |
if 'prompt_embeds' in pipe_kwargs:
|
| 835 |
original_embeds = pipe_kwargs['prompt_embeds']
|
| 836 |
|
|
@@ -858,7 +860,7 @@ class RetroArtConverter:
|
|
| 858 |
print(f" [OK] Face embeddings concatenated successfully! Prompt: {combined_embeds.shape}")
|
| 859 |
else:
|
| 860 |
print(f" [WARNING] Can't concatenate - no prompt_embeds (use Compel)")
|
| 861 |
-
# --- END FIX ---
|
| 862 |
|
| 863 |
elif has_detected_faces:
|
| 864 |
print(" Face detected but IP-Adapter/embeddings unavailable, using keypoints only")
|
|
|
|
| 762 |
|
| 763 |
pipe_kwargs["generator"] = generator
|
| 764 |
|
| 765 |
+
# --- START FIX: Use CompelForSDXL as per documentation ---
|
| 766 |
+
# This fixes the "TypeError" and the "93 vs 77" error
|
| 767 |
if self.use_compel and self.compel is not None:
|
| 768 |
try:
|
| 769 |
print("Encoding prompts with Compel...")
|
|
|
|
| 831 |
|
| 832 |
print(f" - Face embedding: {face_proj_embeds.shape}, Scale: {boosted_scale:.2f}")
|
| 833 |
|
| 834 |
+
# --- START FIX 2: Your padding solution ---
|
| 835 |
+
# This fixes the "109 vs 93" error
|
| 836 |
if 'prompt_embeds' in pipe_kwargs:
|
| 837 |
original_embeds = pipe_kwargs['prompt_embeds']
|
| 838 |
|
|
|
|
| 860 |
print(f" [OK] Face embeddings concatenated successfully! Prompt: {combined_embeds.shape}")
|
| 861 |
else:
|
| 862 |
print(f" [WARNING] Can't concatenate - no prompt_embeds (use Compel)")
|
| 863 |
+
# --- END FIX 2 ---
|
| 864 |
|
| 865 |
elif has_detected_faces:
|
| 866 |
print(" Face detected but IP-Adapter/embeddings unavailable, using keypoints only")
|