This repository contains an agentic pipeline for generating comic books, built using the Google Agent Development Kit (ADK) and Vertex AI.
It is based on the solution to the codelab: Create a low-code agent with ADK visual builder
- Automated Scripting: Generates creative comic scripts and character manifests from high-level prompts.
- Intelligent Panelization: Breaks down scripts into exactly 8 storyboarded panels.
- AI Image Synthesis: Generates 16:9 images for each panel using Vertex AI.
- HTML Assembly: Compiles the final artwork and script into a responsive HTML comic book.
- Cloud Deployment: Scripts included for deploying agents to Google Cloud Run.
- Low-Code Interface: Use the ADK Builder for visual agent development.
Agent1/: A basic agent featuring a Google Search tool. Usesroot_agent.yaml.Agent2/: An agent focused on image generation using sub-agents. Usesroot_agent.yamlandsub_agent_*.yaml.Agent3/: The primary comic pipeline implementation.root_agent.yaml: The Studio Director agent that manages the pipeline.comic_pipeline_agent.yaml: Orchestrates theSequentialAgentworkflow.tools/: Custom Python tools for image generation and file handling.
images/: Directory where intermediate panel images are stored.output/: The final output directory containingcomic.htmland assets.
agent_builder: Launches the ADK Builder UI (accessible via browser) for visual agent design.myadk: A convenience wrapper for theadkCLI tool.comic.sh: Starts a local web server (port 8080) to view the generated comic.deploycloudrun.py: Automates deployment to Google Cloud Run, including IAM and Service Account setup.fix_comic.py: Manual utility to regenerate thecomic.htmlwith a default story (Momotaro).init.sh: Comprehensive setup script to configure the GCP project, enable APIs, and install dependencies.set_env.sh/set_adc.sh: Helpers to set environment variables and refresh Application Default Credentials.
make run: Runsadk web .to start the ADK development server.make web: Startsadk webon all interfaces (0.0.0.0).make clean: Removes log files, generated images, and temporary cache directories.make test: Runsfix_comic.pyto validate the HTML generation.make deploy: Deploys the project usingdeploycloudrun.py.make comic: Launches a server specifically for theoutput/directory on port 8000.
The system uses a Studio Director agent (root_agent.yaml) that delegates to a SequentialAgent (comic_pipeline_agent.yaml), coordinating four specialized stages:
- Scripting Agent: Narrative and Character Architect.
- Panelization Agent: Cinematographer and Storyboarder.
- Image Synthesis Agent: Technical Artist and Asset Generator.
- Assembly Agent: Frontend Developer for final packaging.
- Environment Variables: After editing
.env, runsource .envor./set_env.shto update your shell. - YAML Nesting: The ADK CLI may nest YAML configurations in subdirectories incorrectly. They must be moved to the root of the respective agent's directory.
- Issue Tracking: See google/adk-python Issue #4134.
- Initialize Project: Run
./init.shto set up your Google Cloud project, enable necessary APIs, and install dependencies. - Verify Environment: Ensure
GOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONare set in the.envfile. - Run Pipeline: Execute the comic creation pipeline for Agent3:
adk run Agent3 --input "Create me a comic about a space explorer on a neon planet." - View Results: Run
./comic.shand openhttp://localhost:8080in your browser.
To deploy an agent (default Agent1) to Google Cloud Run:
make deployNote: Edit deploycloudrun.py to change the default target agent.