import gradio as ui; from datetime import datetime; import logging # enable debug logging.basicConfig(level=logging.DEBUG) # global theme theme = ui.themes.Default( font=[ui.themes.GoogleFont('Roboto Condensed'), 'Arial'], text_size=ui.themes.Size(lg="16px", md="16px", sm="16px", xl="16px", xs="16px", xxl="16px", xxs="16px"), primary_hue='rose', secondary_hue='rose', neutral_hue='zinc', radius_size=ui.themes.sizes.radius_none) css = ''' footer { display: none !important; } div.svelte-vt1mxs>*, div.svelte-vt1mxs>.form > * { border: none; } .app.svelte-182fdeq.svelte-182fdeq { padding: 0px !important; } .grid-wrap.svelte-hpz95u.svelte-hpz95u { overflow-y: auto !important; } .selected.svelte-1uw5tnk { background: #262629 !important; } .closed.svelte-g7pfx4>button.svelte-g7pfx4 { display: none !important; } gradio-app { background: none !important; } input.svelte-1f354aw.svelte-1f354aw, textarea.svelte-1f354aw.svelte-1f354aw { text-align: justify !important; } ''' # global locale - english success = 'That worked successfully!' single_error = 'That did not work!' quads_error = 'Some images cannot be processed!' empty_error = 'Prompt field cannot be empty!' 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 a person, place or anything!' spholder1 = 'Elements to add into the image!' spholder2 = 'Things to get rid of!' spholder3 = 'Put wonders into 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:' # 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'