Spaces:
Build error
Build error
File size: 2,262 Bytes
0a83ae5 |
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
import gradio as ui; from datetime import datetime; import logging
# enable debug
logging.basicConfig(level=logging.DEBUG)
# global theme
theme = ui.themes.Base(
font=[ui.themes.GoogleFont('Segoe UI'), 'system-ui', 'sans-serif'],
text_size=ui.themes.Size(lg="15px", md="15px", sm="15px", xl="15px", xs="15px", xxl="15px", xxs="15px"),
primary_hue='rose', secondary_hue='rose', neutral_hue='zinc'); css = "footer {visibility: hidden};"
# global locale - english
success = 'That worked successfully!'
single_error = 'That did not work. Please check and try again.'
quads_error = 'Some images cannot be processed. Please check and try again.'
received = 'Request Received'
timed = 'Request Timeout'
rejected = 'Request Error/Rejected'
complete = 'Request Completed'
liability = 'STELLA can make mistakes and inaccuracies.'
rights = '© 2023-2024 Ikmal Said. All rights reserved.'
spholder = 'Imagine your favorite person, places or anything!'
spholder1 = 'Elements to add into the image!'
spholder2 = 'Things to get rid of!'
spholder3 = 'Sprinkle some wonders to the generated prompt!'
sprompt = 'Generate images of:'
sprompt1 = 'Based on image, create:'
smodel = 'Using the AI model:'
smode = 'Using the mode:'
sratio = 'In the size of:'
sstyle = 'Inspired by the style of:'
squality = 'At a quality level of:'
snumber = 'With a quantity of:'
ssource = 'Source'
sresult = 'Result'
sresults = 'Results'
# global function
def timestamp(): return f"[{datetime.now().strftime('%d/%m/%y at %H:%M:%S')}]"
def receive(): return f"{timestamp()} \U0001F680 {received}"
def timeout(): return f"{timestamp()} \U000023F0 {timed}"
def reject(): return f"{timestamp()} \U0000274C {rejected}"
def done(): return f"{timestamp()} \U0001F618 {complete}"
def header(feature): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 5px">{feature}</h4></center>')
def footer(): ui.HTML(f'<center><h4 style="font-size: 1em; margin: 5px 0px 0px">{liability}<br></h4>{rights}</center>')
def title(feature): return f"{feature}" |