Skip to content

StarRealMan/FlexPainter

Repository files navigation

FlexPainter

[Arxiv 2025] FlexPainter: Flexible and Multi-View Consistent Texture Generation

FlexPainter: Flexible and Multi-View Consistent Texture Generation
Dongyu Yan*, Leyi Wu*, Jiantao Lin, Luozhou Wang, Tianshuo Xu, Zhifei Chen, Zhen Yang, Lie Xu, Shunsi Zhang, Yingcong Chen
Arxiv 2025

This repository contains code for the paper FlexPainter: Flexible and Multi-View Consistent Texture Generation, an texture generation method that uses flexible, multi-modal inputs.

Install

conda create -n flexpainter python==3.10 -y
conda activate flexpainter

pip install torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cu121
conda install google-sparsehash -c bioconda -y
pip install -r requirements.txt

Usage

Download checkpoints using huggingface-cli:

  huggingface-cli login
  huggingface-cli download StarYDY/FlexPainter --local-dir ./ckpts

Generate Blank Embeddings for CFG:

  python gen_blank.py

Run texting with image prompt:

 python test.py \
    --mesh_path ./demo/axe/13b98c410feb42dc940f0b40b96af9c0.obj \
    --image_prompt ./demo/axe/cond.jpg

Run testing with text prompt:

 python test.py \
    --mesh_path ./demo/axe/13b98c410feb42dc940f0b40b96af9c0.obj \
    --prompt "An axe with wooden handle and metal blade"

Run joint generation with a lower image strength:

 python test.py \
    --mesh_path ./demo/axe/13b98c410feb42dc940f0b40b96af9c0.obj \
    --image_prompt ./demo/axe/cond.jpg \
    --prompt "An axe with wooden handle and metal blade" \
    --image_strength 0.1

Run stylization:

 python test.py \
    --mesh_path ./demo/axe/13b98c410feb42dc940f0b40b96af9c0.obj \
    --image_prompt ./demo/styles/icy.jpg \
    --stylize

Additional upsampling can be done using RealESRGan and the checkpoint trained on UV space: ./ckpts/realesrgan/net_g.pth:

  # clone the original Real-ESRGAN repo
  git clone https://github.com/xinntao/Real-ESRGAN.git
  cd Real-ESRGAN
  # install
  pip install basicsr
  pip install facexlib
  pip install gfpgan
  pip install -r requirements.txt
  python setup.py develop
  # inference
  cd ./Real-ESRGAN
  python inference_realesrgan.py --model_path ../ckpts/realesrgan/net_g.pth -i <your-input-texture-image>

Acknowledgements

Our work builds upon these excellent repositories:

Citation

If you find this work useful for your research, please cite our paper:

@article{yan2024flexipainter,
  title={FlexPainter: Flexible and Multi-View Consistent Texture Generation},
  author={Dongyu Yan, Leyi Wu, Jiantao Lin, Luozhou Wang, Tianshuo Xu, Zhifei Chen, Zhen Yang, Lie Xu, Shunsi Zhang, Yingcong Chen},
  journal={arXiv preprint arXiv:2506.02620},
  year={2025}
}

About

[Arxiv 2025] FlexPainter: Flexible and Multi-View Consistent Texture Generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages