fix login
Browse files
app.py
CHANGED
|
@@ -5,8 +5,10 @@ import gradio as gr
|
|
| 5 |
import numpy as np
|
| 6 |
import requests
|
| 7 |
from dotenv import load_dotenv
|
|
|
|
| 8 |
from huggingface_hub import InferenceClient
|
| 9 |
|
|
|
|
| 10 |
load_dotenv()
|
| 11 |
|
| 12 |
MAX_SEED = np.iinfo(np.int32).max
|
|
@@ -88,6 +90,7 @@ css = """
|
|
| 88 |
"""
|
| 89 |
|
| 90 |
with gr.Blocks(css=css) as demo:
|
|
|
|
| 91 |
with gr.Sidebar():
|
| 92 |
gr.Markdown("# Inference Provider")
|
| 93 |
gr.Markdown(
|
|
@@ -95,7 +98,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 95 |
)
|
| 96 |
button = gr.LoginButton("Sign in")
|
| 97 |
button.click(fn=login, inputs=[], outputs=[])
|
| 98 |
-
demo.load(login, inputs=None, outputs=None)
|
| 99 |
with gr.Column(elem_id="col-container"):
|
| 100 |
gr.Markdown(
|
| 101 |
"""# FLUX.1 [schnell] with fal‑ai through HF Inference Providers ⚡\nLearn more about HF Inference Providers [here](https://huggingface.co/docs/inference-providers/index)"""
|
|
@@ -156,14 +158,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 156 |
examples=examples,
|
| 157 |
fn=generate,
|
| 158 |
inputs=[prompt],
|
| 159 |
-
outputs=[result, seed_number
|
| 160 |
cache_examples="lazy",
|
| 161 |
)
|
| 162 |
|
| 163 |
run_button.click(
|
| 164 |
fn=generate,
|
| 165 |
inputs=[prompt, seed_slider, width_slider, height_slider, steps_slider],
|
| 166 |
-
outputs=[result, seed_number
|
| 167 |
show_api=True, # expose as MCP tool
|
| 168 |
)
|
| 169 |
|
|
|
|
| 5 |
import numpy as np
|
| 6 |
import requests
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
+
|
| 9 |
from huggingface_hub import InferenceClient
|
| 10 |
|
| 11 |
+
|
| 12 |
load_dotenv()
|
| 13 |
|
| 14 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 90 |
"""
|
| 91 |
|
| 92 |
with gr.Blocks(css=css) as demo:
|
| 93 |
+
demo.load(login, inputs=None, outputs=None)
|
| 94 |
with gr.Sidebar():
|
| 95 |
gr.Markdown("# Inference Provider")
|
| 96 |
gr.Markdown(
|
|
|
|
| 98 |
)
|
| 99 |
button = gr.LoginButton("Sign in")
|
| 100 |
button.click(fn=login, inputs=[], outputs=[])
|
|
|
|
| 101 |
with gr.Column(elem_id="col-container"):
|
| 102 |
gr.Markdown(
|
| 103 |
"""# FLUX.1 [schnell] with fal‑ai through HF Inference Providers ⚡\nLearn more about HF Inference Providers [here](https://huggingface.co/docs/inference-providers/index)"""
|
|
|
|
| 158 |
examples=examples,
|
| 159 |
fn=generate,
|
| 160 |
inputs=[prompt],
|
| 161 |
+
outputs=[result, seed_number],
|
| 162 |
cache_examples="lazy",
|
| 163 |
)
|
| 164 |
|
| 165 |
run_button.click(
|
| 166 |
fn=generate,
|
| 167 |
inputs=[prompt, seed_slider, width_slider, height_slider, steps_slider],
|
| 168 |
+
outputs=[result, seed_number],
|
| 169 |
show_api=True, # expose as MCP tool
|
| 170 |
)
|
| 171 |
|