streamlit4c / app.py
seawolf2357's picture
Update app.py
edfc9c4 verified
raw
history blame
5.6 kB
import streamlit as st
# νŽ˜μ΄μ§€ μ„€μ •
st.set_page_config(page_title="ViDraft", layout="wide")
# μ‚¬μ΄λ“œλ°” 타이틀 μ„€μ • 및 메뉴 μ •μ˜
st.sidebar.title("ViDraft")
menu = ["Home", "Free Stock", "Image", "Video", "Sound", "Scripts"]
sub_menus = {
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
}
# μ„Έμ…˜ μƒνƒœ μ΄ˆκΈ°ν™”
if 'current_menu' not in st.session_state:
st.session_state['current_menu'] = 'Home'
if 'current_sub_menu' not in st.session_state:
st.session_state['current_sub_menu'] = ''
# 메인 메뉴 선택
selected_menu = st.sidebar.selectbox("Menu", menu)
st.session_state['current_menu'] = selected_menu
# ν•˜μœ„ 메뉴 선택 (ν•΄λ‹Ήλ˜λŠ” 경우)
if selected_menu in sub_menus:
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + sub_menus[selected_menu])
st.session_state['current_sub_menu'] = selected_sub_menu
else:
st.session_state['current_sub_menu'] = ''
# 'Home' νŽ˜μ΄μ§€ ν‘œμ‹œ
if selected_menu == "Home":
st.header("Welcome to ViDraft")
st.write("Choose an option from the sidebar to get started.")
# 'Free Stock' 메뉴 ν‘œμ‹œ
elif selected_menu == "Free Stock":
if st.session_state['current_sub_menu'] == "Template Video":
st.header("Template Videos")
st.write("Explore a variety of video templates.")
# λΉ„λ””μ˜€ 파일 경둜 μ„€μ • 및 λΉ„λ””μ˜€ ν‘œμ‹œ 둜직
video_files = ["ex1.mp4", "ex2.mp4", "ex3.mp4", "ex4.mp4", "ex5.mp4", "ex6.mp4", "ex7.mp4", "ex8.mp4", "ex9.mp4", "ex10.mp4", "ex11.mp4", "ex12.mp4", "ex13.mp4", "ex14.mp4", "ex15.mp4", "ex16.mp4", "ex17.mp4", "ex18.mp4"]
# 가러리 ν˜•νƒœλ‘œ λΉ„λ””μ˜€ ν‘œμ‹œ
cols = st.columns(2) # 2개의 μ—΄λ‘œ λ„“κ²Œ 배치
for index, video_file in enumerate(video_files):
with cols[index % 2]:
st.video(video_file)
elif st.session_state['current_sub_menu'] == "Template Image":
st.header("Template Images")
st.write("Find the perfect image template for your project.")
elif st.session_state['current_sub_menu'] == "Search Video":
st.header("Search Videos")
st.write("Search through our extensive video library to find exactly what you need.")
elif st.session_state['current_sub_menu'] == "Search Image":
st.header("Search Images")
st.write("Discover images that fit your project's needs with our powerful search tool.")
# 'Image' 메뉴 ν‘œμ‹œ
elif selected_menu == "Image":
if st.session_state['current_sub_menu'] == "Generation":
st.header("Image Generation")
st.write("Generate images using AI.")
elif st.session_state['current_sub_menu'] == "Face ID":
st.header("Face ID")
st.write("Identify and analyze faces in images.")
elif st.session_state['current_sub_menu'] == "Inpainting":
st.header("Inpainting")
st.write("Fill in missing parts of images.")
elif st.session_state['current_sub_menu'] == "Remove Background":
st.header("Remove Background")
st.write("Easily remove backgrounds from images.")
elif st.session_state['current_sub_menu'] == "Studio":
st.header("Image Studio")
st.write("Access a suite of image editing tools.")
# 'Video' 메뉴 ν‘œμ‹œ
elif selected_menu == "Video":
if st.session_state['current_sub_menu'] == "Generation":
st.header("Video Generation")
st.write("Create videos with our generation tools.")
elif st.session_state['current_sub_menu'] == "Talking Face":
st.header("Talking Face Videos")
st.write("Generate talking face videos from images.")
elif st.session_state['current_sub_menu'] == "Remove Background":
st.header("Video Background Removal")
st.write("Remove backgrounds from your videos effortlessly.")
elif st.session_state['current_sub_menu'] == "Studio":
st.header("Video Studio")
st.write("Explore our video editing studio for advanced editing.")
# 'Sound' 메뉴 ν‘œμ‹œ
elif selected_menu == "Sound":
if st.session_state['current_sub_menu'] == "Video SFX":
st.header("Video Sound Effects")
st.write("Enhance your videos with sound effects.")
elif st.session_state['current_sub_menu'] == "Video Music":
st.header("Video Music")
st.write("Find the perfect music for your video content.")
elif st.session_state['current_sub_menu'] == "TTS(Voice)":
st.header("Text-to-Speech")
st.write("Convert your text into natural-sounding voice.")
elif st.session_state['current_sub_menu'] == "Voice Clone":
st.header("Voice Cloning")
st.write("Clone any voice for your projects.")
elif st.session_state['current_sub_menu'] == "Image SFX":
st.header("Image Sound Effects")
st.write("Add sound effects to your images.")
elif st.session_state['current_sub_menu'] == "Image Music":
st.header("Image Music")
st.write("Associate music tracks with your images.")
# 'Scripts' λ©”λ‰΄λŠ” ν•˜μœ„ 메뉴가 μ—†μœΌλ―€λ‘œ 직접 처리
elif selected_menu == "Scripts":
st.header("Scripts")
st.write("Script writing tools and resources.")
# 이 ꡬ쑰λ₯Ό μ‚¬μš©ν•˜μ—¬ λ‹€λ₯Έ 메뉴 및 ν•˜μœ„ 메뉴에 λŒ€ν•œ μ½˜ν…μΈ λ₯Ό μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.