File size: 4,441 Bytes
aff4fc3
 
 
 
 
 
 
 
 
 
 
 
a07fceb
 
76e42dd
aff4fc3
 
 
 
78c94e9
 
7ac3fb3
78c94e9
 
aff4fc3
78c94e9
aff4fc3
78c94e9
aff4fc3
78c94e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5cb53e
78c94e9
 
 
 
a07fceb
78c94e9
 
 
 
 
 
 
 
a07fceb
78c94e9
 
cb2815f
78c94e9
 
a07fceb
78c94e9
 
 
 
 
 
e813dca
 
 
 
 
 
 
78c94e9
aff4fc3
78c94e9
f5cb53e
78c94e9
a07fceb
 
78c94e9
 
 
 
 
 
 
 
 
 
aff4fc3
78c94e9
3f4c0ad
 
 
 
 
 
 
78c94e9
aff4fc3
 
 
36003ef
aff4fc3
 
 
36003ef
aff4fc3
 
78c94e9
aff4fc3
78c94e9
 
 
a07fceb
78c94e9
 
 
 
 
 
 
 
 
35f4d27
78c94e9
 
aff4fc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
language:
- en
tags:
- ClothSwap
- TryOn
- StyleChange
- DressChange
- ClothShift
- TryCloth
- FashionNew
- SwapCloth
- DressSwap
- OutfitSwap
license: apache-2.0
---
##  StyleShift - Cloth Swap / Dress Swap / Style Change / Outfit Swap

This project showcases a Cloth Swap feature, leveraging the powerful capabilities of ComfyUI, a modular and flexible interface for AI workflows. This guide provides step-by-step instructions to set up, use, and contribute to the project.

<div align="center">
  <img width="600" height="500" alt="foduucom/ClothSwap" src="https://huggingface.co/foduucom/StyleShift-ClothSwap/resolve/main/output.png">
</div>

## Objective

The primary objective is to provide a simple, effective, and customizable tool for tasks such as virtual try-ons, creative prototyping, and realistic clothing mockups. Whether you're an e-commerce platform, a fashion designer, or just experimenting with image manipulation, this project offers endless possibilities.

## Clone and Setup ComfyUI Repository

Install ComfyUI by cloning its main repository:

```bash
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
```
Install dependencies:

```bash
pip install -r requirements.txt
```

Install ComfyUI Manager:

go to ComfyUI/custom_nodes dir in terminal(cmd) and clone this repo:

```bash
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
```
<b>Restart ComfyUI</b>

To Start ComfyUI:

```bash
python3 main.py
```
Note: ComfyUI requires Python 3.9 or above. Ensure all required dependencies are installed.

Now Go to Manager ->-> Custom Nodes Manager and install this two nodes <b>ComfyUI Layer Style</b> and <b>ComfyUI_CatVTON_Wrapper</b>, restart and reload the page.

<div align="center">
  <img width="800" height="800" alt="foduucom/ClothSwap" src="https://huggingface.co/foduucom/ClothSwap/resolve/main/custom_nodes.png">
</div>

Place the <b>sam_vit_h_4b8939.pth</b> model inside ComfyUI/models/sams directory and <b>groundingdino_swint_ogc.pth</b> model in ComfyUI/models/grounding-dino directory if not download it.
(If directory name not there in ComfyUI/models/ create new)

- For Reference you can download model by below link:
https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth
https://huggingface.co/spaces/abhishek/StableSAM/resolve/main/sam_vit_h_4b8939.pth

## Clone this Repository
Clone the repository containing the Cloth Swap JSON workflows and assets:

```bash
git clone https://huggingface.co/foduucom/StyleShift-ClothSwap
cd StyleShift-ClothSwap
```

## How to use

- Start <b>ComfyUI</b> (by running python3 main.py)
- Open ComfyUI in your browser (default: http://127.0.0.1:8188)
- Click on <b>Load</b> button in menu bar and select the <b>workflow.json</b> file provided in this repository
- Now click on <b>Queue Prompt</b> for generate output

or you can use by python script provided in this repository:
```bash 
python3 main.py

#Remember change the input paths in script here :
#prompt["2"]["inputs"]["image"] = "\\ put your input person pose image"
#prompt["3"]["inputs"]["image"] = "\\ put your input cloth image"
```

## Using Cloth Swap

- Prepare your input images (ensure proper resolution for better results)
- Select the uploaded workflow in ComfyUI
- Provide necessary inputs as per the workflow:
  - Source Image: The base image where the clothing is to be swapped
  - Cloth Image: The image of the clothing to be applied
- Start the process to generate swapped outputs
- Save the generated images for further use

## Why is this Useful?
This project has a broad range of applications, making it useful across multiple industries and for personal use:

- <b/>Virtual Try-On Technology:</b>
Revolutionize online shopping experiences by enabling customers to "try on" clothes digitally.
Reduce product returns by providing a realistic preview of clothing fit and style.

- <b>Fashion Design and Prototyping:</b>
Help designers test their creations on various models without the need for physical samples or photoshoots.
Quickly iterate designs and visualize the final product.

## Compute Infrastructure

## Hardware

NVIDIA GeForce RTX 3060 card

## Model Card Contact

For inquiries and contributions, please contact us at info@foduu.com.

```bibtex
@ModelCard{
  author    = {Nehul Agrawal and
               Priyal Mehta},
  title     = {StyleShift - Cloth Swap / Dress Swap / Style Change},
  year      = {2024}
}
```