Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,44 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Pexels API ν€ μ€μ
|
5 |
PEXELS_API_KEY = "5woz23MGx1QrSY0WHFb0BRi29JvbXPu97Hg0xnklYgHUI8G0w23FKH62"
|
6 |
|
@@ -47,39 +85,6 @@ if selected_menu == "Free Stock" and st.session_state['current_sub_menu'] == "Se
|
|
47 |
|
48 |
|
49 |
|
50 |
-
# νμ΄μ§ μ€μ
|
51 |
-
st.set_page_config(page_title="ViDraft", layout="wide")
|
52 |
-
|
53 |
-
# μ¬μ΄λλ° νμ΄ν μ€μ
|
54 |
-
st.sidebar.title("ViDraft")
|
55 |
-
|
56 |
-
# λ©λ΄ λ° νμ λ©λ΄ μ μ
|
57 |
-
menus = {
|
58 |
-
"Home": [],
|
59 |
-
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
60 |
-
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
61 |
-
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
62 |
-
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Image SFX", "Image Music"],
|
63 |
-
"Scripts": []
|
64 |
-
}
|
65 |
-
|
66 |
-
# μΈμ
μν μ΄κΈ°ν
|
67 |
-
if 'current_menu' not in st.session_state:
|
68 |
-
st.session_state['current_menu'] = 'Home'
|
69 |
-
if 'current_sub_menu' not in st.session_state:
|
70 |
-
st.session_state['current_sub_menu'] = ''
|
71 |
-
|
72 |
-
# λ©μΈ λ©λ΄ μ ν
|
73 |
-
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
|
74 |
-
st.session_state['current_menu'] = selected_menu
|
75 |
-
|
76 |
-
# νμ λ©λ΄ μ ν (ν΄λΉλλ κ²½μ°)
|
77 |
-
if selected_menu in menus:
|
78 |
-
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + menus[selected_menu])
|
79 |
-
st.session_state['current_sub_menu'] = selected_sub_menu
|
80 |
-
else:
|
81 |
-
st.session_state['current_sub_menu'] = ''
|
82 |
-
|
83 |
# 'Home' νμ΄μ§ νμ
|
84 |
if selected_menu == "Home":
|
85 |
st.header("Welcome to ViDraft")
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
|
4 |
+
|
5 |
+
# νμ΄μ§ μ€μ
|
6 |
+
st.set_page_config(page_title="ViDraft", layout="wide")
|
7 |
+
|
8 |
+
# μ¬μ΄λλ° νμ΄ν μ€μ
|
9 |
+
st.sidebar.title("ViDraft")
|
10 |
+
|
11 |
+
# λ©λ΄ λ° νμ λ©λ΄ μ μ
|
12 |
+
menus = {
|
13 |
+
"Home": [],
|
14 |
+
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
15 |
+
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
16 |
+
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
17 |
+
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Image SFX", "Image Music"],
|
18 |
+
"Scripts": []
|
19 |
+
}
|
20 |
+
|
21 |
+
# μΈμ
μν μ΄κΈ°ν
|
22 |
+
if 'current_menu' not in st.session_state:
|
23 |
+
st.session_state['current_menu'] = 'Home'
|
24 |
+
if 'current_sub_menu' not in st.session_state:
|
25 |
+
st.session_state['current_sub_menu'] = ''
|
26 |
+
|
27 |
+
# λ©μΈ λ©λ΄ μ ν
|
28 |
+
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
|
29 |
+
st.session_state['current_menu'] = selected_menu
|
30 |
+
|
31 |
+
# μ¬κΈ°μμ `selected_menu` λ³μκ° μ΄λ―Έ μ μλμμ΅λλ€. μ΄μ νμ λ©λ΄ μ ν μ΄ν μ¬μ©μ΄ μμλ©λλ€.
|
32 |
+
|
33 |
+
# νμ λ©λ΄ μ ν (ν΄λΉλλ κ²½μ°)
|
34 |
+
if selected_menu in menus:
|
35 |
+
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + menus[selected_menu])
|
36 |
+
st.session_state['current_sub_menu'] = selected_sub_menu
|
37 |
+
else:
|
38 |
+
st.session_state['current_sub_menu'] = ''
|
39 |
+
|
40 |
+
# μ¬κΈ°μλΆν° `selected_menu` λ³μλ₯Ό κΈ°λ°μΌλ‘ 쑰건문μ μ¬μ©νλ λλ¨Έμ§ μ½λκ° μ¬λ°λ₯΄κ² μλν κ²μ
λλ€.
|
41 |
+
|
42 |
# Pexels API ν€ μ€μ
|
43 |
PEXELS_API_KEY = "5woz23MGx1QrSY0WHFb0BRi29JvbXPu97Hg0xnklYgHUI8G0w23FKH62"
|
44 |
|
|
|
85 |
|
86 |
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
# 'Home' νμ΄μ§ νμ
|
89 |
if selected_menu == "Home":
|
90 |
st.header("Welcome to ViDraft")
|