|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from types import SimpleNamespace |
|
import gradio as gr |
|
from .defaults import get_gradio_html |
|
from .gradio_funcs import change_css, handle_change_functions |
|
from .args import DeforumArgs, DeforumAnimArgs, ParseqArgs, DeforumOutputArgs, RootArgs, LoopArgs |
|
from .deforum_controlnet import setup_controlnet_ui |
|
from .ui_elements import get_tab_run, get_tab_keyframes, get_tab_prompts, get_tab_init, get_tab_hybrid, get_tab_output |
|
|
|
def set_arg_lists(): |
|
|
|
d = SimpleNamespace(**DeforumArgs()) |
|
da = SimpleNamespace(**DeforumAnimArgs()) |
|
dp = SimpleNamespace(**ParseqArgs()) |
|
dv = SimpleNamespace(**DeforumOutputArgs()) |
|
dr = SimpleNamespace(**RootArgs()) |
|
dloopArgs = SimpleNamespace(**LoopArgs()) |
|
return d, da, dp, dv, dr, dloopArgs |
|
|
|
def setup_deforum_left_side_ui(): |
|
d, da, dp, dv, dr, dloopArgs = set_arg_lists() |
|
|
|
with gr.Accordion("Info, Links and Help", open=False, elem_id='main_top_info_accord'): |
|
gr.HTML(value=get_gradio_html('main')) |
|
|
|
with gr.Row(variant='compact'): |
|
show_info_on_ui = gr.Checkbox(label="Show more info", value=d.show_info_on_ui, interactive=True) |
|
with gr.Blocks(): |
|
with gr.Tabs(): |
|
|
|
tab_run_params = get_tab_run(d, da) |
|
tab_keyframes_params = get_tab_keyframes(d, da, dloopArgs) |
|
tab_prompts_params = get_tab_prompts(da) |
|
tab_init_params = get_tab_init(d, da, dp) |
|
controlnet_dict = setup_controlnet_ui() |
|
tab_hybrid_params = get_tab_hybrid(da) |
|
tab_output_params = get_tab_output(da, dv) |
|
|
|
for key, value in {**tab_run_params, **tab_keyframes_params, **tab_prompts_params, **tab_init_params, **controlnet_dict, **tab_hybrid_params, **tab_output_params}.items(): |
|
locals()[key] = value |
|
|
|
|
|
show_info_on_ui.change(fn=change_css, inputs=show_info_on_ui, outputs=gr.outputs.HTML()) |
|
handle_change_functions(locals()) |
|
|
|
return locals() |
|
|