General Introduction
AI-ClothingTryOn is an open source Python-based desktop application created by developer speedTD and hosted on GitHub. It utilizes Google Gemini Artificial Intelligence technology that allows users to upload photos of people and pictures of clothes to generate virtual try-on results. Users can see how the clothes look on them and help decide whether to buy them or not. The program uses PyQt6 to create an intuitive interface through the Gemini API Processes images to generate realistic fitting results. This tool is suitable for online shopping enthusiasts, but also for developers who want to study AI technology. The project provides two ways of using EXE file and source code, which is convenient for different users.
Function List
- Upload photos: Supports uploading character photos and clothing pictures separately.
- Generate fitting results: Generate 10 different images of the fitting results at a time.
- Customized tips: Users can enter text prompts to adjust the AI generation effect.
- Save results: You can save your favorite try-on images locally.
- intuitive interface: Provides an easy-to-use graphical interface for convenient operation.
- batch file: Supports processing multiple images at the same time for efficiency.
Using Help
AI-ClothingTryOn is a desktop tool that can be used directly from a pre-compiled EXE file or run from source code. Below is a detailed installation and usage guide to help you get started quickly.
Installation process
Method 1: Use an EXE file (for normal users)
- download program
- Visit the GitHub page at https://github.com/speedTD/AI-ClothingTryOn.
- Download the latest version of the EXE file in the Releases section.
- If your browser is blocking the EXE download, you can use the alternate link to download the ZIP file:
https://mega.nz/file/pYpkQbzJ#exFxB7T2QhQFbMUzza1xx_KeAajMreSy3MdBgZOKuQM
- After downloading and extracting the ZIP file, locate the
AI-ClothingTryOn.exe
The
- running program
- double-click
AI-ClothingTryOn.exe
Initiation. - When you run it for the first time, you will be prompted to enter the Google Gemini API Key.
- double-click
- Configuring the API Key
- Refer to the "Get Google Gemini API Key" section below to get the key.
- Enter the key into the program pop-up window, or save it to the project root directory in the
api_key.txt
Documentation.
Method 2: Use of source code (for developers)
- Preparing the environment
- Install Python 3.8 or higher from the official Python website.
- Install the Git tool, download it from the Git website.
- Ensure that you have an Internet connection for calling the Gemini API.
- Download Code
- Open a terminal and enter the following command to clone the project:
git clone https://github.com/speedTD/AI-ClothingTryOn.git
- Go to the project catalog:
cd AI-ClothingTryOn
- Open a terminal and enter the following command to clone the project:
- Installation of dependencies
- Run the following command to install the required libraries:
pip install -r requirements.txt
- If there is a lack of
requirements.txt
, manually install the core libraries:pip install pyqt6 google-generativeai pillow
- Run the following command to install the required libraries:
- running program
- Enter the command to start:
python main.py
- Enter the command to start:
Get Google Gemini API Key
- Open your browser and visit Google AI Studio.
- Sign in with your Google account.
- Find the "API Keys" option on the page and click "Create New Key".
- Copy the generated API Key.
- Paste the key into the program prompt box, or save it to the
api_key.txt
Documentation.
Main Functions
Upload photos
- After launching the program, there are two buttons on the interface: "Select People Photo" and "Select Clothes Photo".
- Click on "Select People Photo" and upload a clear full body photo (JPG or PNG format is recommended).
- Click on "Select Clothing Photo" and upload a picture of your clothing (preferably front view, unobstructed).
- Photos are automatically saved to the
uploads/
Folder.
Generate fitting results
- Once you have uploaded your photos, click on the "Generate 10 Try-On Pictures" button.
- The program calls the Google Gemini API to generate 10 different images of how the fitting will look.
- The generation process takes a few seconds to a few minutes, depending on network speed and image size.
- The results are displayed in the interface and also saved to the
results/
Folder.
Customized tips
- In the text box on the interface, you can enter prompts, such as "Wear in outdoor scenes" or "Adjust for a tight fit".
- Enter it and click the Generate button again, and the AI will adjust the result according to the prompts.
Save results
- There is a "Save" button below the 10 images generated.
- Click "Save" and select the save path, the image will be stored in JPG format.
caveat
- Picture Requirements: Photos of people need to be fully visible, and pictures of clothes need to be clear and free of background distractions.
- network requirement: The program needs to be networked to call the Gemini API.
- Fee reminders: The Google Gemini API may incur fees depending on usage, so we recommend checking Google's official pricing.
- error handling: If the program crashes, check that the API Key is correct, or verify that the network connection is working.
Advanced Use
- Adjustment code: Developers can modify
main.py
, such as increasing the number of generated images or optimizing the interface. - Multi-threaded optimization: The program uses multiple threads to process images, and users who know how to program can adjust the thread parameters to increase the speed.
- Contribution projects: If you find a problem or have a suggestion for improvement, you can Fork the project and submit a Pull Request.
With these steps, you can try on clothes with AI-ClothingGENERATE and experience the convenience of AI.
application scenario
- Online Shopping Decision
Users look at a piece of clothing on an e-commerce platform and use this tool to upload their photo and a picture of the clothing to generate a fitting effect and determine whether it is suitable for purchase. - Clothing Matching Test
Users who want to try different combinations of clothes can upload multiple pictures of clothes to generate multiple try-on effects and find the best match. - AI technical learning
Students or developers can study the project code and learn how to develop desktop applications with the Google Gemini API and PyQt6.
QA
- Is this tool free?
The program itself is free, but using the Google Gemini API may incur a fee, depending on Google's rates. - Do I need to network?
Yes, the program relies on the Google Gemini API and must be networked to generate images. - Is the generation effect real?
Results depend on the quality of the photo and the cue word. Mostly realistic, but complex backgrounds may affect the results. - Can I try on more than one dress at a time?
The current version processes one garment at a time, multiple pieces require multiple runs.