Update app.py
Browse files
app.py
CHANGED
@@ -55,6 +55,18 @@ def generate_api(model_str, prompt, seed=1):
|
|
55 |
return result # Path to generated image
|
56 |
return None
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
# Launch Gradio API without frontend
|
59 |
iface = gr.Interface(fn=generate_api, inputs=["text", "text", "number"], outputs="file")
|
60 |
iface.launch(show_api=True, share=True)
|
|
|
55 |
return result # Path to generated image
|
56 |
return None
|
57 |
|
58 |
+
from gradio_client import Client
|
59 |
+
|
60 |
+
client = Client("Geek7/mdztxi2")
|
61 |
+
result = client.predict(
|
62 |
+
model_str=model_str,
|
63 |
+
prompt=prompt,
|
64 |
+
seed=seed,
|
65 |
+
api_name="/generate_api "
|
66 |
+
)
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
# Launch Gradio API without frontend
|
71 |
iface = gr.Interface(fn=generate_api, inputs=["text", "text", "number"], outputs="file")
|
72 |
iface.launch(show_api=True, share=True)
|