A web-based application that transforms images into comic book panels using OpenAI's image editing API. Upload a base image, provide captions for each panel, and generate a complete comic book layout.
- Image Upload: Support for JPG, PNG, and WebP formats
- Multi-Panel Generation: Create multiple comic panels from a single base image
- Customizable Prompts: Add custom prompt prefixes to control the comic style
- Advanced Settings: Configure image model, quality, fidelity, and output format
- Multiple Download Options:
- Download individual panels as JPG or PNG
- Download all panels as a ZIP archive
- Generate and download complete HTML comic layout
- Custom HTML Templates: Use AI-generated or default HTML templates for comic presentation
- Persistent Settings: API settings are saved locally for convenience
- Modern web browser with JavaScript enabled
- OpenAI API key with access to image editing endpoints
- Internet connection for API calls and CDN resources
- Clone or download this repository
- Open
index.htmlin a web browser - Click on "API Settings" to configure your OpenAI credentials:
- Enter your OpenAI API key
- Optionally modify the base URL (defaults to OpenAI's official endpoint)
- Configure API Settings: Expand the API Settings section and enter your OpenAI API key
- Upload Base Image: Select an image file (JPG, PNG, or WebP) to use as the foundation for your comic
- Add Captions: Enter one caption per line in the text area. Each line will generate a separate comic panel
- Adjust Advanced Settings (optional):
- Modify the prompt prefix to control the artistic style
- Select image quality and fidelity settings
- Choose output format preferences
- Customize HTML template generation prompts
- Generate Comic: Click "Generate Comic" to create your panels
- Download Results: Choose from multiple download options once generation is complete
The application uses OpenAI's image editing API with the following default settings:
- Model:
gpt-image-1 - Input Fidelity: High
- Quality: High
- Output Format: JPEG
- HTML Generation: Uses
gpt-4o-minifor custom template creation
comicgen/
├── index.html # Main application interface
├── script.js # Core application logic and API integration
└── README.md # This documentation file
The application uses the following external libraries via CDN:
- Bootstrap 5.3.0: UI framework and responsive design
- Font Awesome 6.0.0: Icons and visual elements
- JSZip 3.10.1: ZIP file generation for bulk downloads (loaded dynamically)
- Chrome 80+
- Firefox 75+
- Safari 13+
- Edge 80+
This application makes API calls to OpenAI's image editing endpoint. Costs depend on:
- Number of panels generated
- Image resolution and quality settings
- Custom HTML template generation (uses GPT-4o-mini)
Refer to OpenAI's pricing documentation for current rates.
- API keys are stored locally in browser localStorage
- Images are processed client-side before being sent to OpenAI
- No data is stored on external servers beyond OpenAI's processing
- Generated images are returned as base64 data and handled entirely client-side
API Key Issues:
- Ensure your OpenAI API key is valid and has access to image editing endpoints
- Check that your API key has sufficient credits
Image Upload Problems:
- Verify the image is in a supported format (JPG, PNG, WebP)
- Ensure the image file is not corrupted
Generation Failures:
- Check browser console for detailed error messages
- Verify internet connection for API calls
- Ensure the base URL is correctly configured
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly across different browsers
- Submit a pull request with a clear description of changes