AWS Builder Center

Weekend Creative Challenge: Meme Caption Generator(MEME LOCAL)

An AI-powered web app that turns any photo into three funny, ready-to-share meme captions — powered by Amazon Bedrock (Nova Lite), AWS Lambda, and API Gateway, with a frontend auto-deployed to GitHub Pages via GitHub Actions.

TL AWS SBG RTMSSU | Cyber Sec | Pen Testing | Python | Bash | SSH

Vision & What the App Does

Meme Caption Generator is a lighthearted creative tool built around one simple promise: "Drop a pic. Get three captions. Ship the meme." Users upload an image, and within seconds the app returns three witty, shareable meme captions generated by an AI vision model. Instead of staring at a blank caption box trying to be funny, people get a spark of inspiration they can copy, tweak, and post straight to their favorite platform.
The idea came from a very relatable problem most of us have a camera roll full of funny moments that never get turned into memes simply because thinking of a good caption takes effort. Meme Caption Generator removes that friction. It's not trying to be a full-blown meme editor with fonts and stickers; it deliberately stays focused on one creative task done well: looking at a picture and making people smile with words.

How I Built It

The build started with the core interaction: image in, captions out. I sketched the flow first a single-page frontend for upload and display, and a lightweight serverless backend for the actual AI work.
Frontend: A single  index.html  file with embedded CSS and JavaScript. Users drag-and-drop or click to upload a JPG/PNG image (up to 5 MB), see a live preview, and hit "Generate Captions." A playful loading message "Cooking up some jokes... 🍳" keeps things fun while the request is processed. The three returned captions render under "Pick your favourite 👇," each with a one-click copy button, plus a "Retry 🎲" option to reroll captions if none of them land.
Backend: An AWS Lambda function handles the heavy lifting. It receives the base64-encoded image via API Gateway, sends it to Amazon Bedrock's Nova Lite model with a carefully engineered prompt (asking for short, witty, non-literal captions rather than a plain image description), and returns the three options as JSON.
Key decisions:
  • Chose Nova Lite over a heavier model to stay comfortably within AWS Free Tier limits while keeping response times fast.
  • Kept the app stateless and auth-free, since this was a weekend build meant to be simple and public.
  • Decided to host the frontend separately on GitHub Pages and deploy it automatically through GitHub Actions, rather than manually uploading files this made every push to  main  instantly live.
Challenges & how I solved them:
  • CORS errors were the first roadblock once the frontend (GitHub Pages) and backend (API Gateway) lived on different origins. Fixed by explicitly enabling CORS on the API Gateway route and returning the correct headers from Lambda.
  • Prompt tuning took a few iterations — early responses were too literal ("a person holding a cup"), so I rewrote the prompt to explicitly forbid description and demand humor/observation instead.
  • Cold start latency on Lambda made the first request feel slow, mitigated by keeping the function lightweight and dependency-free.
  • Automating deployment: instead of manually copying files to GitHub Pages, I set up a GitHub Actions workflow that builds and deploys the  main  branch to the  gh-pages  branch on every push, so the live site always reflects the latest code without any manual step.

AWS Services Used / Architecture Overview

  • Amazon Bedrock (Nova Lite) — vision-capable model that analyzes the uploaded image and generates the meme captions.
  • AWS Lambda — serverless function that receives the image, calls Bedrock, and returns the captions as JSON.
  • Amazon API Gateway — exposes a public REST endpoint ( POST /generate-caption ) that connects the frontend to Lambda.
  • IAM — a scoped execution role for Lambda with  bedrock:InvokeModel  permission limited to the Nova Lite model.
Architecture flow:
User Browser (GitHub Pages frontend)
│ POST image (base64)
▼
Amazon API Gateway (public REST endpoint, CORS enabled)
│
▼
AWS Lambda (receives image, builds prompt)
│
▼
Amazon Bedrock — Nova Lite (vision model, generates 3 captions)
│
▼
JSON response → API Gateway → Frontend → Captions displayed
The frontend itself is deployed via GitHub Actions: a workflow triggers on every push to  main , builds the static site, and publishes it to GitHub Pages automatically — no manual FTP or console uploads involved.

What I Learned

This challenge was my first real hands-on experience with Amazon Bedrock's vision capabilities, and a few things stood out:
  • Prompt engineering matters just as much for vision models as text models — being explicit about tone and what not to do (e.g., "don't describe, joke instead") dramatically improved output quality.
  • Serverless architecture (Lambda + API Gateway) is genuinely fast to stand up for small, stateless AI-powered tools — no servers to manage, and it comfortably fits within Free Tier.
  • Setting up CI/CD with GitHub Actions for a static frontend was simpler than expected, and it's a habit I'll carry into future projects — even small weekend builds benefit from automated deploys instead of manual uploads.
  • Handling CORS correctly between two different origins (GitHub Pages + API Gateway) is a small detail that can block an entire app if overlooked, and it's worth testing early rather than at the end.
Overall, this was a great excuse to combine generative AI with a simple, fun use case — and a good reminder that creative tools don't need to be complicated to make people smile.

Link to App / Repo

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article