Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,7 +97,7 @@ def batch_process(txt_file, randomize_seed, progress=gr.Progress()):
|
|
| 97 |
return zip_path, f"✅ BATCH COMPLETE. {total} FILES SECURED."
|
| 98 |
|
| 99 |
# ==========================================
|
| 100 |
-
# 5. The Cyberpunk HUD CSS (
|
| 101 |
# ==========================================
|
| 102 |
custom_css = """
|
| 103 |
/* FORCE DARK BACKGROUND & FONT */
|
|
@@ -111,8 +111,15 @@ body, .gradio-container, .main {
|
|
| 111 |
font-family: 'Courier New', monospace !important;
|
| 112 |
}
|
| 113 |
|
| 114 |
-
/* KILL
|
| 115 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
background: rgba(15, 0, 0, 0.7) !important;
|
| 117 |
backdrop-filter: blur(10px) !important;
|
| 118 |
-webkit-backdrop-filter: blur(10px) !important;
|
|
@@ -120,10 +127,11 @@ body, .gradio-container, .main {
|
|
| 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;
|
|
@@ -131,14 +139,21 @@ h1, h2, h3, .prose h1 {
|
|
| 131 |
text-align: center !important;
|
| 132 |
}
|
| 133 |
|
| 134 |
-
/*
|
| 135 |
.gr-radio-group {
|
| 136 |
display: flex !important;
|
| 137 |
-
flex-direction: row !important;
|
| 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;
|
|
@@ -147,21 +162,27 @@ h1, h2, h3, .prose h1 {
|
|
| 147 |
padding: 10px 15px !important;
|
| 148 |
border-radius: 4px !important;
|
| 149 |
cursor: pointer !important;
|
| 150 |
-
flex: 1 !important;
|
| 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 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
button.primary, .gr-button-primary {
|
| 166 |
background: linear-gradient(90deg, #550000, #ff003c, #550000) !important;
|
| 167 |
background-size: 200% auto !important;
|
|
@@ -191,20 +212,25 @@ textarea:focus, input:focus {
|
|
| 191 |
box-shadow: 0 0 15px #ff003c !important;
|
| 192 |
}
|
| 193 |
|
| 194 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 208 |
*SYSTEM STATUS: ONLINE // AWAITING INPUT*
|
| 209 |
"""
|
| 210 |
)
|
|
@@ -213,7 +239,8 @@ with gr.Blocks(theme=gr.themes.Base(), css=custom_css, title="Aparna's Image Gen
|
|
| 213 |
choices=["🖼️ SINGLE IMAGE", "📦 BATCH GENERATE"],
|
| 214 |
value="🖼️ SINGLE IMAGE",
|
| 215 |
label="SELECT OPERATION MODE",
|
| 216 |
-
interactive=True
|
|
|
|
| 217 |
)
|
| 218 |
|
| 219 |
# --- SINGLE MODE VIEW ---
|
|
@@ -240,7 +267,16 @@ with gr.Blocks(theme=gr.themes.Base(), css=custom_css, title="Aparna's Image Gen
|
|
| 240 |
with gr.Column(visible=False, elem_classes="glass-panel") as batch_view:
|
| 241 |
with gr.Row():
|
| 242 |
with gr.Column(scale=1):
|
| 243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
txt_input = gr.File(label="UPLOAD TXT FILE", file_types=[".txt"])
|
| 245 |
randomize_cb = gr.Checkbox(label="RANDOMIZE SEED", value=True)
|
| 246 |
run_btn = gr.Button("⚡ EXECUTE BATCH SEQUENCE", variant="primary")
|
|
@@ -269,5 +305,4 @@ with gr.Blocks(theme=gr.themes.Base(), css=custom_css, title="Aparna's Image Gen
|
|
| 269 |
)
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
| 272 |
-
# Hide the default Gradio footer links
|
| 273 |
demo.launch(footer_links=[])
|
|
|
|
| 97 |
return zip_path, f"✅ BATCH COMPLETE. {total} FILES SECURED."
|
| 98 |
|
| 99 |
# ==========================================
|
| 100 |
+
# 5. The Cyberpunk HUD CSS (Nuclear Override)
|
| 101 |
# ==========================================
|
| 102 |
custom_css = """
|
| 103 |
/* FORCE DARK BACKGROUND & FONT */
|
|
|
|
| 111 |
font-family: 'Courier New', monospace !important;
|
| 112 |
}
|
| 113 |
|
| 114 |
+
/* KILL ALL INNER GREY WRAPPERS */
|
| 115 |
+
.block, .form, .wrap, fieldset, .panel {
|
| 116 |
+
background: transparent !important;
|
| 117 |
+
border: none !important;
|
| 118 |
+
box-shadow: none !important;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* GLASS PANELS (OUTER CONTAINERS ONLY) */
|
| 122 |
+
.glass-panel {
|
| 123 |
background: rgba(15, 0, 0, 0.7) !important;
|
| 124 |
backdrop-filter: blur(10px) !important;
|
| 125 |
-webkit-backdrop-filter: blur(10px) !important;
|
|
|
|
| 127 |
box-shadow: 0 0 15px rgba(255, 0, 60, 0.1), inset 0 0 20px rgba(255, 0, 60, 0.05) !important;
|
| 128 |
border-radius: 4px !important;
|
| 129 |
margin-bottom: 15px !important;
|
| 130 |
+
padding: 15px !important;
|
| 131 |
}
|
| 132 |
|
| 133 |
/* GLOWING HEADER */
|
| 134 |
+
h1, h2, h3, .prose h1, .prose h3 {
|
| 135 |
color: #ff003c !important;
|
| 136 |
text-transform: uppercase !important;
|
| 137 |
letter-spacing: 2px !important;
|
|
|
|
| 139 |
text-align: center !important;
|
| 140 |
}
|
| 141 |
|
| 142 |
+
/* FORCE RADIO BUTTONS HORIZONTAL & STYLE THEM */
|
| 143 |
.gr-radio-group {
|
| 144 |
display: flex !important;
|
| 145 |
+
flex-direction: row !important;
|
| 146 |
gap: 10px !important;
|
| 147 |
+
width: 100% !important;
|
| 148 |
+
background: transparent !important;
|
| 149 |
+
justify-content: center !important;
|
| 150 |
+
}
|
| 151 |
+
.gr-radio-group .wrap {
|
| 152 |
+
display: flex !important;
|
| 153 |
+
flex-direction: row !important;
|
| 154 |
+
gap: 10px !important;
|
| 155 |
+
width: 100% !important;
|
| 156 |
background: transparent !important;
|
|
|
|
|
|
|
| 157 |
}
|
| 158 |
.gr-radio-group label {
|
| 159 |
background: rgba(30, 0, 0, 0.8) !important;
|
|
|
|
| 162 |
padding: 10px 15px !important;
|
| 163 |
border-radius: 4px !important;
|
| 164 |
cursor: pointer !important;
|
| 165 |
+
flex: 1 !important;
|
| 166 |
text-align: center !important;
|
| 167 |
transition: all 0.3s !important;
|
| 168 |
+
box-shadow: none !important;
|
| 169 |
}
|
|
|
|
| 170 |
.gr-radio-group label.selected {
|
| 171 |
background: rgba(255, 0, 60, 0.2) !important;
|
| 172 |
border-color: #ff003c !important;
|
| 173 |
color: #ffffff !important;
|
| 174 |
box-shadow: 0 0 15px #ff003c !important;
|
| 175 |
}
|
|
|
|
| 176 |
.gr-radio-group input[type="radio"] { display: none !important; }
|
| 177 |
|
| 178 |
+
/* FIX CHECKBOXES (Kill the blue) */
|
| 179 |
+
input[type="checkbox"] {
|
| 180 |
+
accent-color: #ff003c !important;
|
| 181 |
+
background-color: #000 !important;
|
| 182 |
+
border: 1px solid #ff003c !important;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
/* KILL THE ORANGE BUTTON -> NEON RED */
|
| 186 |
button.primary, .gr-button-primary {
|
| 187 |
background: linear-gradient(90deg, #550000, #ff003c, #550000) !important;
|
| 188 |
background-size: 200% auto !important;
|
|
|
|
| 212 |
box-shadow: 0 0 15px #ff003c !important;
|
| 213 |
}
|
| 214 |
|
| 215 |
+
/* FILE UPLOAD GLOW */
|
| 216 |
+
.file-preview {
|
| 217 |
+
border: 1px dashed #ff003c !important;
|
| 218 |
+
background: rgba(10, 0, 0, 0.8) !important;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/* HIDE FOOTER */
|
| 222 |
footer { display: none !important; }
|
| 223 |
"""
|
| 224 |
|
| 225 |
# ==========================================
|
| 226 |
# 6. Gradio UI Construction
|
| 227 |
# ==========================================
|
|
|
|
| 228 |
with gr.Blocks(theme=gr.themes.Base(), css=custom_css, title="Aparna's Image Generator") as demo:
|
| 229 |
|
| 230 |
with gr.Column(elem_classes="glass-panel"):
|
| 231 |
gr.Markdown(
|
| 232 |
"""
|
| 233 |
+
# ⬡ APARNA'S HIGH-SPEED IMAGEGEN ⬡
|
| 234 |
*SYSTEM STATUS: ONLINE // AWAITING INPUT*
|
| 235 |
"""
|
| 236 |
)
|
|
|
|
| 239 |
choices=["🖼️ SINGLE IMAGE", "📦 BATCH GENERATE"],
|
| 240 |
value="🖼️ SINGLE IMAGE",
|
| 241 |
label="SELECT OPERATION MODE",
|
| 242 |
+
interactive=True,
|
| 243 |
+
elem_classes="gr-radio-group"
|
| 244 |
)
|
| 245 |
|
| 246 |
# --- SINGLE MODE VIEW ---
|
|
|
|
| 267 |
with gr.Column(visible=False, elem_classes="glass-panel") as batch_view:
|
| 268 |
with gr.Row():
|
| 269 |
with gr.Column(scale=1):
|
| 270 |
+
# NEW CLEAR INSTRUCTIONS
|
| 271 |
+
gr.Markdown(
|
| 272 |
+
"""
|
| 273 |
+
### 📁 DATA INGESTION PROTOCOL
|
| 274 |
+
1. Open a notes app or text editor.
|
| 275 |
+
2. Type your prompts, wrapping each one in **asterisks (`*`)**.
|
| 276 |
+
3. *Example:* `*A cyberpunk city* *A glowing dragon* *A neon forest*`
|
| 277 |
+
4. Save the file as a **`.txt`** file and upload it below.
|
| 278 |
+
"""
|
| 279 |
+
)
|
| 280 |
txt_input = gr.File(label="UPLOAD TXT FILE", file_types=[".txt"])
|
| 281 |
randomize_cb = gr.Checkbox(label="RANDOMIZE SEED", value=True)
|
| 282 |
run_btn = gr.Button("⚡ EXECUTE BATCH SEQUENCE", variant="primary")
|
|
|
|
| 305 |
)
|
| 306 |
|
| 307 |
if __name__ == "__main__":
|
|
|
|
| 308 |
demo.launch(footer_links=[])
|