Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,118 +97,118 @@ def batch_process(txt_file, randomize_seed, progress=gr.Progress()):
|
|
| 97 |
return zip_path, f"✅ BATCH COMPLETE. {total} FILES SECURED."
|
| 98 |
|
| 99 |
# ==========================================
|
| 100 |
-
# 5. Cyberpunk HUD CSS
|
| 101 |
# ==========================================
|
| 102 |
custom_css = """
|
| 103 |
-
/*
|
| 104 |
-
body, .gradio-container {
|
| 105 |
background-color: #050505 !important;
|
| 106 |
background-image:
|
| 107 |
-
linear-gradient(rgba(255, 0, 60, 0.
|
| 108 |
-
linear-gradient(90deg, rgba(255, 0, 60, 0.
|
| 109 |
-
|
| 110 |
-
background-size: 30px 30px, 30px 30px, 100% 100% !important;
|
| 111 |
color: #ff3333 !important;
|
| 112 |
-
font-family: 'Courier New',
|
| 113 |
}
|
| 114 |
|
| 115 |
-
/*
|
| 116 |
-
.glass-panel {
|
| 117 |
-
background: rgba(
|
| 118 |
backdrop-filter: blur(10px) !important;
|
| 119 |
-webkit-backdrop-filter: blur(10px) !important;
|
| 120 |
-
border: 1px solid rgba(255, 0, 60, 0.
|
| 121 |
box-shadow: 0 0 15px rgba(255, 0, 60, 0.1), inset 0 0 20px rgba(255, 0, 60, 0.05) !important;
|
| 122 |
border-radius: 4px !important;
|
| 123 |
-
|
| 124 |
}
|
| 125 |
|
| 126 |
-
/*
|
| 127 |
-
h1, h2, h3 {
|
| 128 |
color: #ff003c !important;
|
| 129 |
text-transform: uppercase !important;
|
| 130 |
letter-spacing: 2px !important;
|
| 131 |
-
text-shadow: 0 0
|
|
|
|
| 132 |
}
|
| 133 |
|
| 134 |
-
/*
|
| 135 |
.gr-radio-group {
|
|
|
|
|
|
|
|
|
|
| 136 |
background: transparent !important;
|
| 137 |
border: none !important;
|
| 138 |
-
|
| 139 |
-
justify-content: center !important;
|
| 140 |
-
gap: 15px !important;
|
| 141 |
}
|
| 142 |
.gr-radio-group label {
|
| 143 |
-
background: rgba(
|
| 144 |
-
border: 1px solid
|
| 145 |
color: #ff6666 !important;
|
| 146 |
-
padding: 10px
|
| 147 |
border-radius: 4px !important;
|
| 148 |
cursor: pointer !important;
|
|
|
|
|
|
|
| 149 |
transition: all 0.3s !important;
|
| 150 |
-
font-weight: bold !important;
|
| 151 |
}
|
|
|
|
| 152 |
.gr-radio-group label.selected {
|
| 153 |
background: rgba(255, 0, 60, 0.2) !important;
|
| 154 |
border-color: #ff003c !important;
|
| 155 |
color: #ffffff !important;
|
| 156 |
-
box-shadow: 0 0
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
/* Inputs */
|
| 160 |
-
textarea, input[type="text"], input[type="number"] {
|
| 161 |
-
background: rgba(0, 0, 0, 0.8) !important;
|
| 162 |
-
border: 1px solid #550000 !important;
|
| 163 |
-
color: #ff003c !important;
|
| 164 |
-
font-family: monospace !important;
|
| 165 |
-
box-shadow: inset 0 0 5px rgba(255,0,0,0.2) !important;
|
| 166 |
-
}
|
| 167 |
-
textarea:focus, input:focus {
|
| 168 |
-
border-color: #ff003c !important;
|
| 169 |
-
box-shadow: 0 0 10px #ff003c !important;
|
| 170 |
}
|
|
|
|
|
|
|
| 171 |
|
| 172 |
-
/*
|
| 173 |
-
.gr-button-primary {
|
| 174 |
-
background: linear-gradient(90deg, #
|
| 175 |
background-size: 200% auto !important;
|
| 176 |
border: 1px solid #ff003c !important;
|
| 177 |
-
color:
|
| 178 |
-
box-shadow: 0 0 15px rgba(255, 0, 60, 0.
|
| 179 |
font-weight: bold !important;
|
| 180 |
text-transform: uppercase !important;
|
| 181 |
letter-spacing: 2px !important;
|
| 182 |
transition: 0.5s !important;
|
| 183 |
}
|
| 184 |
-
.gr-button-primary:hover {
|
| 185 |
background-position: right center !important;
|
| 186 |
-
box-shadow: 0 0
|
| 187 |
-
transform: scale(1.02) !important;
|
| 188 |
}
|
| 189 |
|
| 190 |
-
/*
|
| 191 |
-
|
| 192 |
-
background: rgba(
|
| 193 |
-
border: 1px
|
| 194 |
-
color: #
|
|
|
|
|
|
|
| 195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
"""
|
| 197 |
|
| 198 |
# ==========================================
|
| 199 |
# 6. Gradio UI Construction
|
| 200 |
# ==========================================
|
| 201 |
-
|
|
|
|
| 202 |
|
| 203 |
with gr.Column(elem_classes="glass-panel"):
|
| 204 |
gr.Markdown(
|
| 205 |
"""
|
| 206 |
-
#
|
| 207 |
*SYSTEM STATUS: ONLINE // AWAITING INPUT*
|
| 208 |
"""
|
| 209 |
)
|
| 210 |
|
| 211 |
-
# This Radio acts as our clean mobile-friendly navigation
|
| 212 |
mode_selector = gr.Radio(
|
| 213 |
choices=["🖼️ SINGLE IMAGE", "📦 BATCH GENERATE"],
|
| 214 |
value="🖼️ SINGLE IMAGE",
|
|
@@ -255,7 +255,7 @@ with gr.Blocks(css=custom_css, title="Aparna's Image Generator") as demo:
|
|
| 255 |
outputs=[zip_output, status_text]
|
| 256 |
)
|
| 257 |
|
| 258 |
-
# --- THE
|
| 259 |
def toggle_view(mode):
|
| 260 |
if mode == "🖼️ SINGLE IMAGE":
|
| 261 |
return gr.update(visible=True), gr.update(visible=False)
|
|
@@ -269,4 +269,5 @@ with gr.Blocks(css=custom_css, title="Aparna's Image Generator") as demo:
|
|
| 269 |
)
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
| 272 |
-
|
|
|
|
|
|
| 97 |
return zip_path, f"✅ BATCH COMPLETE. {total} FILES SECURED."
|
| 98 |
|
| 99 |
# ==========================================
|
| 100 |
+
# 5. The Cyberpunk HUD CSS (Aggressive Override)
|
| 101 |
# ==========================================
|
| 102 |
custom_css = """
|
| 103 |
+
/* FORCE DARK BACKGROUND & FONT */
|
| 104 |
+
body, .gradio-container, .main {
|
| 105 |
background-color: #050505 !important;
|
| 106 |
background-image:
|
| 107 |
+
linear-gradient(rgba(255, 0, 60, 0.05) 1px, transparent 1px),
|
| 108 |
+
linear-gradient(90deg, rgba(255, 0, 60, 0.05) 1px, transparent 1px) !important;
|
| 109 |
+
background-size: 20px 20px !important;
|
|
|
|
| 110 |
color: #ff3333 !important;
|
| 111 |
+
font-family: 'Courier New', monospace !important;
|
| 112 |
}
|
| 113 |
|
| 114 |
+
/* KILL THE GREY BOXES -> MAKE THEM GLASS */
|
| 115 |
+
.glass-panel, .block {
|
| 116 |
+
background: rgba(15, 0, 0, 0.7) !important;
|
| 117 |
backdrop-filter: blur(10px) !important;
|
| 118 |
-webkit-backdrop-filter: blur(10px) !important;
|
| 119 |
+
border: 1px solid rgba(255, 0, 60, 0.3) !important;
|
| 120 |
box-shadow: 0 0 15px rgba(255, 0, 60, 0.1), inset 0 0 20px rgba(255, 0, 60, 0.05) !important;
|
| 121 |
border-radius: 4px !important;
|
| 122 |
+
margin-bottom: 15px !important;
|
| 123 |
}
|
| 124 |
|
| 125 |
+
/* GLOWING HEADER */
|
| 126 |
+
h1, h2, h3, .prose h1 {
|
| 127 |
color: #ff003c !important;
|
| 128 |
text-transform: uppercase !important;
|
| 129 |
letter-spacing: 2px !important;
|
| 130 |
+
text-shadow: 0 0 10px rgba(255, 0, 60, 0.7) !important;
|
| 131 |
+
text-align: center !important;
|
| 132 |
}
|
| 133 |
|
| 134 |
+
/* FIX THE RADIO BUTTONS (Make them horizontal HUD toggles) */
|
| 135 |
.gr-radio-group {
|
| 136 |
+
display: flex !important;
|
| 137 |
+
flex-direction: row !important; /* Force horizontal */
|
| 138 |
+
gap: 10px !important;
|
| 139 |
background: transparent !important;
|
| 140 |
border: none !important;
|
| 141 |
+
padding: 10px 0 !important;
|
|
|
|
|
|
|
| 142 |
}
|
| 143 |
.gr-radio-group label {
|
| 144 |
+
background: rgba(30, 0, 0, 0.8) !important;
|
| 145 |
+
border: 1px solid #550000 !important;
|
| 146 |
color: #ff6666 !important;
|
| 147 |
+
padding: 10px 15px !important;
|
| 148 |
border-radius: 4px !important;
|
| 149 |
cursor: pointer !important;
|
| 150 |
+
flex: 1 !important; /* Make them equal width */
|
| 151 |
+
text-align: center !important;
|
| 152 |
transition: all 0.3s !important;
|
|
|
|
| 153 |
}
|
| 154 |
+
/* Style the selected radio button */
|
| 155 |
.gr-radio-group label.selected {
|
| 156 |
background: rgba(255, 0, 60, 0.2) !important;
|
| 157 |
border-color: #ff003c !important;
|
| 158 |
color: #ffffff !important;
|
| 159 |
+
box-shadow: 0 0 15px #ff003c !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
}
|
| 161 |
+
/* Hide the default radio circles */
|
| 162 |
+
.gr-radio-group input[type="radio"] { display: none !important; }
|
| 163 |
|
| 164 |
+
/* KILL THE ORANGE BUTTON -> MAKE IT NEON RED */
|
| 165 |
+
button.primary, .gr-button-primary {
|
| 166 |
+
background: linear-gradient(90deg, #550000, #ff003c, #550000) !important;
|
| 167 |
background-size: 200% auto !important;
|
| 168 |
border: 1px solid #ff003c !important;
|
| 169 |
+
color: #ffffff !important;
|
| 170 |
+
box-shadow: 0 0 15px rgba(255, 0, 60, 0.5) !important;
|
| 171 |
font-weight: bold !important;
|
| 172 |
text-transform: uppercase !important;
|
| 173 |
letter-spacing: 2px !important;
|
| 174 |
transition: 0.5s !important;
|
| 175 |
}
|
| 176 |
+
button.primary:hover, .gr-button-primary:hover {
|
| 177 |
background-position: right center !important;
|
| 178 |
+
box-shadow: 0 0 30px #ff003c !important;
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
+
/* INPUT BOXES */
|
| 182 |
+
textarea, input[type="text"], input[type="number"] {
|
| 183 |
+
background: rgba(0, 0, 0, 0.9) !important;
|
| 184 |
+
border: 1px solid #800000 !important;
|
| 185 |
+
color: #ff003c !important;
|
| 186 |
+
font-family: monospace !important;
|
| 187 |
+
box-shadow: inset 0 0 10px rgba(255,0,0,0.2) !important;
|
| 188 |
}
|
| 189 |
+
textarea:focus, input:focus {
|
| 190 |
+
border-color: #ff003c !important;
|
| 191 |
+
box-shadow: 0 0 15px #ff003c !important;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
/* HIDE THE GRADIO FOOTER */
|
| 195 |
+
footer { display: none !important; }
|
| 196 |
"""
|
| 197 |
|
| 198 |
# ==========================================
|
| 199 |
# 6. Gradio UI Construction
|
| 200 |
# ==========================================
|
| 201 |
+
# Using gr.themes.Base() to strip away Gradio's default bright colors
|
| 202 |
+
with gr.Blocks(theme=gr.themes.Base(), css=custom_css, title="Aparna's Image Generator") as demo:
|
| 203 |
|
| 204 |
with gr.Column(elem_classes="glass-panel"):
|
| 205 |
gr.Markdown(
|
| 206 |
"""
|
| 207 |
+
# ⬡ APARNA'S IMAGE GENERATOR ⬡
|
| 208 |
*SYSTEM STATUS: ONLINE // AWAITING INPUT*
|
| 209 |
"""
|
| 210 |
)
|
| 211 |
|
|
|
|
| 212 |
mode_selector = gr.Radio(
|
| 213 |
choices=["🖼️ SINGLE IMAGE", "📦 BATCH GENERATE"],
|
| 214 |
value="🖼️ SINGLE IMAGE",
|
|
|
|
| 255 |
outputs=[zip_output, status_text]
|
| 256 |
)
|
| 257 |
|
| 258 |
+
# --- THE SWITCH LOGIC ---
|
| 259 |
def toggle_view(mode):
|
| 260 |
if mode == "🖼️ SINGLE IMAGE":
|
| 261 |
return gr.update(visible=True), gr.update(visible=False)
|
|
|
|
| 269 |
)
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
| 272 |
+
# Hide the default Gradio footer links
|
| 273 |
+
demo.launch(footer_links=[])
|