File size: 5,765 Bytes
22e10e4
 
 
 
c16c810
22e10e4
 
885ae47
22e10e4
 
c16c810
22e10e4
 
 
 
c16c810
 
 
 
 
885ae47
22e10e4
 
 
 
 
 
 
885ae47
c16c810
 
 
 
 
 
 
 
 
 
22e10e4
c16c810
22e10e4
c16c810
22e10e4
 
 
 
 
 
 
c16c810
885ae47
 
 
 
 
c16c810
 
 
885ae47
 
 
 
 
 
c16c810
 
885ae47
 
 
 
c16c810
 
885ae47
 
 
 
 
 
c16c810
 
22e10e4
 
c16c810
885ae47
 
 
 
 
 
 
 
 
c16c810
 
885ae47
 
c16c810
 
 
885ae47
 
c16c810
 
 
885ae47
 
 
 
 
 
c16c810
 
22e10e4
 
885ae47
 
 
 
22e10e4
 
c16c810
885ae47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c16c810
 
 
22e10e4
 
c16c810
 
 
885ae47
c16c810
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885ae47
 
 
 
 
 
 
 
 
71cc6c6
 
885ae47
 
 
 
 
 
22e10e4
 
 
 
 
 
 
 
a76f07a
 
22e10e4
 
885ae47
 
4823ee5
f96ff9d
3396e15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
import gradio as gr
import os
import datetime

# --- Theme Configuration ---
custom_theme = gr.themes.Default(
    primary_hue="blue",
    secondary_hue="blue",
    neutral_hue="slate",
).set(
    loader_color="#0071bb",
    button_primary_background_fill="#0071bb",
    button_primary_background_fill_hover="#005a94",
    button_primary_text_color="white",
    slider_color="#0071bb",
    checkbox_background_color_selected="#0071bb",
    checkbox_border_color_selected="#0071bb",
    body_background_fill="#0a0a0a",
    body_background_fill_dark="#0a0a0a",
    block_background_fill="#1a1a1a",
    block_background_fill_dark="#1a1a1a",
)

# --- Environment Setup ---
token = os.environ.get("TOKEN", "")
model = os.environ.get("MODEL", "")

# --- CSS ---
css = """
/* 1. Global Layout & Colors */
.gradio-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    background: #0a0a0a !important;
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

a { color: #a0a0a0 !important; }
footer, #huggingface-space-header { display: none !important; }

/* 2. Header & Typography */
.header-container { text-align: center; padding: 2rem 0 1rem; }
.logo-wrapper { display: flex; justify-content: center; align-items: center; gap: 2rem; margin-bottom: 1.5rem; }
.logo-divider { width: 1px; height: 40px; background: #2a2a2a; }
.main-title { font-size: 1.8rem; font-weight: 400; margin-bottom: 0.5rem; color: #fff; }
.subtitle { color: #a0a0a0; font-size: 0.9rem; }
.footer { text-align: center; padding: 3rem 0 2rem; border-top: 1px solid #2a2a2a; color: #a0a0a0; }

/* 3. RESULT CARD STYLING */
.result-card {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    margin-top: 1rem;
}

.video-wrapper {
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-wrapper video {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.controls-wrapper {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #161616;
}

.info { color: #a0a0a0; font-size: 0.9rem; }

/* 4. BUTTON STYLING */
.action-btn-blue {
    background: #0071bb !important;
    color: white !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border: none !important;
    cursor: pointer !important;
    transition: 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.action-btn-blue:hover {
    background: #005a94 !important;
    transform: translateY(-1px) !important;
}

.md-button {
    background: #1a1a1a !important;
    border: 1px solid #2a2a2a !important;
    color: #a0a0a0 !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    transition: 0.2s !important;
    cursor: pointer !important;
}

.md-button:hover {
    background: #252525 !important;
    border-color: #0071bb !important;
    color: #fff !important;
}

/* 5. Placeholder & Gear Spin Animation */
.placeholder-box {
    height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111;
    border: 2px dashed #222;
    border-radius: 12px;
    color: #666;
}

.gear-spin {
    font-size: 40px;
    animation: spin 2s linear infinite;
    display: inline-block;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-pulse {
    animation: pulse 2s ease-in-out infinite !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 6. Loaded Space Upload Inputs */
#upload_box, #end_frame_box {
    height: 280px !important;
}

@media (max-width: 768px) {
    #upload_box, #end_frame_box {
        height: 220px !important;
    }

    .video-wrapper {
        height: 320px;
    }
}
"""

head = """
<link
    rel="icon"
    type="image/svg+xml"
    href="https://cms.cypherchat.app/uploads/favicon_8bc904ca6b.svg"
/>
"""
loaded_demo = gr.load(model, src="spaces", token=token)

with gr.Blocks(
    fill_height=False,
    fill_width=True,
    title="AskCyph™ Video Studio - Cypher Tech Inc.",
) as demo:

    # Header Section
    gr.HTML("""
    <div class="header-container">
        <div class="logo-wrapper">
            <a href="#"><img src="https://cms.cypherchat.app/uploads/logo_white_4e6ca90bad.svg" alt="Cypher Tech" style="height:40px;"></a>
            <div class="logo-divider"></div>
            <a href="#"><img src="https://cms.cypherchat.app/uploads/askcyph_white_letter_6911d8dfaa.svg" alt="AskCyph" style="height:40px;"></a>
        </div>
        <h1 class="main-title">AskCyph&trade; Video Studio</h1>
        <p class="subtitle">Transform your ideas into stunning videos with audio AI</p>
    </div>
    """)

    # Load Video generator
    with gr.Group():
        loaded_demo.render()

    # Footer Section
    current_year = datetime.datetime.now().year
    gr.HTML(f"""
    <div class="footer">
        <p style="margin-top: 0.5rem; opacity: 0.7;">
            Try <a href="https://askcyph.ai" target="_blank">AskCyph&trade;</a>
            AI for higher limits and more features |
            © {current_year}
            <a href="https://cyphertech.co" target="_blank">Cypher Tech Inc</a>.
        </p>
    </div>
    """)

if __name__ == "__main__":
    demo.launch(
        theme=custom_theme,
        css=css,
        head=head,
        show_error=False,
        quiet=True,
        footer_links=[],
    )