DEV Community

Yash Tiwari
Yash Tiwari

Posted on

Story Telling AI

Education Track: Build Apps with Google AI Studio

This post is my submission for DEV Education Track: Build Apps with Google AI Studio.

What I Built

I created this application which takes a short story as input and generates a comic page for that scenes .

Demo

StoryBoard -AI

My Experience

I started with exploring for ideas in Gemini then I thought it would be great to represent story in the form of Images / comic that I used to love reading as a kid.

Key prompts :-

Create a application which would take story as a input and generate a comic page based on the context using Imagen API .

Final prompt :-
An application that transforms a short story into a single comic book page using the Imagen API would be a powerful tool for visual storytelling. Here is a conceptual blueprint for how such an application could be designed and function.
Application Concept: "Storyboard AI"
Objective: To automatically generate a single-page comic book from a user-provided short story.

Core Functionality and Workflow
The application would operate through a sequence of automated steps:

  1. Story Input:
The user provides a short piece of text (e.g., a few paragraphs) that describes a scene or a brief narrative.
  2. Narrative Analysis and Panel Breakdown:
The application's backend would first employ Natural Language Processing (NLP) to deconstruct the story. This involves:
  3. Scene Segmentation: Identifying distinct moments or beats in the story that can be translated into individual comic panels.
  4. Entity Recognition: Pinpointing key characters, objects, and locations within the narrative.
  5. Action and Dialogue Extraction: Separating descriptive narration from character dialogue to determine what will become a caption and what will be placed in a speech bubble.
  6. Visual Prompt Generation for Imagen:
For each identified panel, the application would generate a detailed, descriptive prompt tailored for the Imagen API. Effective prompt engineering is crucial at this stage and would include:
  7. Art Style Definition: Specifying a consistent artistic style, such as "in the style of a modern graphic novel," "classic 1960s comic book art," or "manga-inspired black and white."
  8. Scene and Character Description: Detailing the setting, character appearances, and their specific actions or expressions in the panel.
  9. Compositional Framing: Suggesting camera angles and shot types, like "wide establishing shot," "over-the-shoulder view," or "dramatic close-up on the character's face."
  10. Image Generation via Imagen API:
The generated prompts are sent to the Imagen API, which then produces the visual images for each panel of the comic. The application would manage these API calls and retrieve the resulting images.
  11. Comic Page Composition:
Once the panel images are generated, the application would assemble them into a cohesive comic book page. This step includes:
  12. Panel Layout: Selecting a suitable layout based on the number of scenes identified. This could range from a simple two-panel strip to a more complex six-panel grid.
  13. Text Overlay:
    • Speech Bubbles: Placing the extracted dialogue into speech bubbles and positioning them appropriately over the speaking characters.
    • Narration Boxes: Inserting the descriptive narrative text into caption boxes, typically at the top or bottom of a panel.
  14. Gutter and Border Creation: Adding the blank space (gutters) between panels and a border around the entire page to give it a professional comic book look.
  15. Final Output:
The end product would be a single, high-resolution image file (e.g., JPEG or PNG) of the completed comic book page, ready for the user to download and share.

Hypothetical Example
Input Story:
The old detective, rain-soaked and weary, stood under the flickering neon sign of "The Blue Dahlia" diner. He clutched a crumpled photograph in his hand. "After all these years," he whispered to the empty street, "the trail ends here."
Conceptual Application Process:

  • Panel 1: A wide shot establishing the scene.
    • Imagen Prompt: "A rain-slicked city street at night, with a flickering neon sign that reads 'The Blue Dahlia.' A lone, weary detective in a trench coat stands beneath it. Modern comic book art style, dramatic lighting."
    • Narration Box: "The old detective, rain-soaked and weary, stood under the flickering neon sign of 'The Blue Dahlia' diner."
  • Panel 2: A close-up on the detective's hand.
    • Imagen Prompt: "Close-up shot of a man's hand holding a crumpled, old photograph. The edges are worn. The hand is wet from the rain. Detailed graphic novel illustration."
    • Narration Box: "He clutched a crumpled photograph in his hand."
  • Panel 3: A close-up on the detective's face.
    • Imagen Prompt: "Tight close-up on the face of an old, tired detective. Rain trickles down his face, his expression is a mix of resolve and sorrow. Muted color palette, comic book ink style."
    • Speech Bubble: "After all these years... the trail ends here." This conceptual framework outlines how the powerful generative capabilities of the Imagen API can be harnessed to create a sophisticated and user-friendly application for bringing written stories to life in a visually engaging comic book format.

Further I modified more and created Imagen API call again with generated image to restructure it into as a comic book .

Top comments (6)

Collapse
 
extinctsion profile image
Aditya

Niceee

Collapse
 
yash_tiwari_abb8918e0bb49 profile image
Yash Tiwari

thanks

Collapse
 
datatoinfinity profile image
datatoinfinity

Thats really impressive

Collapse
 
yash_tiwari_abb8918e0bb49 profile image
Yash Tiwari

thanks

Collapse
 
sudhansu_bandha_931b855f1 profile image
Sudhansu Bandha

Pretty Impressive!!!!

Collapse
 
annavi11arrea1 profile image
Anna Villarreal

sick