fizzarif7 commited on
Commit
858008a
Β·
verified Β·
1 Parent(s): 469bddf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +63 -25
app.py CHANGED
@@ -221,11 +221,11 @@ with gr.Blocks(
221
  }
222
 
223
  .gr-button {
224
- border-radius: 8px;
225
- font-weight: 600;
226
- padding: 10px 18px;
227
- transition: 0.3s ease;
228
- box-shadow: 0 2px 6px rgba(0,0,0,0.1);
229
  }
230
 
231
  #generate-btn,
@@ -235,8 +235,8 @@ with gr.Blocks(
235
  #done-btn,
236
  #tts-btn,
237
  #recreate-scene-index {
238
- background-color: #ffffff;
239
- color: black;
240
  border: 1px solid #000000;
241
  }
242
 
@@ -265,10 +265,10 @@ with gr.Blocks(
265
  #reset-btn:hover,
266
  #done-btn:hover,
267
  #tts-btn:hover{
268
- background: linear-gradient(to right, #3498db, #2980b9);
269
- color: white;
 
270
  cursor: pointer;
271
- transition: background 0.3s ease;
272
  }
273
 
274
  #theme-input,
@@ -302,6 +302,27 @@ with gr.Blocks(
302
  outline: none;
303
 
304
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
 
306
  .gr-accordion {
307
  background-color: #d4a373;
@@ -335,10 +356,27 @@ with gr.Blocks(
335
  font-family: 'Comic Sans MS', cursive, sans-serif;
336
  }
337
 
338
- @keyframes float {
339
- 0% { transform: translateY(0px); }
340
- 50% { transform: translateY(-10px); }
341
- 100% { transform: translateY(0px); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  }
343
 
344
  """) as demo:
@@ -346,24 +384,24 @@ with gr.Blocks(
346
  gr.Markdown("Describe your story one scene at a time, with AI-generated images, summaries, and explanations.\nPut your own GOOGLE API KEY (named as GOOGLE_API_KEY) in the SECRET VARIABLE.")
347
 
348
  with gr.Accordion("🧩 Story Setup", open=True):
349
- title = gr.Textbox(label="πŸ“– Story Title", placeholder="e.g. The Enchanted Forest")
350
- scene_total = gr.Number(label="πŸ”’ Number of Scenes", precision=0, value=3, elem_id="scene-count")
351
- theme = gr.Textbox(label="🌍 Global Theme", placeholder="e.g. A magical forest full of glowing creatures", elem_id="theme-input")
352
 
353
  gr.Markdown("### ✨ Describe Your Next Scene")
354
 
355
  with gr.Group():
356
  with gr.Row():
357
- char_count = gr.Number(label="πŸ‘₯ Number of Characters", precision=0, value=2, elem_id="char-count")
358
- character_names = gr.Textbox(label="πŸ§™β€β™‚οΈ Character Names", elem_id="char-names")
359
  with gr.Row():
360
- dialogue = gr.Textbox(label="πŸ’¬ Dialogue (optional)", placeholder="e.g. 'Protect the forest!'", elem_id="dialogue-input")
361
- dialogue_speaker = gr.Textbox(label="πŸ—£οΈ Who says the dialogue?", placeholder="e.g. Bramble", elem_id = "dialogue-speaker")
362
 
363
  with gr.Row():
364
- char_styles = gr.Textbox(label="πŸ§₯ Outfit Descriptions", placeholder="e.g. Elora wears a leafy cloak, Bramble has a warrior vest", elem_id="char-styles")
365
- char_moods = gr.Textbox(label="😠 Character Moods", placeholder="e.g. Elora is cautious, Bramble is brave", elem_id="char-moods")
366
- bg_style = gr.Dropdown(label="🎨 Background Style", choices=["Realistic", "Cartoon", "Fantasy", "Dark Fantasy"], value="Fantasy", elem_id="bg-style")
367
 
368
  with gr.Row():
369
  generate_btn = gr.Button("βž• Generate The Scene", elem_id="generate-btn")
@@ -373,7 +411,7 @@ with gr.Blocks(
373
  recreate_btn = gr.Button("πŸ”„ Recreate The Scene", elem_id="recreate-btn")
374
  reset_btn = gr.Button("\n⏭️ Reset", elem_id="reset-btn")
375
 
376
- status = gr.Markdown()
377
  image_output = gr.Image(label="πŸ–ΌοΈ Scene Image", type="pil")
378
  summary_output = gr.Markdown(label="πŸ“ Scene Summary")
379
  explanation_output = gr.Textbox(label="πŸ“– Scene Explanation", lines=6)
 
221
  }
222
 
223
  .gr-button {
224
+ border-radius: 10px;
225
+ font-weight: bold;
226
+ padding: 12px 24px;
227
+ transition: all 0.4s ease;
228
+ box-shadow: 0 4px 10px rgba(0,0,0,0.15);
229
  }
230
 
231
  #generate-btn,
 
235
  #done-btn,
236
  #tts-btn,
237
  #recreate-scene-index {
238
+ background-color: linear-gradient(135deg, #a18cd1, #fbc2eb);
239
+ color: white;
240
  border: 1px solid #000000;
241
  }
242
 
 
265
  #reset-btn:hover,
266
  #done-btn:hover,
267
  #tts-btn:hover{
268
+ background: linear-gradient(135deg, #ff9a9e, #fad0c4);
269
+ transform: scale(1.05);
270
+ color: #000;
271
  cursor: pointer;
 
272
  }
273
 
274
  #theme-input,
 
302
  outline: none;
303
 
304
  }
305
+
306
+ input, textarea, select {
307
+ border-radius: 8px !important;
308
+ border: 1px solid #ccc !important;
309
+ padding: 10px !important;
310
+ background-color: #fff5fc;
311
+ box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
312
+ transition: all 0.2s ease-in-out;
313
+ }
314
+ input:focus, textarea:focus, select:focus {
315
+ border-color: #ff80ab !important;
316
+ box-shadow: 0 0 6px rgba(255, 105, 180, 0.3);
317
+ outline: none;
318
+ }
319
+
320
+ /* πŸŽ† Scene Image Border */
321
+ .gr-image img {
322
+ border: 4px dashed #ffb6b9;
323
+ border-radius: 16px;
324
+ padding: 4px;
325
+ }
326
 
327
  .gr-accordion {
328
  background-color: #d4a373;
 
356
  font-family: 'Comic Sans MS', cursive, sans-serif;
357
  }
358
 
359
+ @keyframes float {
360
+ 0% { transform: translateY(0px); }
361
+ 50% { transform: translateY(-10px); }
362
+ 100% { transform: translateY(0px); }
363
+ }
364
+
365
+ @keyframes floatX {
366
+ 0% { transform: translateX(0); }
367
+ 50% { transform: translateX(15px); }
368
+ 100% { transform: translateX(0); }
369
+ }
370
+
371
+ @keyframes pulseColor {
372
+ 0% { color: #ff4081; }
373
+ 50% { color: #7e57c2; }
374
+ 100% { color: #42a5f5; }
375
+ }
376
+
377
+ @keyframes backgroundMove {
378
+ 0% { background-position: 0% 50%; }
379
+ 100% { background-position: 100% 50%; }
380
  }
381
 
382
  """) as demo:
 
384
  gr.Markdown("Describe your story one scene at a time, with AI-generated images, summaries, and explanations.\nPut your own GOOGLE API KEY (named as GOOGLE_API_KEY) in the SECRET VARIABLE.")
385
 
386
  with gr.Accordion("🧩 Story Setup", open=True):
387
+ title = gr.Textbox(label="πŸ“– Story Title", placeholder="e.g. The Enchanted Forest",elem_id="textarea")
388
+ scene_total = gr.Number(label="πŸ”’ Number of Scenes", precision=0, value=3, elem_id="input")
389
+ theme = gr.Textbox(label="🌍 Global Theme", placeholder="e.g. A magical forest full of glowing creatures", elem_id="textarea")
390
 
391
  gr.Markdown("### ✨ Describe Your Next Scene")
392
 
393
  with gr.Group():
394
  with gr.Row():
395
+ char_count = gr.Number(label="πŸ‘₯ Number of Characters", precision=0, value=2, elem_id="input")
396
+ character_names = gr.Textbox(label="πŸ§™β€β™‚οΈ Character Names", elem_id="textarea")
397
  with gr.Row():
398
+ dialogue = gr.Textbox(label="πŸ’¬ Dialogue (optional)", placeholder="e.g. 'Protect the forest!'", elem_id="textarea")
399
+ dialogue_speaker = gr.Textbox(label="πŸ—£οΈ Who says the dialogue?", placeholder="e.g. Bramble", elem_id = "txtarea")
400
 
401
  with gr.Row():
402
+ char_styles = gr.Textbox(label="πŸ§₯ Outfit Descriptions", placeholder="e.g. Elora wears a leafy cloak, Bramble has a warrior vest", elem_id="textarea")
403
+ char_moods = gr.Textbox(label="😠 Character Moods", placeholder="e.g. Elora is cautious, Bramble is brave", elem_id="textarea")
404
+ bg_style = gr.Dropdown(label="🎨 Background Style", choices=["Realistic", "Cartoon", "Fantasy", "Dark Fantasy"], value="Fantasy", elem_id="select")
405
 
406
  with gr.Row():
407
  generate_btn = gr.Button("βž• Generate The Scene", elem_id="generate-btn")
 
411
  recreate_btn = gr.Button("πŸ”„ Recreate The Scene", elem_id="recreate-btn")
412
  reset_btn = gr.Button("\n⏭️ Reset", elem_id="reset-btn")
413
 
414
+ status = gr.Markdown(class=gr-image)
415
  image_output = gr.Image(label="πŸ–ΌοΈ Scene Image", type="pil")
416
  summary_output = gr.Markdown(label="πŸ“ Scene Summary")
417
  explanation_output = gr.Textbox(label="πŸ“– Scene Explanation", lines=6)