Spaces:
Sleeping
Sleeping
import gradio as gr | |
# Example import in your app.py | |
from text_to_image import ov_pipe | |
def generate_from_text(text, seed, num_steps, _=gr.Progress(track_tqdm=True)): | |
result = ov_pipe(text, num_inference_steps=num_steps, seed=seed) | |
return result["sample"][0] | |
with gr.Blocks() as demo: | |
with gr.Tab("Text-to-Image generation"): | |
with gr.Row(): | |
with gr.Column(): | |
text_input = gr.Textbox(lines=3, label="Text") | |
seed_input = gr.Slider(0, 10000000, value=42, label="Seed") | |
steps_input = gr.Slider(1, 50, value=20, step=1, label="Steps") | |
out = gr.Image(label="Result", type="pil") | |
btn = gr.Button() | |
btn.click(generate_from_text, [text_input, seed_input, steps_input], out) | |
# Remove the "Image-to-Image generation" tab and its content | |
try: | |
demo.launch(debug=True,inline=False) | |
except Exception: | |
demo.launch(share=True, debug=True,inline=False) | |