Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit on the number of faces in the generated 3D model #1

Open
mimimi999 opened this issue Jan 25, 2025 · 7 comments
Open

Limit on the number of faces in the generated 3D model #1

mimimi999 opened this issue Jan 25, 2025 · 7 comments

Comments

@mimimi999
Copy link

I installed the code according to your instructions and did a generation test.

The 3D model is successfully generated from the image, but no matter which option generation resolution (256, 368, 512) is selected, the number of faces in the generated 3D model mesh is always limited to 40,000 faces. .

Is it possible to remove the limit on the number of sides and change the upper limit to any number?

Image

@YanWenKun
Copy link
Owner

Yes, the number of faces are hard-coded and not represented as an option.

For now you can edit the file hy3dgen\shapegen\postprocessors.py,
search for 40000 and replace it with 80000 or even higher number.

Keep in mind this does not apply to texture generation, which will reduce the mesh faces down to 40000 before generating.

@YanWenKun

This comment has been minimized.

@Abocg
Copy link

Abocg commented Jan 26, 2025

Image
This man outputted mesh without simplification and it looks clean. Do you know how to turn of the simplification part ? Or it just changing the faces counts do the trick?

@mimimi999
Copy link
Author

Image This man outputted mesh without simplification and it looks clean. Do you know how to turn of the simplification part ? Or it just changing the faces counts do the trick?

It seems that it was generated using ComfyUI's custom node.

kijai/ComfyUI-Hunyuan3DWrapper
https://github.com/kijai/ComfyUI-Hunyuan3DWrapper

Although I haven't actually tested it, there is an option within this custom node that allows you to change the upper limit for the number of faces.

Image

@CalleMille
Copy link

In the Hunyuan3D2_WinPortable\Hunyuan3D-2\gradio_app.py file there is this line:

mesh = FaceReducer()(mesh)

If you put a # before that line to comment it out then you´ll get the non-simplified mesh, which tend to be around 1-3 million triangles. It only works for generating the mesh without texture though, because the texture generator expects at most 50000 triangles.

The setting of the number of faces for the face reducer can be set in Hunyuan3D2_WinPortable\Hunyuan3D-2\hy3dgen\shapegen\postprocessors.py at the line:

max_facenum: int = 40000

@Xorxe93
Copy link

Xorxe93 commented Jan 27, 2025

This is still unusable in a practical way for most 3D artists, as long as they do not allow control over the number of polygons or a clean and acceptable topology, these models will remain the same as others on the market.

@mimimi999
Copy link
Author

This is still unusable in a practical way for most 3D artists, as long as they do not allow control over the number of polygons or a clean and acceptable topology, these models will remain the same as others on the market.

Currently, it is not possible to generate 3D models such as those used in AAA title games.

However, I think it has already reached a level of quality that can be used as a reference for 3D modeling.

Considering that a year ago it would have been impossible to output a model of this level from a single image, I feel that technological progress is evolving at an extraordinary speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants