Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -377,15 +377,13 @@ def infer(
|
|
| 377 |
print("❌ Invalid key.")
|
| 378 |
return None
|
| 379 |
config = LORA_CONFIG[lora_name]
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
else:
|
| 386 |
-
|
| 387 |
-
raise gr.Error("This LoRA requires an Input Image.")
|
| 388 |
-
image_for_pipeline = input_image
|
| 389 |
|
| 390 |
if not prompt and config["prompt_template"] != "change the face to face segmentation mask":
|
| 391 |
raise gr.Error("A text prompt is required for this LoRA.")
|
|
|
|
| 377 |
print("❌ Invalid key.")
|
| 378 |
return None
|
| 379 |
config = LORA_CONFIG[lora_name]
|
| 380 |
+
|
| 381 |
+
default_path = os.path.join(os.path.dirname(__file__), "1.jpg")
|
| 382 |
+
if os.path.exists(default_path):
|
| 383 |
+
image_for_pipeline = [Image.open(default_path).convert("RGB")]
|
| 384 |
+
print("Loaded default image: 1.jpg")
|
| 385 |
+
else:
|
| 386 |
+
raise gr.Error("No input images and '1.jpg' not found in app directory.")
|
|
|
|
|
|
|
| 387 |
|
| 388 |
if not prompt and config["prompt_template"] != "change the face to face segmentation mask":
|
| 389 |
raise gr.Error("A text prompt is required for this LoRA.")
|