wifix199 commited on
Commit
c95ed83
1 Parent(s): 2cc7460

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -27,13 +27,18 @@ def generate_image_from_model(prompt):
27
 
28
  return image_path # Return the path to the image
29
 
30
- # Create the Gradio interface
 
 
 
 
 
31
  interface = gr.Interface(
32
- fn=generate_image_from_model,
33
  inputs="text",
34
  outputs="image",
35
- title="OpenJourney Text-to-Image",
36
- description="Enter a prompt to generate an image using OpenJourney model."
37
  )
38
 
39
  # Launch the interface
 
27
 
28
  return image_path # Return the path to the image
29
 
30
+ # Define the chatbot function to return the generated image
31
+ def chatbot(prompt):
32
+ image = generate_image(prompt)
33
+ return image
34
+
35
+ # Create the Gradio interface with the same UI/UX
36
  interface = gr.Interface(
37
+ fn=chatbot,
38
  inputs="text",
39
  outputs="image",
40
+ title="prompthero/openjourney",
41
+ description="Enter a text prompt and get an AI-generated image."
42
  )
43
 
44
  # Launch the interface