A Next.js application that generates custom DC comic-style cover art using AI. Simply enter a creative prompt and watch as the app creates stunning vintage comic book covers powered by Replicate's API and a fine-tuned LoRA model.
The DC Comic Cover Generator is a web application that transforms text prompts into professional-looking comic book covers. Built with Next.js 15 and powered by Replicate's AI API, it uses a custom fine-tuned LoRA model (resilientcoders/calvin-comic-cover) to generate images that capture the essence of classic DC comic book aesthetics.
- 🎯 AI-Powered Generation: Creates custom comic book covers from text prompts
- 🔤 Smart Prompting: Uses the
dccomictrigger word for optimal results - 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- ⚡ Stateless Architecture: Fully serverless deployment with no file system dependencies
- 🛡️ Type-Safe: Built with TypeScript for robust error handling
- 🔍 Comprehensive Logging: Detailed diagnostic logging for debugging
- 🌐 Production Ready: Deployed on Vercel with automatic scaling
- Frontend: Next.js 15 with App Router
- Language: TypeScript 5.0
- Styling: CSS Modules with custom styling
- AI API: Replicate API with custom LoRA model + Stable Diffusion 1.5
- Deployment: Vercel (serverless)
- Package Manager: npm
-
Clone the repository
git clone <repository-url> cd comic-cover-app
-
Install dependencies
npm install
-
Create environment file Create a
.env.localfile in the root directory:REPLICATE_API_TOKEN=your_replicate_api_token_here
-
Get your Replicate API token
- Sign up at replicate.com
- Navigate to your account settings
- Generate a new API token
- Copy the token to your
.env.localfile
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
-
Generate your first cover
- Enter a creative prompt (e.g., "superman flying over metropolis")
- The app automatically prepends
dccomicfor optimal results - Wait for the AI to generate your custom comic cover
This application is designed for stateless deployment on Vercel:
- No file system writes: Images are returned as base64 data URLs
- Serverless architecture: Scales automatically with demand
- Zero configuration: Deploys directly from GitHub
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard:
REPLICATE_API_TOKEN: Your Replicate API token
- Deploy: Vercel automatically builds and deploys your app
# Install Vercel CLI
npm i -g vercel
# Deploy to production
vercel --prodTry these prompts for best results:
superman flying over metropolis at sunsetbatman crouched on gotham city rooftopswonder woman defending themysciraflash running through central citygreen lantern creating constructs in space
Note: The app automatically prepends dccomic to your prompt for optimal model performance.
comic-cover-app/
├── app/
│ ├── api/
│ │ └── generate/
│ │ └── route.ts # API endpoint for image generation
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout with metadata
│ └── page.tsx # Main application page
├── public/ # Static assets
├── .env.local # Environment variables (not tracked)
├── next.config.ts # Next.js configuration
├── package.json # Dependencies and scripts
└── README.md # This file
Generates a comic book cover from a text prompt.
Request Body:
{
"prompt": "superman flying over city"
}Response:
{
"imageUrl": "data:image/webp;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}The application includes comprehensive error handling:
- API Token Validation: Ensures Replicate API token is configured
- Input Validation: Validates prompt input
- Network Error Handling: Graceful handling of API failures
- Detailed Logging: Extensive diagnostic logging for debugging
- Fast Generation: Optimized for quick image generation
- Efficient Rendering: Base64 data URLs for instant display
- Minimal Bundle: Optimized build with tree shaking
- CDN Delivery: Vercel's global CDN for fast loading
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- AI Model: Fine-tuned LoRA model trained under the Resilient Coders AI Fellowship
- Model Training: Custom training on DC comic book cover dataset
- API: Powered by Replicate
- Framework: Built with Next.js
- Deployment: Hosted on Vercel
- Live Demo: View the deployed application
- Replicate Model:
resilientcoders/calvin-comic-cover - Documentation: Next.js Docs
- Replicate API: Replicate Documentation

