Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
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,
|
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."
|