Turn any photo into viral, stylized images and auto-generate Instagram-ready captions using Google Gemini.
- Upload an image and transform it into trendy visual styles powered by Gemini 3
- Curated style presets (e.g., 3D Toy Figurine, Polaroid Photo, Magazine Cover)
- One-click download of generated images
- AI-generated Instagram caption with popular hashtags
- Clean, responsive UI built with TailwindCSS
- React 19 + Vite 7
- TailwindCSS 4
- Google Gemini API (image+text generation)
- Clone and install
git clone https://github.com/ersincodes/trendyAI.git
cd trendyAI
npm install- Set your API key
cp .env.example .env
# edit .env and set VITE_GOOGLE_API_KEY=your_key- Run the app
npm run dev- Build for production
npm run buildCreate a .env file in the project root based on .env.example:
VITE_GOOGLE_API_KEY=your_google_generative_language_api_key
This key is used by:
- Image generation:
gemini-3-pro-image-preview:generateContent - Caption generation:
gemini-3-flash-preview:generateContent
- Upload a photo (max 10MB). It’s read as Base64 in the browser.
- Choose a style preset. Each preset provides a carefully crafted prompt.
- Click “Transform Image”. The app sends the prompt + image to Gemini and receives a generated image.
- Optionally, click “Generate Instagram Caption” to get a short caption with hashtags.
- Download your final image.
src/
components/
ImageUploader.jsx # File input + preview
PromptSelector.jsx # Style preset grid
ResultPanel.jsx # Render result, download, caption actions
icons/Icons.jsx # Minimal icon set
constants/prompts.js # Curated prompt presets
App.jsx # App state, API calls, UI layout
index.css, App.css # Tailwind layers
- Client-only implementation; no server required
- Strict 10MB image size check and friendly error handling
- Accessible buttons/labels and keyboard-friendly interactions
- Safe filename generation for downloads
- Make sure your Google Generative Language API project has access to the referenced models.
- Never commit your real API key. Use
.envand the provided.gitignorealready excludes it.
npm run dev # Start local dev server
npm run build # Production build
npm run preview # Preview production build
npm run lint # Lint source filesMIT © 2025 Ersin Bahar
Created by Ersin Bahar · Instagram: @ersinbahaar