File size: 1,026 Bytes
c9f5fa7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3dfdc45
 
c9f5fa7
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)