MatFuse generates tileable PBR material maps (diffuse, normal, roughness,
specular) from text, reference images, sketches, and/or color palettes.
1import torch
2from diffusers import DiffusionPipeline
3
4pipe = DiffusionPipeline.from_pretrained(
5 "gvecchio/MatFuse",
6 trust_remote_code=True,
7 torch_dtype=torch.float16,
8)
9pipe = pipe.to("cuda")
10
11result = pipe(
12 text="red brick wall",
13 num_inference_steps=50,
14 guidance_scale=4.0,
15 generator=torch.Generator("cuda").manual_seed(42),
16)
17
18result["diffuse"][0].save("diffuse.png")
19result["normal"][0].save("normal.png")
20result["roughness"][0].save("roughness.png")
21result["specular"][0].save("specular.png")
1from PIL import Image
2
3result = pipe(
4 image=Image.open("reference.png"),
5 text="rough stone texture",
6 palette=[(120, 80, 60), (90, 60, 40), (150, 110, 80), (70, 50, 30), (180, 140, 100)],
7 num_inference_steps=50,
8 guidance_scale=4.0,
9)
1@inproceedings{vecchio2024matfuse,
2 author = {Vecchio, Giuseppe and Sortino, Renato and Palazzo, Simone and Spampinato, Concetto},
3 title = {MatFuse: Controllable Material Generation with Diffusion Models},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 month = {June},
6 year = {2024},
7 pages = {4429-4438}
8}
This project is licensed under the MIT License.