Feng Zhou, Ruiyang Liu, Chen Liu, Gaofeng He, Yong-Lu Li, Xiaogang Jin, Huamin Wang
Official implementation for Design2GarmentCode, a motility-agnostic sewing pattern generation framework that leverages fine-tuned Large Multimodal Models to generate parametric pattern-making programs from multi-modal design concepts.git clone https://github.com/Style3D/design2garmentcode-impl.git
cd design2garmentcode-implAn environment.yml file is provided in the project root with all required Conda and PyPI dependencies (Python 3.9.19, Torch 2.4.0 + CUDA 12.1, etc.).
conda env create -f environment.yml
conda activate d2g
python -m pip install --upgrade pip # optional: upgrade pipIf you need local cloth simulation and 3‑D visualization, follow the installation instructions for GarmentCode Warp Simulator:
https://github.com/maria-korosteleva/NvidiaWarp-GarmentCode
Design2GarmentCode communicates with large multimodal models.
Follow the steps in the given order:
- Environment variable (recommended) – defaults to ChatGPT‑4o
export OPENAI_API_KEY="sk‑..."
- Edit
system.json(project root) – manually specifyapi_key,base_url, andmodelif you prefer a file‑based approach.
-
Download the base model Qwen2-VL-2B-Instruct and place the modal to
lmm_utils/Qwen/Qwen2-VL-2B-Instruct/. -
Download the fine-tuned weights file from Google Drive, and place it in
lmm_utils/Qwen/qwen2vl_lora_mlp/.
Setting up the GUI with python gui.py where you will see the following interface (modified from GarmentCode)
Switching to the PARSE DESIGN tab, and input your design input, either text description, photograph or sketch, to the chatbox. The generated sewing pattern will appear on the right side after parsing.
Once a pattern is generated, you can modify the result by typing modify: <your-instruction> in the chatbox.
Use test_text_batch.py to process a list of text descriptions from a JSON file.
python lmm_utils/test_text_batch.py \
--input assets/test_text/examples.json \
--output assets/test_text_result \
--sim --input: Path to your input JSON file containing multiple garment description texts.--output: Directory where the output.jsonfiles will be saved.--sim: Enable or disable physical simulation output. Supports physical simulation (enabled by default in script).
Use test_picture_batch.py to process all image files in a directory.
python lmm_utils/test_picture_batch.py \
--input assets/test_img/examples \
--output assets/test_image_result/examples \
--sim --input: Folder containing multiple image files.--output: Output folder where results will be saved.--sim: Enable or disable physical simulation output.
After generating the pattern data, you can simulate the corresponding 3D output directly from the pattern's JSON file with
python test_garment_sim.py --pattern_spec $INPUT_JSON Or run the simulation directly in the 3D View GUI tab.
If you find this work useful, please cite:
@inproceedings{zhou2025design2garmentcode,
title={Design2GarmentCode: Turning Design Concepts to Tangible Garments Through Program Synthesis},
author={Zhou, Feng and Liu, Ruiyang and Liu, Chen and He, Gaofeng and Li, Yong-Lu and Jin, Xiaogang and Wang, Huamin},
booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
pages={23712--23722},
year={2025}
}
