dominic1021 commited on
Commit
094ff67
·
verified ·
1 Parent(s): 4790bde

Better UI.

Browse files
Files changed (1) hide show
  1. app.py +49 -22
app.py CHANGED
@@ -320,61 +320,88 @@ def change_text_model(model_name: str=MODEL_PATH, use_client: bool=False, gguf_f
320
  # Custom CSS for neon purple theme
321
  css = """
322
  body {
323
- background: linear-gradient(to right, #2E0854, #5B0E91);
324
- color: #FFFFFF;
 
325
  }
326
  .gradio-container {
327
  max-width: 1200px !important;
328
  margin: auto;
329
  }
330
  .gr-button {
331
- background-color: #8A2BE2 !important;
332
- border-color: #9B30FF !important;
333
  color: white !important;
 
 
334
  }
335
  .gr-button:hover {
336
- background-color: #9B30FF !important;
 
337
  }
338
  .gr-form {
339
  border-radius: 15px;
340
  padding: 20px;
341
- background-color: #3C1361 !important;
342
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
343
  }
344
  .gr-box {
345
  border-radius: 15px;
346
- background-color: #4B0082 !important;
347
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
348
  }
349
  .gr-padded {
350
  padding: 20px;
351
  }
352
  .gr-form label, .gr-form .label-wrap {
353
- color: #E6E6FA !important;
 
354
  }
355
  .gr-input, .gr-dropdown {
356
- background-color: #2F0147 !important;
357
- border-color: #8A2BE2 !important;
358
- color: #FFFFFF !important;
 
359
  }
360
  .gr-input::placeholder {
361
- color: #B19CD9 !important;
362
  }
363
  .gr-checkbox {
364
- background-color: #4B0082 !important;
365
- border-color: #8A2BE2 !important;
366
  }
367
  .gr-checkbox:checked {
368
- background-color: #8A2BE2 !important;
369
  }
370
  h1, h2, h3 {
371
- color: #FFD700 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  }
373
  """
374
 
375
  # Gradio interface
376
- with gr.Blocks(css=css) as demo:
377
- gr.HTML("<h1 style='text-align: center; color: #FFD700;'>JoyCaption Alpha One Mod</h1>")
 
 
 
378
  with gr.Row():
379
  with gr.Column(scale=1):
380
  with gr.Group():
@@ -397,9 +424,9 @@ with gr.Blocks(css=css) as demo:
397
  value="any",
398
  )
399
  gr.Markdown("**Note:** Caption tone doesn't affect `rng-tags` and `training_prompt`.")
400
- with gr.Accordion("Advanced", open=False):
401
  with gr.Row():
402
- jc_text_model = gr.Dropdown(label="LLM Model", info="You can enter a huggingface model repo_id to want to use.",
403
  choices=get_text_model(), value=get_text_model()[0],
404
  allow_custom_value=True, interactive=True, min_width=320)
405
  jc_gguf = gr.Dropdown(label=f"GGUF Filename", choices=[], value="",
 
320
  # Custom CSS for neon purple theme
321
  css = """
322
  body {
323
+ background: linear-gradient(45deg, #1a0033, #4d0099);
324
+ color: #e6ccff;
325
+ font-family: 'Arial', sans-serif;
326
  }
327
  .gradio-container {
328
  max-width: 1200px !important;
329
  margin: auto;
330
  }
331
  .gr-button {
332
+ background: linear-gradient(90deg, #8a2be2, #9400d3) !important;
333
+ border: none !important;
334
  color: white !important;
335
+ font-weight: bold;
336
+ transition: all 0.3s ease;
337
  }
338
  .gr-button:hover {
339
+ background: linear-gradient(90deg, #9400d3, #8a2be2) !important;
340
+ box-shadow: 0 0 15px #9400d3;
341
  }
342
  .gr-form {
343
  border-radius: 15px;
344
  padding: 20px;
345
+ background-color: rgba(60, 19, 97, 0.7) !important;
346
+ box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
347
+ backdrop-filter: blur(10px);
348
  }
349
  .gr-box {
350
  border-radius: 15px;
351
+ background-color: rgba(75, 0, 130, 0.7) !important;
352
+ box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
353
+ backdrop-filter: blur(5px);
354
  }
355
  .gr-padded {
356
  padding: 20px;
357
  }
358
  .gr-form label, .gr-form .label-wrap {
359
+ color: #e6ccff !important;
360
+ font-weight: bold;
361
  }
362
  .gr-input, .gr-dropdown {
363
+ background-color: rgba(47, 1, 71, 0.8) !important;
364
+ border: 2px solid #8a2be2 !important;
365
+ color: #ffffff !important;
366
+ border-radius: 8px;
367
  }
368
  .gr-input::placeholder {
369
+ color: #b19cd9 !important;
370
  }
371
  .gr-checkbox {
372
+ background-color: #4b0082 !important;
373
+ border-color: #8a2be2 !important;
374
  }
375
  .gr-checkbox:checked {
376
+ background-color: #8a2be2 !important;
377
  }
378
  h1, h2, h3 {
379
+ color: #ffd700 !important;
380
+ text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
381
+ }
382
+ .gr-block {
383
+ border: none !important;
384
+ }
385
+ .gr-accordion {
386
+ border: 2px solid #8a2be2;
387
+ border-radius: 10px;
388
+ overflow: hidden;
389
+ }
390
+ .gr-accordion summary {
391
+ background-color: rgba(75, 0, 130, 0.9);
392
+ color: #ffd700;
393
+ padding: 10px;
394
+ font-weight: bold;
395
+ cursor: pointer;
396
  }
397
  """
398
 
399
  # Gradio interface
400
+ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
401
+ gr.HTML(
402
+ "<h1 style='text-align: center; color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);'>JoyCaption Alpha One Mod</h1>"
403
+ "<p style='text-align: center; color: #e6ccff;'>Generate captivating captions for your images!</p>"
404
+ )
405
  with gr.Row():
406
  with gr.Column(scale=1):
407
  with gr.Group():
 
424
  value="any",
425
  )
426
  gr.Markdown("**Note:** Caption tone doesn't affect `rng-tags` and `training_prompt`.")
427
+ with gr.Accordion("Advanced Settings", open=False):
428
  with gr.Row():
429
+ jc_text_model = gr.Dropdown(label="LLM Model", info="You can enter a Hugging Face model repo_id to use.",
430
  choices=get_text_model(), value=get_text_model()[0],
431
  allow_custom_value=True, interactive=True, min_width=320)
432
  jc_gguf = gr.Dropdown(label=f"GGUF Filename", choices=[], value="",