This project is a Chrome extension that lets users try new outfits on a person using the Nano Banana API. Upload one image and the AI generates a photorealistic result where only the clothing is changed, while the face, pose, body, and background remain untouched.
- πΈ Upload a single photo
- π Replace only the clothing while keeping everything else unchanged
- β‘ One-click Fit Check button
- π Preview AI-generated results directly in the extension popup
- Nykaa
- Myntra
- More platforms coming soon...
-
Clone this repository
git clone [https://github.com/anoopw3bdev/tryon.git](https://github.com/anoopw3bdev/tryon.git) cd tryon
-
Add your API key Open the file
service-worker.js
and set your Nano Banana API key:const API_KEY = "replace this with your API key";
Steps to get your API KEY.
- Go to Google AI Studio (https://aistudio.google.com/apikey).
- Log in with your Google Account.
- Look for and click the βGet API Keyβ button (usually in the dashboard or main menu).
- Click βCreate API Key.β
- If prompted, select an existing Google Cloud project or create a new one.
β οΈ Warning
Please note that the free-tier API may not always work as expected.
You might need to use the free credits provided by google cloud. -
Load the extension in Chrome
- Open Chrome and go to
chrome://extensions/
- Turn on Developer mode
- Click Load unpacked
- Select the project folder (where
manifest.json
is located)
- Open Chrome and go to
-
Use the extension
- Click the "AI Outfit Fit Check" icon in the Chrome toolbar
- Upload your photo
- Click "Fit Check"
- View your generated outfit in the popup π
- Uses a service worker for API requests
- Sends image data as base64 to the Nano Banana API
- Outfit replacement prompt is inside
service-worker.js
- Check logs at
chrome://extensions/
β clickbackground page
- Verify your API key is correct
- Use clear, high-resolution images for best results