Spaces:
Runtime error
Runtime error
Update gradio_app.py
Browse files- gradio_app.py +14 -14
gradio_app.py
CHANGED
|
@@ -724,17 +724,17 @@ if __name__ == '__main__':
|
|
| 724 |
HTML_HEIGHT = 690 if MV_MODE else 650
|
| 725 |
HTML_WIDTH = 500
|
| 726 |
HTML_OUTPUT_PLACEHOLDER = f"""
|
| 727 |
-
<div style='height: {650}px; width: 100%; border-radius: 8px; border-color: #
|
| 728 |
-
<div style='text-align: center; font-size:
|
| 729 |
-
<p style="color: #
|
| 730 |
-
<p style="color: #
|
| 731 |
</div>
|
| 732 |
</div>
|
| 733 |
"""
|
| 734 |
|
| 735 |
INPUT_MESH_HTML = """
|
| 736 |
<div style='height: 490px; width: 100%; border-radius: 8px;
|
| 737 |
-
border-color: #
|
| 738 |
</div>
|
| 739 |
"""
|
| 740 |
example_is = get_example_img_list()
|
|
@@ -751,11 +751,17 @@ if __name__ == '__main__':
|
|
| 751 |
texgen_worker = Hunyuan3DPaintPipeline.from_pretrained(args.texgen_model_path)
|
| 752 |
if args.low_vram_mode:
|
| 753 |
texgen_worker.enable_model_cpu_offload()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 754 |
HAS_TEXTUREGEN = True
|
| 755 |
except Exception as e:
|
| 756 |
print(e)
|
| 757 |
print("Failed to load texture generator.")
|
| 758 |
-
print('Please
|
| 759 |
HAS_TEXTUREGEN = False
|
| 760 |
|
| 761 |
HAS_T2I = True
|
|
@@ -765,14 +771,8 @@ if __name__ == '__main__':
|
|
| 765 |
t2i_worker = HunyuanDiTPipeline('Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers-Distilled')
|
| 766 |
HAS_T2I = True
|
| 767 |
|
| 768 |
-
|
| 769 |
-
|
| 770 |
-
from hy3dgen.shapegen import Hunyuan3DDiTFlowMatchingPipeline
|
| 771 |
-
from hy3dgen.shapegen.postprocessing import FloaterRemover, DegenerateFaceRemover, FaceReducer
|
| 772 |
-
except ImportError as e:
|
| 773 |
-
print(f"Import error: {e}. Ensure hy3dgen.shapegen.postprocessing is installed.")
|
| 774 |
-
raise
|
| 775 |
-
|
| 776 |
from hy3dgen.shapegen.pipelines import export_to_trimesh
|
| 777 |
from hy3dgen.rembg import BackgroundRemover
|
| 778 |
|
|
|
|
| 724 |
HTML_HEIGHT = 690 if MV_MODE else 650
|
| 725 |
HTML_WIDTH = 500
|
| 726 |
HTML_OUTPUT_PLACEHOLDER = f"""
|
| 727 |
+
<div style='height: {650}px; width: 100%; border-radius: 8px; border-color: #e5e7eb; border-style: solid; border-width: 1px; display: flex; justify-content: center; align-items: center;'>
|
| 728 |
+
<div style='text-align: center; font-size: 16px; color: #6b7280;'>
|
| 729 |
+
<p style="color: #8d8d8d;">Welcome to Hunyuan3D!</p>
|
| 730 |
+
<p style="color: #8d8d8d;">No mesh here.</p>
|
| 731 |
</div>
|
| 732 |
</div>
|
| 733 |
"""
|
| 734 |
|
| 735 |
INPUT_MESH_HTML = """
|
| 736 |
<div style='height: 490px; width: 100%; border-radius: 8px;
|
| 737 |
+
border-color: #e5e7eb; order-style: solid; border-width: 1px;'>
|
| 738 |
</div>
|
| 739 |
"""
|
| 740 |
example_is = get_example_img_list()
|
|
|
|
| 751 |
texgen_worker = Hunyuan3DPaintPipeline.from_pretrained(args.texgen_model_path)
|
| 752 |
if args.low_vram_mode:
|
| 753 |
texgen_worker.enable_model_cpu_offload()
|
| 754 |
+
# Not help much, ignore for now.
|
| 755 |
+
# if args.compile:
|
| 756 |
+
# texgen_worker.models['delight_model'].pipeline.unet.compile()
|
| 757 |
+
# texgen_worker.models['delight_model'].pipeline.vae.compile()
|
| 758 |
+
# texgen_worker.models['multiview_model'].pipeline.unet.compile()
|
| 759 |
+
# texgen_worker.models['multiview_model'].pipeline.vae.compile()
|
| 760 |
HAS_TEXTUREGEN = True
|
| 761 |
except Exception as e:
|
| 762 |
print(e)
|
| 763 |
print("Failed to load texture generator.")
|
| 764 |
+
print('Please try to install requirements by following README.md')
|
| 765 |
HAS_TEXTUREGEN = False
|
| 766 |
|
| 767 |
HAS_T2I = True
|
|
|
|
| 771 |
t2i_worker = HunyuanDiTPipeline('Tencent-Hunyuan/HunyuanDiT-v1.1-Diffusers-Distilled')
|
| 772 |
HAS_T2I = True
|
| 773 |
|
| 774 |
+
from hy3dgen.shapegen import FaceReducer, FloaterRemover, DegenerateFaceRemover, MeshSimplifier, \
|
| 775 |
+
Hunyuan3DDiTFlowMatchingPipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 776 |
from hy3dgen.shapegen.pipelines import export_to_trimesh
|
| 777 |
from hy3dgen.rembg import BackgroundRemover
|
| 778 |
|