
Weekend Creative Challenge: Caricature Me!
Upload a photo, pick sketch or colored style, and get an AI-generated caricature in seconds — built with React, AWS Lambda, API Gateway, and Amazon Bedrock's Nova Canvas model.
🎨 Vision & what the app does
Caricature Me! turns any uploaded photo into a fun, AI-generated caricature portrait. No paid tools, no waiting on a human artist — just upload a photo, pick a style, and get a playful result in seconds.
Two creative outputs:
- ✏️ Sketch — black-and-white pencil-style line art
- 🎨 Colored — vibrant, painted illustration style
The goal was pure fun — something you'd send to a friend to make them smile, not a hyper-realistic editing tool. The UI matches that mood: a soft floral color palette, a hand-drawn script logo, a dashed drop-zone for uploads, and small animated touches throughout.
How I built it
Frontend first. React + Vite + Tailwind CSS. I went through a couple of visual directions before landing on a warm, hand-drawn floral palette (mauve, willow purple, caramel, sango pink) that fit the "creative and fun" brief better than my first bold pop-art attempt.
Backend, serverless. An AWS Lambda function (Node.js 20) takes the uploaded photo as base64 JSON, builds a style-specific prompt, and calls Amazon Bedrock's Nova Canvas model with the
IMAGE_VARIATION task type. The result gets written to S3, and Lambda returns a signed URL for the frontend to display and download.Key challenges:
- CORS/API Gateway permissions — my HTTP API's default route swallowed the OPTIONS preflight, so every call got blocked before reaching Lambda. Fixed by correcting the Lambda resource policy's ARN pattern so API Gateway was actually authorized to invoke it.
- Silent
.envfailure — my.envfile sat one folder above the actual Vite project root, soVITE_API_URLresolved toundefinedat build time with no error. Moving it into the right folder fixed it instantly.
- Bedrock quota on a new account — every image-model quota (Nova Canvas, Titan Image Generator G1/G2) came back at 0 despite model access showing "granted." CloudWatch logs confirmed
ThrottlingExceptionerrors from Bedrock itself, not my code. I filed an AWS Support case, and in the meantime verified the entire pipeline end-to-end via CLI — Lambda, API Gateway, IAM, and S3 all work correctly, so the app generates real images the moment the quota activates.
- Amplify Gen 1 stopped accepting new apps mid-build — I pivoted to plain S3 static website hosting instead, which works just as well for the Free Tier requirement.
I also added a simple S3-backed request counter to cap generations at 10 per deployment, so testing can't accidentally rack up unexpected Bedrock cost.
AWS services used / architecture overview
User Browser | vAmazon S3 (Static website hosting) | HTTPS POST vAmazon API Gateway (HTTP API, Auth: NONE) | vAWS Lambda (Node.js 20, 1024MB, 60s timeout) | | v vAmazon Bedrock Amazon S3(Nova Canvas) (result PNG) | | +---------+----------+ | v Presigned S3 URL | v User views/downloads the caricatureServices breakdown
Service | Purpose | Why I chose it |
|---|---|---|
Amazon S3 (Static Hosting) | Frontend hosting | Free tier eligible, simple deploy via CLI, no server to manage |
Amazon API Gateway | Public HTTP endpoint | Lightweight HTTP API, pay-per-request, connects directly to Lambda |
AWS Lambda | Backend compute | Serverless, pay per request, no idle cost |
Amazon Bedrock (Nova Canvas) | AI caricature generation | Purpose-built image model, no infrastructure or model hosting needed |
Amazon S3 (Results bucket) | Image storage + delivery | Presigned URLs give secure, time-limited access to generated images |
IAM | Access control | Least-privilege role scoped to only Bedrock invoke + results bucket read/write |
What I learned
This was my first time wiring API Gateway, Lambda, and Bedrock together entirely via AWS CLI rather than a console wizard or framework — which forced me to actually understand IAM trust policies, resource-based Lambda permissions, and how HTTP API routes handle CORS differently from REST APIs. I also learned that new AWS accounts can have image-generation quotas locked at zero even after "model access" shows as granted — a distinction I didn't know existed before this weekend. On the frontend side, I got much more comfortable with Tailwind's config-driven theming, building a custom palette and font system instead of relying on defaults.
🔗 Link to app / repo
- Live app: https://d32fk92ybzfhd0.cloudfront.net/
- GitHub repo: https://github.com/sadiasaleem20/caricature-app
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article