An end-to-end AI-based Virtual Try-On web application that allows users to visualize clothing on themselves using computer vision and generative AI. The system uses a Next.js frontend and a ComfyUI-based backend workflow, running on GPU, following a real-world AI system architecture.
- Upload a person image
- Select or upload a clothing image
- AI-powered realistic virtual try-on generation
- GPU-accelerated inference pipeline
- Fully self-hosted AI backend (no paid APIs)
- Clean, modern UI using Next.js
- Next.js
- React
- Tailwind CSS
- ComfyUI
- Stable Diffusion-based Virtual Try-On workflow
- Python
- GPU (Local machine or Cloud GPU)
- REST API-based communication
User → Next.js Frontend → ComfyUI Backend (GPU) → Generated Image → Frontend Display
- User uploads a person image
- User uploads/selects a clothing image
- Frontend sends images to the backend via API
- ComfyUI executes the virtual try-on workflow on GPU
- Generated image is returned and displayed to the user
This project follows a decoupled deployment architecture, similar to real-world AI systems.
- The Next.js frontend is deployed on Vercel
- Provides a publicly accessible UI
- Handles user interactions and API calls
- The ComfyUI backend is NOT publicly hosted
- Runs on a dedicated GPU machine (local or cloud)
- Exposed as a REST API when active
Due to the GPU-intensive and heavyweight nature of ComfyUI (large models, CUDA dependencies), it is not suitable for traditional web hosting platforms like Vercel or Netlify.
This approach mirrors industry practices where:
- UI is lightweight and cloud-hosted
- AI inference services run on isolated GPU machines
cd frontend
npm install
npm run devRuns on: http://localhost:3000
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt
python main.py- Load the provided virtual try-on workflow JSON
- Backend runs on:
http://localhost:8188
The frontend communicates with the backend using REST APIs.
const COMFYUI_API = "http://localhost:8188";For cloud GPU usage:
const COMFYUI_API = "http://<GPU_PUBLIC_IP>:8188";virtual-tryon/
│
├── frontend/
│ ├── components/
│ ├── pages/
│ └── utils/
│
├── comfyui/
│ └── virtual_tryon_workflow.json
│
└── README.md
- Virtual fashion try-on platforms
- AI-powered e-commerce applications
- Computer vision research
- Portfolio and resume projects
Dhruv Kumar AI/ML • Computer Vision • Full-Stack Development
- ComfyUI
- Stable Diffusion community