Kimilhee
파일 분리 리팩토링.
db315f2
"""
대교 AI 콘텐츠 이미지 월드컵 애플리케이션
이 애플리케이션은 사용자가 입력한 텍스트 기반으로 이미지를 생성하고,
생성된 이미지들로 월드컵 형식의 대결을 진행할 수 있는 인터페이스를 제공합니다.
"""
import gradio as gr
import os
from config import APP_TITLE, EXAMPLE_ENTRY_URLS
from ui import create_image_tab, create_worldcup_tab, CSS, theme
gr.set_static_paths(paths=["static/"])
def setup_demo():
"""
Gradio 인터페이스를 설정하는 함수
"""
with gr.Blocks(theme=theme, css=CSS) as demo:
# 상태 변수 초기화
gr.Markdown(APP_TITLE)
# 이미지 생성 탭 생성
entryImageUrls = create_image_tab()
# 월드컵 탭 생성
create_worldcup_tab(entryImageUrls)
return demo
# 애플리케이션을 시작할 때 사용하는 데모 인스턴스
demo = setup_demo()
if __name__ == "__main__":
demo.launch(
auth=("daekyo", os.environ.get("DEFAULT_PW")),
server_name="0.0.0.0",
ssr_mode=False,
)