Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -413,10 +413,17 @@ def process_relight(input_fg, input_bg, prompt, image_width, image_height, num_s
|
|
413 |
error_msg = "❌ Please upload a background image or choose a lighting direction"
|
414 |
print(error_msg)
|
415 |
raise gr.Error(error_msg)
|
|
|
|
|
416 |
if not prompt.strip():
|
417 |
-
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
|
|
|
|
420 |
|
421 |
print(f"Processing with device: {device}")
|
422 |
print(f"Input shapes - FG: {input_fg.shape}, BG: {input_bg.shape if input_bg is not None else 'None'}")
|
|
|
413 |
error_msg = "❌ Please upload a background image or choose a lighting direction"
|
414 |
print(error_msg)
|
415 |
raise gr.Error(error_msg)
|
416 |
+
|
417 |
+
# Handle empty prompt - provide default when using background image
|
418 |
if not prompt.strip():
|
419 |
+
if bg_source == "Use Background Image" or bg_source == "Use Flipped Background Image":
|
420 |
+
# When using background image as light source, use a generic default prompt
|
421 |
+
prompt = "best quality, detailed"
|
422 |
+
print(f"Using default prompt for background lighting: {prompt}")
|
423 |
+
else:
|
424 |
+
error_msg = "❌ Please enter a prompt"
|
425 |
+
print(error_msg)
|
426 |
+
raise gr.Error(error_msg)
|
427 |
|
428 |
print(f"Processing with device: {device}")
|
429 |
print(f"Input shapes - FG: {input_fg.shape}, BG: {input_bg.shape if input_bg is not None else 'None'}")
|