Create textures for 3d cloth and avatar using stable-diffusion and blender
To successfully use this project, you need to meet the following installation requirements:
-
automatic1111 webui: Ensure that you have installed automatic1111 webui. You can download it from the official website and follow their installation instructions.
-
controlnet: Make sure you have controlnet installed. You can obtain it from the GitHub repository and follow its installation documentation.
-
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.
Using this project is straightforward; just follow these steps:
-
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
-
Configure Parameters: You can set parameters in the configuration file according to your requirements so that the project behaves as expected.
-
Make sure you have run sd-webui as ''--api'' mode.
-
Run run.sh: Execute the main script of the project, which will read your configuration and begin processing the model.
./run.sh
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
Finally, you will get a model_with_texture_remap.fbx file
1.Original model like this:
2.Request sd-webui use depth map and lineart like this:
Adjust your arguments for sd-webui and you will get character concept picture like this:
3.Run run_vrm.sh and you got it:
Screencast-from-2023.09.06.-14.53.52.MP4
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.
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!