import gradio as gr
from synthscope import GoogleSearchImageGen
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.red, secondary_hue=gr.themes.colors.pink),
css="footer {display: none !important;}") as app:
gr.HTML("
🌐 SynthScope 🎨
")
with gr.Column():
with gr.Row():
with gr.Column(scale=1):
gr.Markdown("Google Search Result
")
text_output = gr.Markdown(height=300)
with gr.Column(scale=1):
gr.Markdown("Search Result Image
")
image_output = gr.Image(label="", show_label=False,height=300)
with gr.Column():
with gr.Row():
text_input = gr.Textbox(label="Query Field", placeholder="Type in your search query")
radio_input = gr.Radio(label="Select Search Result Image Style", choices=["Comic", "Cartoon", "3D", "Anime", "Ghibli", "Victorian"])
with gr.Row():
btn = gr.Button("Run SynthScope")
clear_btn = gr.ClearButton([text_input, radio_input, text_output, image_output], value="Clear")
btn.click(fn=GoogleSearchImageGen, inputs=[text_input, radio_input], outputs=[text_output, image_output])
if __name__ == "__main__":
app.launch()