image_generator / app.py
Sakil's picture
Update app.py
2f2cf44
raw
history blame contribute delete
714 Bytes
import os
# os.system('pip install gradio==2.8.0b22')
import gradio as gr
clip = gr.Interface.load("spaces/DrishtiSharma/Text-to-Image-search-using-CLIP")
def text2image(text):
image = clip(text)[0]
return gr.processing_utils.decode_base64_to_image(image)
iface = gr.Interface(
text2image,inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your text here"),
outputs="image",
examples=[["cat"],["Lion"],["Nature"],["water"],["house"]],
theme="dark-peach",
#css="https://www.w3schools.com/cssref/playit.asp?filename=playcss_background-color",
title='Image Generator',
description="This application supports in the creation of images from your text.")
iface.launch(inline=False)