StyleSwap AI is a modern web application that allows you to effortlessly change the clothing in your photos with the power of generative AI. Simply upload an image, describe the outfit you want to see, and let the AI create a new version of your photo with a brand-new look.
- Easy Image Upload: Upload photos directly from your device (PNG, JPG, etc.).
- Descriptive Text Prompts: Describe any outfit you can imagine, from a "classic black tuxedo" to "a futuristic neon-lit jacket".
- AI-Powered Outfit Swapping: The core feature uses a generative AI model to replace the outfit in the original image while preserving the person's pose, face, and the background.
- Download Your Creation: Save the generated image to your device with a single click.
- Responsive Design: A clean, modern, and responsive user interface that works on both desktop and mobile devices.
This project is built with a modern, type-safe, and performant technology stack:
- Framework: Next.js (utilizing the App Router)
- Language: TypeScript
- UI Components: React with beautifully designed and accessible components from ShadCN UI.
- Styling: Tailwind CSS for a utility-first CSS workflow.
- Generative AI: Genkit orchestrates the AI flow, using Google's Gemini model for the image generation.
- Form Handling: Server actions for robust and progressive form submissions.
Follow these instructions to get a local copy up and running for development and testing purposes.
You need to have Node.js (version 20 or later) and a package manager like npm installed on your machine.
-
Clone the repository (or download the source code):
git clone https://github.com/aman179102/Style-Swap-Ai.git cd Style-Swap-Ai -
Install dependencies:
npm install
-
Set up environment variables: Create a file named
.envin the root of your project and add your Google AI API key. You can get a key from Google AI Studio.GEMINI_API_KEY=your_google_api_key_here -
Run the development server:
npm run dev
-
Open the application: Open your browser and navigate to http://localhost:9002 to see the application in action.
- Click on the "Upload Photo" area to select an image of a person from your computer.
- In the "Describe Outfit" text box, type a clear description of the new clothes you want the person to wear.
- Click the "Generate" button.
- Wait for the AI to process the image. The new photo will appear in the right-hand panel.
- If you like the result, click the "Download Image" button to save it.
Made with ❤️ by Aman Kumar ✨