ONEROCKS commited on
Commit
75426ec
·
verified ·
1 Parent(s): 0c5e769

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -22,6 +22,13 @@ def generate_image(prompt):
22
  except Exception as e:
23
  return f"Error: {e}"
24
 
 
 
 
 
 
 
 
25
 
26
  def synthesize_speech(text):
27
  if not text.strip():
 
22
  except Exception as e:
23
  return f"Error: {e}"
24
 
25
+ def generate_and_display(prompt):
26
+ image_url = generate_image(prompt)
27
+ if isinstance(image_url, str) and image_url.startswith("http"):
28
+ return image_url
29
+ else:
30
+ return None # Or display an error message in another component
31
+
32
 
33
  def synthesize_speech(text):
34
  if not text.strip():