File size: 2,160 Bytes
6ac308a
 
 
 
 
 
 
 
 
 
 
 
9ac1725
6ac308a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ac1725
 
6ac308a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
Image Enhancer Main App
-----------------------
Aplikasi utama Gradio untuk menjalankan UI image enhancer berbasis tab.
Untuk versi ini, hanya ada 1 tab "Enhance" yang memanggil demo dari modul app_enhance.

Created by _drat | 2025
"""

import gradio as gr

from app_enhance import create_demo as create_demo_enhance  # Import fungsi untuk membangun demo UI 'Enhance'
from app_upscale import create_demo as create_demo_upscale  # Import fungsi untuk membangun demo UI 'Upscale'
from themes import IndonesiaTheme  # Impor tema custom

import warnings
warnings.filterwarnings("ignore")

# CSS untuk styling antarmuka
css = """
#col-left, #col-mid {
    margin: 0 auto;
    max-width: 400px;
    padding: 10px;
    border-radius: 15px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#col-right {
    margin: 0 auto;
    max-width: 400px;
    padding: 10px;
    border-radius: 15px;
    background: linear-gradient(180deg, #B6BBC4, #EEEEEE);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#col-bott {
    margin: 0 auto;
    padding: 10px;
    border-radius: 15px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
#banner {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}
#run-button {
    background-color: #ff4b5c;
    color: white;
    font-weight: bold;
    padding: 30px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
#footer {
    text-align: center;
    margin-top: 20px;
    color: silver;
}
#markdown-silver {
    color: silver; /* Mengatur warna font Markdown menjadi silver */
}
"""


# Inisialisasi Gradio Blocks dengan custom CSS (style.css)
with gr.Blocks(css=css, theme=IndonesiaTheme()) as demo:
    with gr.Tabs():
        with gr.Tab(label="✨ Enhance"):
            create_demo_enhance()   # Panggil UI Enhance dari app_enhance.py (atau sesuai modul Anda)
        with gr.Tab(label="πŸš€ Upscale"):
            create_demo_upscale()   # Panggil UI Upscale dari app_upscale.py (atau sesuai modul Anda)

# Jalankan aplikasi Gradio (local/web)
demo.queue(api_open=False).launch(show_api=False)