xnetba commited on
Commit
a08eb38
·
1 Parent(s): 6495e28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,7 +24,7 @@ default_model = "stabilityai/stable-diffusion-2"
24
  model_name = gr.inputs.Dropdown(choices=model_list, label="Select Model", default=default_model)
25
 
26
  def generate_image(text, model_name):
27
- model = gr.load(model_name, source="huggingface", api_key=api_key)
28
  return model.predict(text)
29
 
30
  input_text = gr.inputs.Textbox(label="Input Text")
@@ -32,7 +32,7 @@ output_image = comp.Image(label="Generated Image")
32
 
33
  iface = gr.Interface(
34
  fn=generate_image,
35
- inputs=[input_text, model_name],
36
  outputs=output_image,
37
  title="Text to Image Generation",
38
  description="Generate an image from input text using a Hugging Face model."
 
24
  model_name = gr.inputs.Dropdown(choices=model_list, label="Select Model", default=default_model)
25
 
26
  def generate_image(text, model_name):
27
+ model = gr.load(default_model, source="huggingface", api_key=api_key)
28
  return model.predict(text)
29
 
30
  input_text = gr.inputs.Textbox(label="Input Text")
 
32
 
33
  iface = gr.Interface(
34
  fn=generate_image,
35
+ inputs=[input_text, default_model],
36
  outputs=output_image,
37
  title="Text to Image Generation",
38
  description="Generate an image from input text using a Hugging Face model."