Skip to content

Create textures for 3d models using stable-diffusion and blender

Notifications You must be signed in to change notification settings

zdbavo/Stable-Texturify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stable-Texturify

Create textures for 3d cloth and avatar using stable-diffusion and blender

output_image output_image

README

Installation Requirements

To successfully use this project, you need to meet the following installation requirements:

  1. automatic1111 webui: Ensure that you have installed automatic1111 webui. You can download it from the official website and follow their installation instructions.

  2. controlnet: Make sure you have controlnet installed. You can obtain it from the GitHub repository and follow its installation documentation.

  3. Blender 2.93 with Python: You need to install Blender version 2.93 and ensure it supports Python. You can download and install it from the official Blender website.

Usage

Using this project is straightforward; just follow these steps:

  1. Pass the path to the model file you want to texture in the render config. It can be in .obj, .fbx, or .vrm format. For example:

    render config:
      model_path: path/to/your/model
  2. Configure Parameters: You can set parameters in the configuration file according to your requirements so that the project behaves as expected.

  3. Make sure you have run sd-webui as ''--api'' mode.

  4. Run run.sh: Execute the main script of the project, which will read your configuration and begin processing the model.

./run.sh

Example

Here's an example configuration file that includes the model file path and some parameter settings:

render config:
fbx_model_path: "./tmp.obj"
output_folder: './'
# textures:
#   back: "path/to/your/texture/back.png"
#   front: "path/to/your/texture/front.png"
#   left: "path/to/your/texture/left.png"
sd_model_checkpoint: 'darkSushi25D25D_v40.safetensors'
seg_node:
  random_color: True
depth_node:
  map_value_node_offset: 0.5
  map_value_node_size: 0.7
camera:
  view: ['back','front','left','right']
  distance: 1.5
  side_angle: 80
resolution:
  width: 1600
  height: 1600
textures: {
    back: "./Sres_0.png",
    front: "./Sres_1.png",
    left: "./Sres_2.png"
    # 'right': sides_image
}
inpaint_textures: {
    back: "./Sres_0_brinting.png",
    front: "./Sres_1_brinting.png",
    left: "./Sres_inpainted_1.png",
    right: "./Sres_inpainted_0.png"
}
project_order: ['back','front','left','right']

If you run it correctly, you will see the following intermediate files in the output directory

concatenated_image output_image Finally, you will get a model_with_texture_remap.fbx file

QQ20230905-152311 QQ20230905-152331

For VRM model

1.Original model like this:

QQ20230906-150146

2.Request sd-webui use depth map and lineart like this:

concatenated_image concatenated_lineart

Adjust your arguments for sd-webui and you will get character concept picture like this:

output_image

3.Run run_vrm.sh and you got it:

Screencast-from-2023.09.06.-14.53.52.MP4

Help and Support

If you encounter any issues during installation or usage, please feel free to reach out to our support team at any time. You can also submit issues or request help on our GitHub repository.

License

This project is released under the MIT License. Refer to the license file for more details.

Thank you for using our project! We hope you find it enjoyable to use!

About

Create textures for 3d models using stable-diffusion and blender

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Other 1.1%