- Custom nodes extending the CustomNodeclass for specialized processing
- LLM-powered story generation
- External API integration (MiniMax) for image generation
- Parallel processing for efficiency
- Error handling and retry logic
Watch the Demo
Architecture
- Backend: Inworld Runtime + Express.js + Minimax API
- Frontend: Static HTML + JavaScript
- Communication: HTTP
Run the Template
- Clone the comic generator GitHub repo.
- 
Set up your API keys by creating a .envfile in the project’s root directory with your required API keys:.env- Set INWORLD_API_KEYto your Base64 Runtime API key.
- Set MINIMAX_API_KEYto your Minimax API key for image generation.
 
- Set 
- 
Install dependencies and start the server:
The server will start on port 3003 (or the port specified in your PORT environment variable).
- 
Open your browser and navigate to http://localhost:3003to access the comic generation interface.
- 
Create a comic by filling in the form:
- Character 1 Description: e.g., “A brave knight with shiny armor”
- Character 2 Description: e.g., “A wise old wizard with a long beard”
- Art Style: e.g., “anime manga style” or “cartoon style”
- Theme (optional): e.g., “medieval adventure”
 
- 
Click “Generate Comic” and wait for the processing to complete. You can check the status or view recent comics through the interface.
 
- Check out your captured traces in Portal!
Understanding the Template
The core functionality of the comic generator is contained incomic_server.ts, which orchestrates a graph-based processing pipeline using custom nodes and built-in Inworld Runtime components.
The template creates a processing pipeline that transforms user input through multiple AI processing stages to generate complete 4-panel comics.
1) Custom Node Implementation
The template defines custom nodes by extending theCustomNode class for specialized comic generation operations:
comic_story_node.ts
2) Node Creation
After defining custom node classes, the graph creates instances of both custom and built-in nodes:comic_server.ts
3) Core Graph Construction
With all nodes created, the comic generation pipeline is assembled usingGraphBuilder by connecting each processing stage:
comic_server.ts
4) Graph Execution
Once the graph is built, the server uses it to process comic generation requests asynchronously. When a user submits a comic request through the REST API, the following execution flow begins:comic_server.ts
5) Response Handling
As the graph processes through each stage, the application monitors the output stream and manages the comic generation lifecycle. This enables real-time status tracking and provides users with immediate feedback:comic_server.ts