uruguayai commited on
Commit
5849d75
·
verified ·
1 Parent(s): 3fd2083

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -15,11 +15,21 @@ except Exception as e:
15
  print(f"Error initializing model: {e}")
16
  inpaint_model = None
17
 
 
 
 
 
 
 
 
 
18
  def process_image(prompt, image, style, upscale_factor, inpaint):
19
  try:
20
- # Debug the type and content of image received
21
  if image is None:
22
- return None, "No image received."
 
 
23
 
24
  print(f"Received image type: {type(image)}")
25
 
 
15
  print(f"Error initializing model: {e}")
16
  inpaint_model = None
17
 
18
+ # Load a test image
19
+ def load_test_image():
20
+ try:
21
+ return Image.open("path/to/your/test_image.png") # Replace with a valid path
22
+ except Exception as e:
23
+ print(f"Error loading test image: {e}")
24
+ return None
25
+
26
  def process_image(prompt, image, style, upscale_factor, inpaint):
27
  try:
28
+ # Use a test image if no image is received
29
  if image is None:
30
+ image = load_test_image()
31
+ if image is None:
32
+ return None, "No image received and failed to load test image."
33
 
34
  print(f"Received image type: {type(image)}")
35