openfree commited on
Commit
144c524
·
verified ·
1 Parent(s): 29cca63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -18
app.py CHANGED
@@ -103,27 +103,31 @@ STYLE_PRESETS = [
103
  }
104
  ]
105
 
 
106
  css = '''
107
  #component-0 {
108
  max-width: 1200px;
109
  margin: auto;
110
  padding: 20px;
 
 
111
  }
112
 
113
  .container {
114
  background-color: #ffffff;
115
- border-radius: 10px;
116
- padding: 20px;
117
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
118
  }
119
 
120
  .header {
121
  text-align: center;
122
  margin-bottom: 2rem;
123
- background: linear-gradient(90deg, #2C3E50, #3498DB);
124
  padding: 2rem;
125
- border-radius: 10px;
126
- color: white;
 
127
  }
128
 
129
  .preset-grid {
@@ -140,16 +144,17 @@ css = '''
140
  cursor: pointer;
141
  transition: all 0.3s ease;
142
  border: 1px solid #e9ecef;
 
143
  }
144
 
145
  .preset-card:hover {
146
- transform: translateY(-2px);
147
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
148
- background: #f1f3f5;
149
  }
150
 
151
  .preset-emoji {
152
- font-size: 2rem;
153
  margin-bottom: 0.5rem;
154
  }
155
 
@@ -160,6 +165,13 @@ css = '''
160
  margin-bottom: 1rem;
161
  }
162
 
 
 
 
 
 
 
 
163
  footer {display: none !important}
164
  '''
165
 
@@ -213,16 +225,13 @@ def create_preset_click_handler(idx, prompt_input):
213
  return handler
214
 
215
  with gr.Blocks(css=css) as demo:
216
-
217
- gr.HTML("""<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fopenfree-MagicFace.hf.space">
218
- <img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fopenfree-MagicFace.hf.space&countColor=%23263759" />
219
- </a>""")
220
 
221
  with gr.Column(elem_classes="container"):
222
  with gr.Column(elem_classes="header"):
223
- gr.Markdown("# ✨ Magic Face")
224
  gr.Markdown("### Transform Your Face Into Legendary Characters!")
225
-
226
  with gr.Row():
227
  with gr.Column(scale=1):
228
  images_input = gr.Files(
@@ -269,7 +278,7 @@ with gr.Blocks(css=css) as demo:
269
 
270
  with gr.Accordion("📖 Quick Guide", open=False):
271
  gr.Markdown("""
272
- ### How to Use Magic Face
273
  1. Upload one or more face photos
274
  2. Select your gender
275
  3. Choose a magical transformation or write your own prompt
@@ -289,4 +298,4 @@ with gr.Blocks(css=css) as demo:
289
  )
290
 
291
  demo.queue()
292
- demo.launch()
 
103
  }
104
  ]
105
 
106
+ # Updated CSS for a cooler UI theme
107
  css = '''
108
  #component-0 {
109
  max-width: 1200px;
110
  margin: auto;
111
  padding: 20px;
112
+ background: linear-gradient(135deg, #1e1e2f, #2e2e48);
113
+ min-height: 100vh;
114
  }
115
 
116
  .container {
117
  background-color: #ffffff;
118
+ border-radius: 15px;
119
+ padding: 30px;
120
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
121
  }
122
 
123
  .header {
124
  text-align: center;
125
  margin-bottom: 2rem;
126
+ background: linear-gradient(90deg, #0f2027, #203a43, #2c5364);
127
  padding: 2rem;
128
+ border-radius: 15px;
129
+ color: #f0f0f0;
130
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
131
  }
132
 
133
  .preset-grid {
 
144
  cursor: pointer;
145
  transition: all 0.3s ease;
146
  border: 1px solid #e9ecef;
147
+ text-align: center;
148
  }
149
 
150
  .preset-card:hover {
151
+ transform: translateY(-3px);
152
+ box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
153
+ background: #e9ecef;
154
  }
155
 
156
  .preset-emoji {
157
+ font-size: 2.5rem;
158
  margin-bottom: 0.5rem;
159
  }
160
 
 
165
  margin-bottom: 1rem;
166
  }
167
 
168
+ .output-gallery {
169
+ border: 2px solid #e9ecef;
170
+ border-radius: 8px;
171
+ padding: 10px;
172
+ background: #ffffff;
173
+ }
174
+
175
  footer {display: none !important}
176
  '''
177
 
 
225
  return handler
226
 
227
  with gr.Blocks(css=css) as demo:
228
+
 
 
 
229
 
230
  with gr.Column(elem_classes="container"):
231
  with gr.Column(elem_classes="header"):
232
+ gr.Markdown("# ✨ MagicFace V3")
233
  gr.Markdown("### Transform Your Face Into Legendary Characters!")
234
+
235
  with gr.Row():
236
  with gr.Column(scale=1):
237
  images_input = gr.Files(
 
278
 
279
  with gr.Accordion("📖 Quick Guide", open=False):
280
  gr.Markdown("""
281
+ ### How to Use MagicFace V3
282
  1. Upload one or more face photos
283
  2. Select your gender
284
  3. Choose a magical transformation or write your own prompt
 
298
  )
299
 
300
  demo.queue()
301
+ demo.launch()