MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / build_ui

Function build_ui

app/utils/ui_builder.py:404–441  ·  view source on GitHub ↗
(
    model_path,
    output_dir,
    run_inference,
    lang=DEFAULT_LANG,
)

Source from the content-addressed store, hash-verified

402
403
404def build_ui(
405 model_path,
406 output_dir,
407 run_inference,
408 lang=DEFAULT_LANG,
409):
410 # 在启动时加载 Hugging Face 模型列表缓存
411 logger.info(t("loading_models", lang))
412 from utils.model_utils import load_hf_models_cache
413
414 load_hf_models_cache()
415 logger.info(t("models_loaded", lang))
416
417 with gr.Blocks(title="Lightx2v (轻量级视频推理和生成引擎)") as demo:
418 gr.Markdown(f"# 🎬 LightX2V 图片/视频生成器")
419 gr.HTML(f"<style>{css}</style>")
420
421 # 使用 Tabs 分成两个页面
422 with gr.Tabs():
423 # 图片生成页面
424 with gr.Tab("🖼️ 图片生成"):
425 build_image_page(
426 model_path,
427 output_dir,
428 run_inference,
429 lang,
430 )
431 # 视频生成页面
432 with gr.Tab("🎬 视频生成"):
433 build_video_page(
434 model_path,
435 output_dir,
436 run_inference,
437 lang,
438 )
439
440 # 返回 demo 对象,由调用者负责 launch
441 return demo

Callers 1

mainFunction · 0.90

Calls 5

tFunction · 0.90
load_hf_models_cacheFunction · 0.90
build_image_pageFunction · 0.90
build_video_pageFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected