mrbeliever commited on
Commit
04e02d2
1 Parent(s): 3c9a05a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -3,15 +3,21 @@ import gradio as gr
3
  # Load the model
4
  model = gr.load("models/stablediffusionapi/juggernaut-xl-v5")
5
 
 
 
 
 
 
 
6
  # Customize the interface
7
  iface = gr.Interface(
8
- fn=model,
9
  live=True,
10
  title="Text-to-Image Generator",
11
- description="",
12
  inputs="text",
13
  outputs="image", # Set outputs to "image" for image output
14
- # Set the button name to "Generate"
15
  )
16
 
17
  # Launch the customized interface
 
3
  # Load the model
4
  model = gr.load("models/stablediffusionapi/juggernaut-xl-v5")
5
 
6
+ # Define the function to generate image
7
+ def generate_image(text_input):
8
+ # Call your model to generate the image based on the text input
9
+ generated_image = model(text_input)
10
+ return generated_image
11
+
12
  # Customize the interface
13
  iface = gr.Interface(
14
+ fn=generate_image,
15
  live=True,
16
  title="Text-to-Image Generator",
17
+ description="The image will be generated automatically when you enter text.",
18
  inputs="text",
19
  outputs="image", # Set outputs to "image" for image output
20
+ interpretation="default", # Automatically updates without a button
21
  )
22
 
23
  # Launch the customized interface