YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Texture-Preserving Multimodal Fashion Image Editing with Diffusion Models

🎯 Overview

TP-MGD is a new method for texture-preserving multimodal fashion image editing using diffusion models. The project enables high-quality fashion image generation and editing through an innovative lightweight architecture setup while maintaining fine-grained texture details.

βœ… TODO

  • Release training code
  • Release inference code
  • Release processed datasets
  • Release checkpoints to Hugging Face
  • Create comprehensive documentation

πŸš€ Quick Start

Installation

git clone https://github.com/zibingo/TP-MGD.git
cd TP-MGD

Requirements:

  • Python 3.9+
  • PyTorch >= 2.5.0
  • CUDA >= 12.4
pip install diffusers accelerate transformers opencv-python einops wandb open_clip_torch

Download Pre-trained Models

wget https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15.bin 

πŸ“Š Dataset Setup

VITON-HD Dataset

  1. Download VITON-HD: Get the original dataset from VITON-HD

  2. Download MGD multimodal data: Get additional data from MGD

  3. Download preprocessed textures:

    wget https://huggingface.co/zibingo/TP-MGD/resolve/main/vitonhd-texture.zip
    
  4. Configuration: Set the dataroot_path in the YAML files under the configs/ directory.

Directory Structure:

β”œβ”€β”€ captions.json                (from MGD)
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ agnostic-mask/
β”‚   β”œβ”€β”€ agnostic-v3.2/
β”‚   β”œβ”€β”€ cloth/
β”‚   β”œβ”€β”€ cloth-mask/
β”‚   β”œβ”€β”€ cloth-texture/           (from Ours)
β”‚   β”œβ”€β”€ im_sketch/               (from MGD)
β”‚   β”œβ”€β”€ im_sketch_unpaired/      (from MGD)
β”‚   β”œβ”€β”€ image/
β”‚   β”œβ”€β”€ image-densepose/
β”‚   β”œβ”€β”€ image-parse-agnostic-v3.2/
β”‚   β”œβ”€β”€ image-parse-v3/
β”‚   β”œβ”€β”€ openpose_img/
β”‚   └── openpose_json/
β”œβ”€β”€ test_pairs.txt
β”œβ”€β”€ train/
β”‚   β”œβ”€β”€ agnostic-mask/
β”‚   β”œβ”€β”€ agnostic-v3.2/
β”‚   β”œβ”€β”€ cloth/
β”‚   β”œβ”€β”€ cloth-mask/
β”‚   β”œβ”€β”€ cloth-texture/           (from Ours)
β”‚   β”œβ”€β”€ gt_cloth_warped_mask/
β”‚   β”œβ”€β”€ im_sketch/               (from MGD)
β”‚   β”œβ”€β”€ image/
β”‚   β”œβ”€β”€ image-densepose/
β”‚   β”œβ”€β”€ image-parse-agnostic-v3.2/
β”‚   β”œβ”€β”€ image-parse-v3/
β”‚   β”œβ”€β”€ openpose_img/
β”‚   └── openpose_json/
└── train_pairs.txt

DressCode Dataset

  1. Download DressCode: Get the original dataset from DressCode

  2. Download MGD multimodal data: Get additional data from MGD

  3. Download preprocessed textures:

    wget https://huggingface.co/zibingo/TP-MGD/resolve/main/dresscode-texture.zip
    
  4. Configuration: Set the dataroot_path in the YAML files under the configs/ directory.

Directory Structure:

β”œβ”€β”€ dresses/
β”‚   β”œβ”€β”€ dense/
β”‚   β”œβ”€β”€ dresses_cloth-texture/    (from Ours)
β”‚   β”œβ”€β”€ im_sketch/                (from MGD)
β”‚   β”œβ”€β”€ im_sketch_unpaired/       (from MGD)
β”‚   β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ keypoints/
β”‚   β”œβ”€β”€ label_maps/
β”‚   β”œβ”€β”€ test_pairs_paired.txt
β”‚   β”œβ”€β”€ test_pairs_unpaired.txt
β”‚   └── train_pairs.txt
β”œβ”€β”€ lower_body/
β”‚   β”œβ”€β”€ dense/
β”‚   β”œβ”€β”€ im_sketch/                (from MGD)
β”‚   β”œβ”€β”€ im_sketch_unpaired/       (from MGD)
β”‚   β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ keypoints/
β”‚   β”œβ”€β”€ label_maps/
β”‚   β”œβ”€β”€ lower_body_cloth-texture/ (from Ours)
β”‚   β”œβ”€β”€ test_pairs_paired.txt
β”‚   β”œβ”€β”€ test_pairs_unpaired.txt
β”‚   └── train_pairs.txt
β”œβ”€β”€ upper_body/
β”‚   β”œβ”€β”€ dense/
β”‚   β”œβ”€β”€ im_sketch/                (from MGD)
β”‚   β”œβ”€β”€ im_sketch_unpaired/       (from MGD)
β”‚   β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ keypoints/
β”‚   β”œβ”€β”€ label_maps/
β”‚   β”œβ”€β”€ test_pairs_paired.txt
β”‚   β”œβ”€β”€ test_pairs_unpaired.txt
β”‚   β”œβ”€β”€ train_pairs.txt
β”‚   └── upper_body_cloth-texture/  (from Ours)
β”œβ”€β”€ coarse_captions.json           (from MGD)
β”œβ”€β”€ fine_captions.json             (from MGD)
β”œβ”€β”€ multigarment_test_triplets.txt
β”œβ”€β”€ readme.txt
β”œβ”€β”€ test_pairs_paired.txt
β”œβ”€β”€ test_pairs_unpaired.txt
β”œβ”€β”€ test_stitch_map/               (from MGD)
└── train_pairs.txt

πŸš€ Usage

Training

Single GPU:

python train_vitonhd.py
python train_dresscode.py

Multi-GPU

CUDA_VISIBLE_DEVICES=0,1 accelerate launch train_vitonhd.py
CUDA_VISIBLE_DEVICES=0,1 accelerate launch train_dresscode.py

Inference

  1. Download pre-trained weights from Hugging Face and place them in the checkpoints/ directory
  2. Update configuration: Modify the resume_state parameter in the YAML files under configs/ directory to point to your checkpoint directory

Single GPU:

python inference_vitonhd.py
python inference_dresscode.py

Multi-GPU:

CUDA_VISIBLE_DEVICES=0,1 accelerate launch inference_vitonhd.py
CUDA_VISIBLE_DEVICES=0,1 accelerate launch inference_dresscode.py

πŸ“ Project Structure

TP-MGD/
β”œβ”€β”€ configs/                 # Configuration files
β”œβ”€β”€ checkpoints/             # Pre-trained model weights
β”œβ”€β”€ assets/                  # Sample images
β”œβ”€β”€ train_vitonhd.py         # VITON-HD training script
β”œβ”€β”€ train_dresscode.py       # DressCode training script
β”œβ”€β”€ inference_vitonhd.py     # VITON-HD inference script
β”œβ”€β”€ inference_dresscode.py   # DressCode inference script
β”œβ”€β”€ datasets.py              # Dataset loading utilities
└── attention_processor.py   # Custom attention mechanisms

πŸ”§ Configuration

Key configuration parameters in configs/*.yaml:

  • dataroot_path: Path to your dataset
  • resume_state: Path to checkpoint for inference or resume train

πŸ™ Acknowledgments

πŸ“ž Contact

For questions and support, please open an issue on GitHub or contact the authors.


⭐ If you find this project helpful, please give it a star!

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support