mrbui1990 commited on
Commit
a5e5505
·
verified ·
1 Parent(s): 97978bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -377,15 +377,13 @@ def infer(
377
  print("❌ Invalid key.")
378
  return None
379
  config = LORA_CONFIG[lora_name]
380
-
381
- if config["type"] == "style":
382
- if style_image is None:
383
- raise gr.Error("Style Transfer LoRA requires a Style Reference Image.")
384
- image_for_pipeline = style_image
385
- else: # 'edit' or 'base'
386
- if input_image is None:
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.")