| import streamlit as st |
|
|
| |
| css = """ |
| body { |
| background-color: #000000; |
| color: #FFFFFF; |
| } |
| .main { |
| background-color: #000000; |
| } |
| .main .block-container { |
| padding: 0rem; |
| background-color: #000000; |
| } |
| .sidebar .sidebar-content { |
| background-color: #050505 !important; |
| padding: 0.5rem 0 0 0; |
| } |
| header, #MainMenu, footer {visibility: hidden;} |
| .category-button { |
| background-color: #0A0A0A; |
| color: #FFFFFF; |
| border: none; |
| text-align: left; |
| font-size: 0.77rem; |
| font-weight: bold; |
| padding: 10px 10px 10px 15px; |
| width: 100%; |
| margin: 0; |
| transition: background-color 0.3s; |
| } |
| .category-button:hover { |
| background-color: #0F0F0F; |
| } |
| .category-button:focus { |
| outline: none; |
| } |
| .selected-category { |
| background-color: #151515 !important; |
| color: #FFFFFF !important; |
| } |
| .submenu-button { |
| background-color: #0C0C0C; |
| color: #FFFFFF; |
| border: none; |
| text-align: left; |
| font-size: 0.7rem; |
| padding: 6px 6px 6px 25px; |
| width: 100%; |
| margin: 0; |
| transition: background-color 0.3s; |
| } |
| .submenu-button:hover { |
| background-color: #111111; |
| } |
| .submenu-button:focus { |
| outline: none; |
| } |
| .selected-submenu { |
| background-color: #181818 !important; |
| color: #FFFFFF !important; |
| font-weight: bold; |
| } |
| .sidebar .sidebar-content { |
| width: 100%; |
| margin-left: 0; |
| } |
| """ |
|
|
| |
| st.set_page_config( |
| layout="wide", |
| page_title="Web UI", |
| page_icon=":ghost:", |
| initial_sidebar_state="expanded" |
| ) |
|
|
| |
| st.markdown(f"<style>{css}</style>", unsafe_allow_html=True) |
|
|
| |
| menu_structure = { |
| "๋ฒ ์คํธ TOP 10": ["FLUX LoRA ์คํ๋์ค", "[์์น+VisionLLM] ํ๊ตญ์ด JinJavis","FLUX ํ์ฅ ์ด๋ฏธ์ง ์์ฑ","์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์ด๋ฏธ์ง ๋ณํ","LOGO ๋์์ธ ์์ฑ","FLUX GIF ์์ฑ","์ด๋ฏธ์ง์ ํ๋กฌํํธ๋ก ์์ ์์ฑ","ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ","์ํ ์ฌ์ง ์
๋ก๋+ํ๋กฌํํธ๋ก ๋ฐฐ๊ฒฝ์ ํฉ์ฑ","EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์"], |
| "FLUXLoRA์คํ๋์ค ์คํ์
": ["FLUXLoRA์คํ๋์ค ์๋ฒ#1", "FLUXLoRA์คํ๋์ค ์๋ฒ#2", "FLUXLoRA์คํ๋์ค ์๋ฒ#3", "FLUXLoRA์คํ๋์ค ์๋ฒ#4"], |
| "FLUX ์คํ์
": ["FLUX LoRA ์คํ๋์ค", "FLUX ํ์ฅ ์ด๋ฏธ์ง ์์ฑ", "FLUX GIF ์์ฑ", "LOGO ๋์์ธ ์์ฑ","FLUX ํ๋กฌํํธ ์์ฑ", "FLUX LoRA: ๊ธฐ๋ธ๋ฆฌ ์คํ์ผ","FLUX LoRA: ์นดํฐ ์คํ์ผ", "FLUX 8step LoRA ์ด๋ฏธ์ง ์์ฑ","FLUX ํ
์คํธ TO ๋น๋์ค ์์ฑ","FLUX ํจ์
๋ชจ๋ธ ์์ฑ", "FLUX Controlnet", "FLUX NF4 ์ด๋ฏธ์ง ์์ฑ"], |
| "์ด๋ฏธ์ง/์์ ์์ฑ": ["์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ I","์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ II","์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์ด๋ฏธ์ง ๋ณํ","์ํ ์ฌ์ง ์
๋ก๋+ํ๋กฌํํธ๋ก ๋ฐฐ๊ฒฝ์ ํฉ์ฑ","ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Accracy ๋ชจ๋ธ","ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Playground ๋ชจ๋ธ","ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: AuraFlow ๋ชจ๋ธ", "EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์", "๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ I","๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ II","๊ณ ํด์๋ ์ด๋ฏธ์ง ์์ฑ REALVISXL V5"], |
| "๋ฉํฐ๋ชจ๋ฌ": ["ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ","๋น๋์ค ์ธ์ QnA ์ฑ๋ด","์ด๋ฏธ์ง ์ค์ผ์ผ์
(ํ์ง๊ฐ์ )","์ด๋ฏธ์ง ๋ฐฐ๊ฒฝ ์ ๊ฑฐ","๋น๋์ค ๋ฐฐ๊ฒฝ ์ ๊ฑฐ","ํ
์คํธ ์
๋ ฅ์ผ๋ก ์์
์์ฑ" ], |
| "LLM(๋น๊ต ์ฒดํ)": ["[์์น+VisionLLM] ํ๊ตญ์ด JinJavis","MS PHI 3.5 Vision","NSFW kAI","๋ฉํ LLAMA 3.1 405B","๋ฉํ LLAMA 3.1 70B","๋ฉํ LLAMA 3.1 8B","๋ฏธ์คํธ๋ 7B Instruct v0.3","MS Phi 3 mini 4k-instruct","์ค๊ตญ Yi 1.5 34B", "๋ฏธ์คํธ๋ Mixtral 8X7B ","๋ฏธ์คํธ๋ Nemo Instruct 2407" ], |
| "์ ๋ฌธ๊ฐ ๋ชจ๋ธ": ["์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ","์ํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ","์ฝ๋ฆฌํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ"], |
| "๋ง์ผํ
์คํ์
": ["๋ธ๋ก๊ทธ ์๋(์ปจํ/๋จ์) ์์ฑ","๋ธ๋ก๊ทธ ์๋(๋ฌด์ธ/๋ณต์) ์์ฑ" ], |
| "[๊ด๋ฆฌ ๋ชจ๋ํฐ๋ง]": ["24X7 ๋ชจ๋ํฐ๋ง"] |
| } |
|
|
| |
| if 'expanded_category' not in st.session_state: |
| st.session_state.expanded_category = None |
| if 'selected_item' not in st.session_state: |
| st.session_state.selected_item = None |
|
|
| |
| def toggle_category(category): |
| if st.session_state.expanded_category == category: |
| st.session_state.expanded_category = None |
| else: |
| st.session_state.expanded_category = category |
|
|
| def select_item(item): |
| st.session_state.selected_item = item |
|
|
| |
| st.sidebar.markdown('<h1 style="font-size: 1.4rem; margin-left: 15px;">๋ฉ๋ด</h1>', unsafe_allow_html=True) |
|
|
| for category, items in menu_structure.items(): |
| is_expanded = st.session_state.expanded_category == category |
| category_label = f"{'โผ' if is_expanded else 'โถ'} {category}" |
| if st.sidebar.button(category_label, key=f"category_{category}", on_click=toggle_category, args=(category,)): |
| pass |
| |
| if is_expanded: |
| for item in items: |
| is_selected = st.session_state.selected_item == item |
| if st.sidebar.button(item, key=f"submenu_{item}", on_click=select_item, args=(item,)): |
| pass |
|
|
| |
| main_content = st.empty() |
|
|
| |
| content_map = { |
| "FLUX LoRA ์คํ๋์ค": "https://ginipick-flxloraexp.hf.space", |
| "[์์น+VisionLLM] ํ๊ตญ์ด JinJavis": "https://fantos-jinjavis.hf.space", |
| "FLUX ํ์ฅ ์ด๋ฏธ์ง ์์ฑ": "https://fantaxy-ofai-flx-expl-store.hf.space", |
| "์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์ด๋ฏธ์ง ๋ณํ": "https://fantos-kolcontrl.hf.space", |
| "LOGO ๋์์ธ ์์ฑ": "https://fantaxy-ofai-flx-logo.hf.space", |
| "FLUX GIF ์์ฑ": "https://aiqtech-flxgif.hf.space", |
| "์ด๋ฏธ์ง์ ํ๋กฌํํธ๋ก ์์ ์์ฑ": "https://fantaxy-ofai-it2v2.hf.space", |
| "ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ": "https://fantos-textcutobject.hf.space", |
| "์ํ ์ฌ์ง ์
๋ก๋+ํ๋กฌํํธ๋ก ๋ฐฐ๊ฒฝ์ ํฉ์ฑ": "https://aiqtech-producbrmg.hf.space", |
| "EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์": "https://fantos-EveryText.hf.space", |
|
|
| "FLUXLoRA์คํ๋์ค ์๋ฒ#1": "https://seawolf2357-flxloraexp.hf.space", |
| "FLUXLoRA์คํ๋์ค ์๋ฒ#2": "https://fantaxy-flxloraexp.hf.space", |
| "FLUXLoRA์คํ๋์ค ์๋ฒ#3": "https://fantos-flxloraexp.hf.space", |
| "FLUXLoRA์คํ๋์ค ์๋ฒ#4": "https://ginipick-flxloraexp.hf.space", |
| |
| "FLUX LoRA ์คํ๋์ค": "https://fantos-flxloraexp.hf.space", |
| "FLUX ํ์ฅ ์ด๋ฏธ์ง ์์ฑ": "https://fantaxy-ofai-flx-expl-store.hf.space", |
| "FLUX GIF ์์ฑ": "https://aiqtech-flxgif.hf.space", |
| "LOGO ๋์์ธ ์์ฑ": "https://fantaxy-ofai-flx-logo.hf.space", |
| "FLUX ํ๋กฌํํธ ์์ฑ": "https://ginipick-flux-prompt-generator.hf.space", |
| "FLUX LoRA: ๊ธฐ๋ธ๋ฆฌ ์คํ์ผ": "https://aiqtech-flux-ghibli-studio-lora.hf.space", |
| "FLUX LoRA: ์นดํฐ ์คํ์ผ": "https://aiqtech-flxani.hf.space", |
| "FLUX 8step LoRA ์ด๋ฏธ์ง ์์ฑ": "https://fantos-flx8lora.hf.space", |
| "FLUX ํ
์คํธ TO ๋น๋์ค ์์ฑ": "https://fantos-cogvidx.hf.space", |
| "FLUX ํจ์
๋ชจ๋ธ ์์ฑ": "https://fantos-flxfashmodel.hf.space", |
| "FLUX Controlnet": "https://fantos-flxcontrol.hf.space", |
| "FLUX NF4 ์ด๋ฏธ์ง ์์ฑ": "https://ginipick-ofai-flxnf4.hf.space", |
|
|
| "์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ I": "https://fantaxy-ofai-it2v2.hf.space", |
| "์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์์ ์์ฑ II": "https://aiqtech-cinevid.hf.space", |
| "์ด๋ฏธ์ง์ ํ๊ธ ํ๋กฌํํธ๋ก ์ด๋ฏธ์ง ๋ณํ": "https://fantos-kolcontrl.hf.space", |
| "์ํ ์ฌ์ง ์
๋ก๋+ํ๋กฌํํธ๋ก ๋ฐฐ๊ฒฝ์ ํฉ์ฑ": "https://aiqtech-producbrmg.hf.space", |
| "ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Accracy ๋ชจ๋ธ": "https://ginipick-accdiffusion.hf.space", |
| "ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: Playground ๋ชจ๋ธ": "https://fantaxy-playground25.hf.space", |
| "ํ
์คํธ๋ก ์ด๋ฏธ์ง ์์ฑ: AuraFlow ๋ชจ๋ธ": "https://fantaxy-auroflow-v3.hf.space", |
| "EveryText: ๋ชจ๋ ๋ฌธ์๊ฐ ์ด๋ฏธ์ง ์์ฑ์ ๋ฐ์": "https://fantos-EveryText.hf.space", |
| "๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ I": "https://aiqtech-kofaceid.hf.space", |
| "๋ด ์ผ๊ตด ์ฌ์ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ II": "https://aiqtech-sdfacid.hf.space", |
| "๊ณ ํด์๋ ์ด๋ฏธ์ง ์์ฑ REALVISXL V5": "https://seawolf2357-REALVISXL-V5.hf.space", |
| |
| "ํ
์คํธ๋ก ๊ฐ์ฒด๋ง ์๋ผ๋ด๊ณ ๋ฐฐ๊ฒฝ ํฌ๋ช
ํ": "https://fantos-textcutobject.hf.space", |
| "๋น๋์ค ์ธ์ QnA ์ฑ๋ด": "https://ginipick-vidiqa.hf.space", |
| "์ด๋ฏธ์ง ์ค์ผ์ผ์
(ํ์ง๊ฐ์ )": "https://ginipick-finegrain-image-enhancer.hf.space", |
| "์ด๋ฏธ์ง ๋ฐฐ๊ฒฝ ์ ๊ฑฐ": "https://ginipick-background-removal.hf.space", |
| "๋น๋์ค ๋ฐฐ๊ฒฝ ์ ๊ฑฐ": "https://fantaxy-remove-video-background.hf.space", |
| "ํ
์คํธ ์
๋ ฅ์ผ๋ก ์์
์์ฑ": "https://fantaxy-stable-audio-open-zero.hf.space", |
|
|
| "[์์น+VisionLLM] ํ๊ตญ์ด JinJavis": "https://fantos-jinjavis.hf.space", |
| "MS PHI 3.5 Vision": "https://aiqtech-phi35-vision.hf.space", |
| "NSFW kAI": "https://fantaxy-ofai-kai.hf.space", |
| "๋ฉํ LLAMA 3.1 405B": "https://seawolf2357-ofai-405.hf.space", |
| "๋ฉํ LLAMA 3.1 70B": "https://fantaxy-ofai-70.hf.space", |
| "๋ฉํ LLAMA 3.1 8B": "https://seawolf2357-ofai-8.hf.space", |
| "๋ฏธ์คํธ๋ 7B Instruct v0.3": "https://fantaxy-ofai-mis7b.hf.space", |
| "MS Phi 3 mini 4k-instruct": "https://fantaxy-ofai-phi.hf.space", |
| "์ค๊ตญ Yi 1.5 34B": "https://fantaxy-ofai-yi.hf.space", |
| "๋ฏธ์คํธ๋ Mixtral 8X7B ": "https://fantaxy-ofai-8x7b.hf.space", |
| "๋ฏธ์คํธ๋ Nemo Instruct 2407": "https://seawolf2357-ofai-mistral-nemo.hf.space" , |
|
|
| "์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ": "https://seawolf2357-ofai-jinjavis-blog.hf.space", |
| "์ํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ": "https://seawolf2357-ofai-jinjavis-blog-medi.hf.space", |
| "์ฝ๋ฆฌํ ์ ๋ฌธ ๋ธ๋ก๊ทธ ์์ฑ": "https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space" , |
|
|
| "๋ธ๋ก๊ทธ ์๋(์ปจํ/๋จ์) ์์ฑ": "https://fantaxy-blogger-send-webhook-confirm-image.hf.space", |
| "๋ธ๋ก๊ทธ ์๋(๋ฌด์ธ/๋ณต์) ์์ฑ": "https://fantaxy-blogger-send-webhook-auto-image.hf.space" , |
|
|
| "24X7 ๋ชจ๋ํฐ๋ง": "https://seawolf2357-bnews3.hf.space" |
| } |
|
|
|
|
| if st.session_state.selected_item in content_map: |
| iframe_url = content_map[st.session_state.selected_item] |
| main_content.markdown( |
| f''' |
| <iframe src="{iframe_url}" |
| width="100%" |
| height="800" |
| frameborder="0" |
| allow="microphone *; camera *; fullscreen *; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
| allowfullscreen> |
| </iframe> |
| ''', |
| unsafe_allow_html=True |
| ) |
| else: |
| main_content.markdown("<h2>๋ฉ๋ด์์ ํญ๋ชฉ์ ์ ํํ์ธ์.</h2>") |
|
|
| |
| st.markdown(""" |
| <script> |
| function resizeIframe() { |
| var iframe = document.querySelector('iframe'); |
| if (iframe) { |
| iframe.style.height = window.innerHeight + 'px'; |
| } |
| } |
| |
| async function requestMicrophonePermission() { |
| try { |
| await navigator.mediaDevices.getUserMedia({ audio: true }); |
| console.log("Microphone permission granted"); |
| } catch (err) { |
| console.error("Error requesting microphone permission:", err); |
| } |
| } |
| |
| function postMessageToIframe(message) { |
| var iframe = document.querySelector('iframe'); |
| if (iframe) { |
| iframe.contentWindow.postMessage(message, '*'); |
| } |
| } |
| |
| window.addEventListener('message', function(event) { |
| if (event.data === 'requestMicrophoneAccess') { |
| requestMicrophonePermission(); |
| } |
| }); |
| |
| window.addEventListener('resize', resizeIframe); |
| resizeIframe(); |
| requestMicrophonePermission(); |
| |
| // Attempt to enable microphone access after a short delay |
| setTimeout(() => { |
| postMessageToIframe('enableMicrophone'); |
| }, 2000); |
| </script> |
| """, unsafe_allow_html=True) |