byte-vortex commited on
Commit
9b9a4ac
·
verified ·
1 Parent(s): d78401f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -1
app.py CHANGED
@@ -457,4 +457,42 @@ with gr.Blocks(theme=gr.themes.Citrus(), css=custom_css) as demo:
457
 
458
  with gr.Row():
459
  story_output = gr.Textbox(label="AI-Generated Story", lines=5, interactive=False, max_lines=10)
460
- dialogue
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
 
458
  with gr.Row():
459
  story_output = gr.Textbox(label="AI-Generated Story", lines=5, interactive=False, max_lines=10)
460
+ dialogue_output = gr.Textbox(label="AI-Generated Dialogue", lines=3, interactive=False, max_lines=5)
461
+
462
+ image_output = gr.Image(label="Comic Panel Art with Dialogue", type="pil", interactive=False)
463
+
464
+ submit_btn.click(
465
+ fn=generate_comic_panel,
466
+ inputs=scene_input,
467
+ outputs=[story_output, dialogue_output, image_output]
468
+ )
469
+
470
+ gr.Button("Clear All", variant="secondary").click(
471
+ fn=clear_all,
472
+ # Inputs should match the components you want to clear (their current values)
473
+ inputs=[scene_input, story_output, dialogue_output, image_output],
474
+ # Outputs should match the components you want to update (set to empty)
475
+ outputs=[scene_input, story_output, dialogue_output, image_output]
476
+ )
477
+
478
+ gr.Examples(
479
+ examples=[
480
+ ["A futuristic bounty hunter cyborg on a neon-lit rooftop, overlooking a dystopian city, in a cyberpunk comic art style, detailed, dark, atmospheric."],
481
+ ["A brave knight and a fire-breathing dragon sharing a cup of tea in a whimsical, enchanted forest, fantasy comic style, bright, joyful."],
482
+ ["A group of diverse superheroes soaring above a city skyline at dawn, preparing for battle against a giant robot, classic comic book art, dynamic, heroic."],
483
+ ["A mischievous alien chef attempting to bake an intergalactic pizza, causing a chaotic explosion of cosmic ingredients, cartoon comic style, messy, hilarious."],
484
+ ["An ancient vampire detective in a foggy London alley, investigating a mysterious case, gothic comic art, shadowy, suspenseful."],
485
+ ["A joyful space explorer discovering a new planet filled with sentient, singing plants, sci-fi comic art, vibrant, lush."],
486
+ ["A secret agent cat infiltrating a high-tech villain's lair, navigating laser grids with agility, spy comic style, sleek, intense."],
487
+ ["Two elderly grandmothers in a fierce magical duel using knitting needles as wands, in a cozy village square, humorous fantasy comic, lighthearted, quirky."],
488
+ ["A giant, friendly robot protecting a tiny, scared kitten from a thunderstorm in a modern city, heartwarming comic style, gentle, protective."],
489
+ ["A pirate crew of anthropomorphic animals searching for buried treasure on a deserted island, adventure comic style, sandy, lush."],
490
+ ],
491
+ inputs=scene_input,
492
+ outputs=[story_output, dialogue_output, image_output],
493
+ fn=generate_comic_panel, # Crucial: examples must specify a function to run
494
+ cache_examples=False,
495
+ )
496
+
497
+ if __name__ == "__main__":
498
+ demo.launch(share=False)