Spaces:
Runtime error
Runtime error
Update config.py
Browse files
config.py
CHANGED
|
@@ -15,8 +15,12 @@ HUGGINGFACE_TOKEN = os.getenv("HUGGINGFACE_TOKEN", None)
|
|
| 15 |
|
| 16 |
# Model files
|
| 17 |
MODEL_FILES = {
|
| 18 |
-
"checkpoint": "horizon.
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
"vae": "pixelate.safetensors"
|
| 21 |
}
|
| 22 |
|
|
@@ -29,8 +33,15 @@ INSTANTID_CONFIG = {
|
|
| 29 |
"face_model_repo": "DIAMONIK7777/antelopev2"
|
| 30 |
}
|
| 31 |
|
|
|
|
| 32 |
# LORA configuration
|
| 33 |
-
TRIGGER_WORD =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Face detection configuration
|
| 36 |
FACE_DETECTION_CONFIG = {
|
|
@@ -62,10 +73,8 @@ DEFAULT_PARAMS = {
|
|
| 62 |
"enable_color_matching": False,
|
| 63 |
"consistency_mode": True,
|
| 64 |
"seed": -1,
|
| 65 |
-
# --- START FIX: Add missing default parameters ---
|
| 66 |
"expression_control_scale": 0.6,
|
| 67 |
"lora_choice": "RetroArt"
|
| 68 |
-
# --- END FIX ---
|
| 69 |
}
|
| 70 |
|
| 71 |
# Optimized preset configurations
|
|
@@ -77,9 +86,7 @@ PRESETS = {
|
|
| 77 |
"lora_scale": 0.8,
|
| 78 |
"depth_control_scale": 0.65,
|
| 79 |
"identity_control_scale": 0.95,
|
| 80 |
-
# --- START FIX: Add missing parameters ---
|
| 81 |
"expression_control_scale": 0.5,
|
| 82 |
-
# --- END FIX ---
|
| 83 |
"description": "Maximum face preservation - 96-98% similarity (Level 3)"
|
| 84 |
},
|
| 85 |
"Premium Portrait": {
|
|
@@ -89,9 +96,7 @@ PRESETS = {
|
|
| 89 |
"lora_scale": 1.1,
|
| 90 |
"depth_control_scale": 0.75,
|
| 91 |
"identity_control_scale": 0.85,
|
| 92 |
-
# --- START FIX: Add missing parameters ---
|
| 93 |
"expression_control_scale": 0.6,
|
| 94 |
-
# --- END FIX ---
|
| 95 |
"description": "Optimized balanced - strong pixel art + excellent face (92-94% similarity)"
|
| 96 |
},
|
| 97 |
"Balanced Portrait": {
|
|
@@ -101,9 +106,7 @@ PRESETS = {
|
|
| 101 |
"lora_scale": 1.0,
|
| 102 |
"depth_control_scale": 0.75,
|
| 103 |
"identity_control_scale": 0.85,
|
| 104 |
-
# --- START FIX: Add missing parameters ---
|
| 105 |
"expression_control_scale": 0.6,
|
| 106 |
-
# --- END FIX ---
|
| 107 |
"description": "Good balance between fidelity and style - 90-93% similarity"
|
| 108 |
},
|
| 109 |
"Artistic Excellence": {
|
|
@@ -113,9 +116,7 @@ PRESETS = {
|
|
| 113 |
"lora_scale": 1.2,
|
| 114 |
"depth_control_scale": 0.78,
|
| 115 |
"identity_control_scale": 0.75,
|
| 116 |
-
# --- START FIX: Add missing parameters ---
|
| 117 |
"expression_control_scale": 0.7,
|
| 118 |
-
# --- END FIX ---
|
| 119 |
"description": "Creative with strong likeness - 88-91% similarity"
|
| 120 |
},
|
| 121 |
"Style Focus": {
|
|
@@ -125,9 +126,7 @@ PRESETS = {
|
|
| 125 |
"lora_scale": 1.4,
|
| 126 |
"depth_control_scale": 0.82,
|
| 127 |
"identity_control_scale": 0.65,
|
| 128 |
-
# --- START FIX: Add missing parameters ---
|
| 129 |
"expression_control_scale": 0.7,
|
| 130 |
-
# --- END FIX ---
|
| 131 |
"description": "Maximum pixel art style - 83-87% similarity"
|
| 132 |
},
|
| 133 |
"Subtle Enhancement": {
|
|
@@ -137,9 +136,7 @@ PRESETS = {
|
|
| 137 |
"lora_scale": 0.75,
|
| 138 |
"depth_control_scale": 0.60,
|
| 139 |
"identity_control_scale": 0.98,
|
| 140 |
-
# --- START FIX: Add missing parameters ---
|
| 141 |
"expression_control_scale": 0.4,
|
| 142 |
-
# --- END FIX ---
|
| 143 |
"description": "Minimal transformation, photo-realistic - 97-99% similarity"
|
| 144 |
}
|
| 145 |
}
|
|
@@ -229,7 +226,5 @@ print(f" HuggingFace Token: {'Set' if HUGGINGFACE_TOKEN else 'Not set (using IP
|
|
| 229 |
print(f" InstantID: Enabled")
|
| 230 |
|
| 231 |
|
| 232 |
-
# --- START FIX: Add missing LORA_CHOICES list ---
|
| 233 |
# This list must match the LORA adapter names loaded in models.py
|
| 234 |
-
LORA_CHOICES = ["RetroArt", "VGA", "LucasArt", "None"]
|
| 235 |
-
# --- END FIX ---
|
|
|
|
| 15 |
|
| 16 |
# Model files
|
| 17 |
MODEL_FILES = {
|
| 18 |
+
"checkpoint": "horizon.safetensors",
|
| 19 |
+
# --- START FIX: Define all LORA files ---
|
| 20 |
+
"lora_retroart": "retroart.safetensors",
|
| 21 |
+
"lora_vga": "vga.safetensors",
|
| 22 |
+
"lora_lucasart": "lucasart.safetensors",
|
| 23 |
+
# --- END FIX ---
|
| 24 |
"vae": "pixelate.safetensors"
|
| 25 |
}
|
| 26 |
|
|
|
|
| 33 |
"face_model_repo": "DIAMONIK7777/antelopev2"
|
| 34 |
}
|
| 35 |
|
| 36 |
+
# --- START FIX: Update TRIGGER_WORD to be a dictionary ---
|
| 37 |
# LORA configuration
|
| 38 |
+
TRIGGER_WORD = {
|
| 39 |
+
"RetroArt": "p1x3l4rt, pixel art",
|
| 40 |
+
"VGA": "dosvga style",
|
| 41 |
+
"LucasArt": "lucasarts style",
|
| 42 |
+
"None": "" # No trigger word when no LORA is selected
|
| 43 |
+
}
|
| 44 |
+
# --- END FIX ---
|
| 45 |
|
| 46 |
# Face detection configuration
|
| 47 |
FACE_DETECTION_CONFIG = {
|
|
|
|
| 73 |
"enable_color_matching": False,
|
| 74 |
"consistency_mode": True,
|
| 75 |
"seed": -1,
|
|
|
|
| 76 |
"expression_control_scale": 0.6,
|
| 77 |
"lora_choice": "RetroArt"
|
|
|
|
| 78 |
}
|
| 79 |
|
| 80 |
# Optimized preset configurations
|
|
|
|
| 86 |
"lora_scale": 0.8,
|
| 87 |
"depth_control_scale": 0.65,
|
| 88 |
"identity_control_scale": 0.95,
|
|
|
|
| 89 |
"expression_control_scale": 0.5,
|
|
|
|
| 90 |
"description": "Maximum face preservation - 96-98% similarity (Level 3)"
|
| 91 |
},
|
| 92 |
"Premium Portrait": {
|
|
|
|
| 96 |
"lora_scale": 1.1,
|
| 97 |
"depth_control_scale": 0.75,
|
| 98 |
"identity_control_scale": 0.85,
|
|
|
|
| 99 |
"expression_control_scale": 0.6,
|
|
|
|
| 100 |
"description": "Optimized balanced - strong pixel art + excellent face (92-94% similarity)"
|
| 101 |
},
|
| 102 |
"Balanced Portrait": {
|
|
|
|
| 106 |
"lora_scale": 1.0,
|
| 107 |
"depth_control_scale": 0.75,
|
| 108 |
"identity_control_scale": 0.85,
|
|
|
|
| 109 |
"expression_control_scale": 0.6,
|
|
|
|
| 110 |
"description": "Good balance between fidelity and style - 90-93% similarity"
|
| 111 |
},
|
| 112 |
"Artistic Excellence": {
|
|
|
|
| 116 |
"lora_scale": 1.2,
|
| 117 |
"depth_control_scale": 0.78,
|
| 118 |
"identity_control_scale": 0.75,
|
|
|
|
| 119 |
"expression_control_scale": 0.7,
|
|
|
|
| 120 |
"description": "Creative with strong likeness - 88-91% similarity"
|
| 121 |
},
|
| 122 |
"Style Focus": {
|
|
|
|
| 126 |
"lora_scale": 1.4,
|
| 127 |
"depth_control_scale": 0.82,
|
| 128 |
"identity_control_scale": 0.65,
|
|
|
|
| 129 |
"expression_control_scale": 0.7,
|
|
|
|
| 130 |
"description": "Maximum pixel art style - 83-87% similarity"
|
| 131 |
},
|
| 132 |
"Subtle Enhancement": {
|
|
|
|
| 136 |
"lora_scale": 0.75,
|
| 137 |
"depth_control_scale": 0.60,
|
| 138 |
"identity_control_scale": 0.98,
|
|
|
|
| 139 |
"expression_control_scale": 0.4,
|
|
|
|
| 140 |
"description": "Minimal transformation, photo-realistic - 97-99% similarity"
|
| 141 |
}
|
| 142 |
}
|
|
|
|
| 226 |
print(f" InstantID: Enabled")
|
| 227 |
|
| 228 |
|
|
|
|
| 229 |
# This list must match the LORA adapter names loaded in models.py
|
| 230 |
+
LORA_CHOICES = ["RetroArt", "VGA", "LucasArt", "None"]
|
|
|