We introduce ClothCode, a unified generative framework for garment state estimation and action-conditioned dynamics prediction in a shared discrete configuration space. A material-aligned tokenizer encodes garment configuration as residual vector-quantized patch tokens, while task-specific Masked Generative Transformers predict these tokens through parallel confidence-guided refinement. Across three garment templates, ClothCode reduces mean displacement error by 26.6% for state estimation and 37.0% for dynamics prediction relative to the strongest baselines. Dynamics prediction requires only 16.7 ms per window, compared with 556.2 ms for diffusion. Integrated into the same model-predictive controller, ClothCode improves real-world folding and flattening success from 56.7% to 78.9%. Further results and videos are available at: https://anonymous.4open.science/r/ClothCode-DE32
Figures & tables
Fig. 1: Overview of our discrete generative framework for model-based garment manipulation. A garment configuration is encoded as a set of discrete patch tokens shared by two Masked Generative Transformers (MGTs). (1) The discrete garment representation captures local deformation states over fixed material patches. (2) For state estimation, an MGT iteratively predicts the complete token configuration from a partial point cloud. (3) For dynamics prediction, an action-conditioned MGT predicts future garment configurations for candidate actions, allowing MPC to select the trajectory with the lowest goal cost. (4) The resulting perception–prediction loop enables closed-loop garment manipulation on a real robot.
Fig. 2: Overview of ClothCode. ClothCode first learns a discrete representation of garment shape (top). Each mesh is divided into fixed patches that track the same material regions across deformations, encoded as two-level residual vector-quantization (RVQ) tokens, and reconstructed by a shared mesh decoder. This frozen representation provides a common prediction space for two tasks. For state estimation (bottom left), a masked transformer combines a partial point cloud with masked garment tokens to recover the complete garment configuration and its global position. For dynamics prediction (bottom right), a second masked transformer combines recent garment states with a candidate end-effector trajectory and jointly predicts the future garment sequence and its global motion. M denotes a masked token.
ID
Action-OOD
Physics-OOD
Rollout
Method
MDE ↓
EMD ↓
MDE ↓
EMD ↓
MDE ↓
EMD ↓
Oracle ↓
Free ↓
Fabric
UCD-Transformer [ 5 ]
1.652
1.511
2.138
1.965
1.987
1.741
1.306
2.684
UniClothDiff
1.172
1.118
1.508
1.465
1.379
1.328
1.920
3.916
PGND
1.345
1.150
1.702
1.495
1.545
1.344
1.499
2.957
ClothCode (Ours)
0.730
0.694
0.884
0.843
0.859
0.818
0.864
1.822
TABLE I: Action-conditioned dynamics prediction (cm, ↓ ). Single-window results predict 10 future frames from 3 context frames. Rollout MDE is reported on ID with oracle and predicted ( free ) context.
Fig. 3: Qualitative comparison of garment dynamic prediction. Per-vertex reconstruction errors with respect to the ground-truth mesh are visualized using a shared color scale across all methods.
Fig. 4: Qualitative comparison of garment state estimation from camera observations. Per-vertex reconstruction errors with respect to the ground-truth mesh are visualized using a shared color scale across all methods.
Eval A (ID)
Eval B (Action-OOD)
Garment
Method
MDE ↓
EMD ↓
Chamfer ↓
MDE ↓
EMD ↓
Chamfer ↓
Fabric
Uniclothdiff
1.384
1.205
1.770
1.624
1.352
1.896
Transformer
1.910
1.388
1.881
2.285
1.565
2.021
GarmentNets
1.993
1.745
2.314
2.191
1.870
2.423
MEDOR
2.106
1.809
2.343
2.290
1.918
2.417
ClothCode (Ours)
0.890
0.680
1.182
1.104
0.795
1.279
TABLE II: Garment state estimation from partial point-cloud observations.
Action-conditioned cloth dynamics prediction requires both locally plausible deformation and long-range coordination. Existing approaches largely follow two paradigms. Mesh-based GNNs capture local physical responses through material connectivity. However, their finite message-passing range limits coordination between topologically distant regions, while autoregressive rollouts tend to accumulate prediction errors. Transformer-based dynamics models capture long-range interactions through global attention, but often operate without explicit material connectivity and must learn local topological responses directly from data. We propose MeshPriorDiT, a hierarchical dynamics model that decomposes future cloth motion into a structured mesh prior and a generative residual. An action-conditioned mesh GNN first predicts multi-step vertex displacements, yielding a reference trajectory that respects material topology and grasp constraints. Conditioned on historical states, planned actions, and the mesh prior, a Residual DiT then uses conditional flow matching to jointly generate the residual motion not captured by the prior. The generated residual is further rescaled and decoded using material adjacency to coordinate corrections across neighboring vertices. We evaluate MeshPriorDiT on 15-step autoregressive rollouts across three cloth manipulation tasks. Averaged over the three tasks, MeshPriorDiT reduces average Global MSE by 43.42% relative to the GNN-Only baseline and by 75.03% relative to the DiT-DDPM baseline, while maintaining a favorable Edge-strain MSE comparable to that of GNN-Only.
Zihang Wang, Jianming Hu, Shang Su +4
Tsinghua University · Dense-AI · University of Michigan
We present DiT-Garment to model dynamic 3D clothing over human body models in arbitrary motion. Unlike existing methods, DiT-Garment can animate garments with unseen designs and physical materials, while allowing for direct inference of deformations for any target pose. To achieve this, we leverage a 2D diffusion transformer architecture to learn 3D deformations in a 2D UV-space. As the result is non-deterministic, our generative model learns the distribution of possible outcomes. The template garment is represented as a 3D triangle mesh spatially aligned with a 3D human body model in a standardized pose. To work with different garment designs without the need of a common template or complex graph convolution operations, the diffusion transformer is conditioned on a 3D position map of the template, represented in UV-space, which allows to implicitly learn a deformation of the 3D space around the body in standard pose. Further conditioning on body motion and physical parameters allows to physically ground the model. We quantitatively and qualitatively evaluate DiT-Garment on both synthetic and real data. While only trained on synthetic simulations of automatically generated cloth designs, our method generalizes to captured and artist-made garment designs. Code and data are available for research purposes at https://dumoulina.github.io/dit-garment/.
Antoine Dumoulin, Laurence Boissieux, Joao Regateiro +2
Inria Centre at the University Grenoble Alpes · InterDigital Inc. · Inria, University of Rennes, CNRS, IRISA-UMR 6074
Unified and scalable Transformers have recently achieved remarkable success in modeling diverse phenomena traditionally associated with computer graphics, such as 3D visual effects, rendering processes, and motion in videos. In this work, we take a step further by investigating whether modern Transformer techniques can tackle the challenging task of cloth simulation. To this end, we present ClothTransformer, a framework that reformulates cloth simulation as autoregressive sequence modeling in a learned latent space. Existing neural cloth simulators are largely specialized to single scenarios, intrinsically coupled to the mesh discretization, and lack robust collision handling. Our approach addresses these limitations through three contributions: (1) a unified Transformer architecture that handles diverse scenarios -- body-driven garments, robotic manipulation, and free-fall collisions -- under a single model and achieves approximately 4--9× lower error than prior state-of-the-art methods across all scenarios; (2) a scalable latent-space formulation that compresses arbitrary-resolution meshes into a fixed-size set of latent tokens, making temporal dynamics computation independent of mesh resolution; and (3) a diverse-scenario high-fidelity penetration-free dataset of ∼493.4k frames spanning all three settings, which enables a differentiable Continuous Collision Detection (CCD) module to suppress penetration artifacts. Project Page: https://yucrazing.github.io/clothtransformer/
Yu Zhang, Yidi Shao, Wenqi Ouyang +5
1S-Lab, Nanyang Technological University, Singapore · 2Feeling AI · University of Oxford +2