Update app.py
Browse files
app.py
CHANGED
@@ -494,7 +494,7 @@ def _init_kokoro() -> None:
|
|
494 |
)
|
495 |
|
496 |
|
497 |
-
def
|
498 |
text: Annotated[str, "The text to synthesize (English)."],
|
499 |
speed: Annotated[float, "Speech speed multiplier in 0.5–2.0; 1.0 = normal speed."] = 1.0,
|
500 |
voice: Annotated[str, "Voice identifier. Example: 'af_heart' (US English, female, Heart)."] = "af_heart",
|
@@ -646,7 +646,7 @@ CSS_STYLES = """
|
|
646 |
|
647 |
# --- Kokoro TTS tab (text to speech) ---
|
648 |
kokoro_interface = gr.Interface(
|
649 |
-
fn=
|
650 |
inputs=[
|
651 |
gr.Textbox(label="Text", placeholder="Type text to synthesize…", lines=4),
|
652 |
gr.Slider(minimum=0.5, maximum=2.0, value=1.0, step=0.1, label="Speed"),
|
@@ -671,7 +671,7 @@ kokoro_interface = gr.Interface(
|
|
671 |
HF_API_TOKEN = os.getenv("HF_READ_TOKEN")
|
672 |
|
673 |
|
674 |
-
def
|
675 |
prompt: Annotated[str, "Text description of the image to generate."],
|
676 |
model_id: Annotated[str, "Hugging Face model id in the form 'creator/model-name' (e.g., black-forest-labs/FLUX.1-Krea-dev)."] = "black-forest-labs/FLUX.1-Krea-dev",
|
677 |
negative_prompt: Annotated[str, "What should NOT appear in the image." ] = (
|
@@ -753,7 +753,7 @@ def Image_Generation( # <-- MCP tool #5 (Image Generation)
|
|
753 |
|
754 |
|
755 |
image_generation_interface = gr.Interface(
|
756 |
-
fn=
|
757 |
inputs=[
|
758 |
gr.Textbox(label="Prompt", placeholder="Enter a prompt", lines=2),
|
759 |
gr.Textbox(label="Model", value="black-forest-labs/FLUX.1-Krea-dev", placeholder="creator/model-name"),
|
|
|
494 |
)
|
495 |
|
496 |
|
497 |
+
def Generate_Speech( # <-- MCP tool #4 (Generate Speech)
|
498 |
text: Annotated[str, "The text to synthesize (English)."],
|
499 |
speed: Annotated[float, "Speech speed multiplier in 0.5–2.0; 1.0 = normal speed."] = 1.0,
|
500 |
voice: Annotated[str, "Voice identifier. Example: 'af_heart' (US English, female, Heart)."] = "af_heart",
|
|
|
646 |
|
647 |
# --- Kokoro TTS tab (text to speech) ---
|
648 |
kokoro_interface = gr.Interface(
|
649 |
+
fn=Generate_Speech,
|
650 |
inputs=[
|
651 |
gr.Textbox(label="Text", placeholder="Type text to synthesize…", lines=4),
|
652 |
gr.Slider(minimum=0.5, maximum=2.0, value=1.0, step=0.1, label="Speed"),
|
|
|
671 |
HF_API_TOKEN = os.getenv("HF_READ_TOKEN")
|
672 |
|
673 |
|
674 |
+
def Generate_Image( # <-- MCP tool #5 (Generate Image)
|
675 |
prompt: Annotated[str, "Text description of the image to generate."],
|
676 |
model_id: Annotated[str, "Hugging Face model id in the form 'creator/model-name' (e.g., black-forest-labs/FLUX.1-Krea-dev)."] = "black-forest-labs/FLUX.1-Krea-dev",
|
677 |
negative_prompt: Annotated[str, "What should NOT appear in the image." ] = (
|
|
|
753 |
|
754 |
|
755 |
image_generation_interface = gr.Interface(
|
756 |
+
fn=Generate_Image,
|
757 |
inputs=[
|
758 |
gr.Textbox(label="Prompt", placeholder="Enter a prompt", lines=2),
|
759 |
gr.Textbox(label="Model", value="black-forest-labs/FLUX.1-Krea-dev", placeholder="creator/model-name"),
|