lopho's picture
Update app.py
cf3b64c verified
# (c) 2025 lopho <contact@lopho.org>
from typing import Literal
import gradio as gr
def gen(prompt: str = 'Hello.',
shift: float = 3.0,
boundary: float = 0.875,
shape: Literal['horizontal'] | Literal['vertical'] = 'horizontal',
sampler: Literal['dpm'] | Literal['unipc'] | Literal['euler'] = 'dpm'
) -> str:
print(type(prompt), prompt, type(shift), shift, type(boundary), boundary, type(shape), shape, type(sampler), sampler)
return str(prompt) + '\n' + str(shift) + '\n' + str(shape) + '\n' + str(sampler)
demo = gr.Interface(
fn = gen,
inputs = ['textbox'] \
+ ['number']*2 \
+ [ gr.Radio(choices = ['horizontal', 'vertical']) ] \
+ [ gr.Dropdown(choices = ['dpm', 'unipc', 'euler']) ],
#outputs = gr.Video(
# autoplay = True,
# loop = True
#),
outputs = 'textbox',
flagging_mode = 'never',
analytics_enabled = False,
cache_mode = 'lazy',
show_api = False,
fill_width = True
)
demo.launch()