Spaces:
Runtime error
Runtime error
Update config.py
Browse files
config.py
CHANGED
|
@@ -29,11 +29,7 @@ FACE_DETECTION_CONFIG = {
|
|
| 29 |
"ctx_id": 0
|
| 30 |
}
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
DEPTH_DETECTION_CONFIG = {
|
| 34 |
-
"model_name": "leres++", # LeRes++ provides superior depth accuracy
|
| 35 |
-
"method": "leres"
|
| 36 |
-
}
|
| 37 |
RECOMMENDED_SIZES = [
|
| 38 |
(896, 1152), # Portrait
|
| 39 |
(1152, 896), # Landscape
|
|
@@ -49,6 +45,7 @@ DEFAULT_PARAMS = {
|
|
| 49 |
"strength": 0.50,
|
| 50 |
"depth_control_scale": 0.75,
|
| 51 |
"identity_control_scale": 0.85,
|
|
|
|
| 52 |
"lora_scale": 1.0,
|
| 53 |
"identity_preservation": 1.2,
|
| 54 |
"enable_color_matching": False,
|
|
@@ -65,6 +62,7 @@ PRESETS = {
|
|
| 65 |
"lora_scale": 0.8,
|
| 66 |
"depth_control_scale": 0.65,
|
| 67 |
"identity_control_scale": 0.95,
|
|
|
|
| 68 |
"description": "Maximum face preservation - 96-98% similarity (Level 3)"
|
| 69 |
},
|
| 70 |
"Premium Portrait": {
|
|
@@ -74,6 +72,7 @@ PRESETS = {
|
|
| 74 |
"lora_scale": 1.1,
|
| 75 |
"depth_control_scale": 0.75,
|
| 76 |
"identity_control_scale": 0.85,
|
|
|
|
| 77 |
"description": "Optimized balanced - strong pixel art + excellent face (92-94% similarity)"
|
| 78 |
},
|
| 79 |
"Balanced Portrait": {
|
|
@@ -83,6 +82,7 @@ PRESETS = {
|
|
| 83 |
"lora_scale": 1.0,
|
| 84 |
"depth_control_scale": 0.75,
|
| 85 |
"identity_control_scale": 0.85,
|
|
|
|
| 86 |
"description": "Good balance between fidelity and style - 90-93% similarity"
|
| 87 |
},
|
| 88 |
"Artistic Excellence": {
|
|
@@ -92,6 +92,7 @@ PRESETS = {
|
|
| 92 |
"lora_scale": 1.2,
|
| 93 |
"depth_control_scale": 0.78,
|
| 94 |
"identity_control_scale": 0.75,
|
|
|
|
| 95 |
"description": "Creative with strong likeness - 88-91% similarity"
|
| 96 |
},
|
| 97 |
"Style Focus": {
|
|
@@ -101,6 +102,7 @@ PRESETS = {
|
|
| 101 |
"lora_scale": 1.4,
|
| 102 |
"depth_control_scale": 0.82,
|
| 103 |
"identity_control_scale": 0.65,
|
|
|
|
| 104 |
"description": "Maximum pixel art style - 83-87% similarity"
|
| 105 |
},
|
| 106 |
"Subtle Enhancement": {
|
|
@@ -110,6 +112,7 @@ PRESETS = {
|
|
| 110 |
"lora_scale": 0.75,
|
| 111 |
"depth_control_scale": 0.60,
|
| 112 |
"identity_control_scale": 0.98,
|
|
|
|
| 113 |
"description": "Minimal transformation, photo-realistic - 97-99% similarity"
|
| 114 |
}
|
| 115 |
}
|
|
@@ -195,4 +198,4 @@ print(f"[CONFIG] Loaded configuration")
|
|
| 195 |
print(f" Device: {device}")
|
| 196 |
print(f" Dtype: {dtype}")
|
| 197 |
print(f" Model Repo: {MODEL_REPO}")
|
| 198 |
-
print(f" HuggingFace Token: {'Set' if HUGGINGFACE_TOKEN else 'Not set (using IP-based access)'}")
|
|
|
|
| 29 |
"ctx_id": 0
|
| 30 |
}
|
| 31 |
|
| 32 |
+
# Recommended resolutions
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
RECOMMENDED_SIZES = [
|
| 34 |
(896, 1152), # Portrait
|
| 35 |
(1152, 896), # Landscape
|
|
|
|
| 45 |
"strength": 0.50,
|
| 46 |
"depth_control_scale": 0.75,
|
| 47 |
"identity_control_scale": 0.85,
|
| 48 |
+
"expression_control_scale": 0.6, # <-- NEW
|
| 49 |
"lora_scale": 1.0,
|
| 50 |
"identity_preservation": 1.2,
|
| 51 |
"enable_color_matching": False,
|
|
|
|
| 62 |
"lora_scale": 0.8,
|
| 63 |
"depth_control_scale": 0.65,
|
| 64 |
"identity_control_scale": 0.95,
|
| 65 |
+
"expression_control_scale": 0.8, # <-- NEW
|
| 66 |
"description": "Maximum face preservation - 96-98% similarity (Level 3)"
|
| 67 |
},
|
| 68 |
"Premium Portrait": {
|
|
|
|
| 72 |
"lora_scale": 1.1,
|
| 73 |
"depth_control_scale": 0.75,
|
| 74 |
"identity_control_scale": 0.85,
|
| 75 |
+
"expression_control_scale": 0.6, # <-- NEW
|
| 76 |
"description": "Optimized balanced - strong pixel art + excellent face (92-94% similarity)"
|
| 77 |
},
|
| 78 |
"Balanced Portrait": {
|
|
|
|
| 82 |
"lora_scale": 1.0,
|
| 83 |
"depth_control_scale": 0.75,
|
| 84 |
"identity_control_scale": 0.85,
|
| 85 |
+
"expression_control_scale": 0.6, # <-- NEW
|
| 86 |
"description": "Good balance between fidelity and style - 90-93% similarity"
|
| 87 |
},
|
| 88 |
"Artistic Excellence": {
|
|
|
|
| 92 |
"lora_scale": 1.2,
|
| 93 |
"depth_control_scale": 0.78,
|
| 94 |
"identity_control_scale": 0.75,
|
| 95 |
+
"expression_control_scale": 0.45, # <-- NEW
|
| 96 |
"description": "Creative with strong likeness - 88-91% similarity"
|
| 97 |
},
|
| 98 |
"Style Focus": {
|
|
|
|
| 102 |
"lora_scale": 1.4,
|
| 103 |
"depth_control_scale": 0.82,
|
| 104 |
"identity_control_scale": 0.65,
|
| 105 |
+
"expression_control_scale": 0.3, # <-- NEW
|
| 106 |
"description": "Maximum pixel art style - 83-87% similarity"
|
| 107 |
},
|
| 108 |
"Subtle Enhancement": {
|
|
|
|
| 112 |
"lora_scale": 0.75,
|
| 113 |
"depth_control_scale": 0.60,
|
| 114 |
"identity_control_scale": 0.98,
|
| 115 |
+
"expression_control_scale": 0.85, # <-- NEW
|
| 116 |
"description": "Minimal transformation, photo-realistic - 97-99% similarity"
|
| 117 |
}
|
| 118 |
}
|
|
|
|
| 198 |
print(f" Device: {device}")
|
| 199 |
print(f" Dtype: {dtype}")
|
| 200 |
print(f" Model Repo: {MODEL_REPO}")
|
| 201 |
+
print(f" HuggingFace Token: {'Set' if HUGGINGFACE_TOKEN else 'Not set (using IP-based access)'}")
|