import gradio as gr from dotenv import load_dotenv import PIL from brandsmith import run as brand_smith_run import asyncio load_dotenv(override=True) async def run(logo_img: PIL.Image, company_name: str): results = [] async for result in brand_smith_run(logo_img, company_name): results.append(result) yield results demo = gr.Interface( fn=run, inputs=[gr.Image(type="pil", height=512, image_mode="RGBA"), gr.Textbox(label="Company Name")], outputs=[gr.Image(label="Palette", height=256), gr.Image(label="Output Image", height=256)], title="Brand-Smith", description="Upload your logo and let Brand-Smith generate a color palette and a new template for your digital signature!", examples=[ ["images/starbucks-logo.png", "Starbucks"], ["images/nasa-logo.png", "NASA"], ["images/playstation-logo.png", "Playstation"], ["images/shell-logo.png", "Shell"], ["images/underground-logo.png", "Underground"] ] ) demo.launch(share=False)