Skip to content

Commit

Permalink
update gradio_app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeqiang-Lai committed Feb 6, 2025
1 parent 9da0051 commit 2663a57
Show file tree
Hide file tree
Showing 78 changed files with 7 additions and 12 deletions.
Empty file modified assets/demo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/004.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/052.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/073.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/075.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1008.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/101.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1022.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1029.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1037.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1079.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1111.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1123.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1128.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1135.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1146.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1148.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1154.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1180.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1196.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1204.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1234.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1310.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1316.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1354.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/example_images/1429.png
100644 → 100755
Empty file modified assets/example_images/1493.png
100644 → 100755
Empty file modified assets/example_images/1582.png
100644 → 100755
Empty file modified assets/example_images/1583.png
100644 → 100755
Empty file modified assets/example_images/1596.png
100644 → 100755
Empty file modified assets/example_images/1601.png
100644 → 100755
Empty file modified assets/example_images/1603.png
100644 → 100755
Empty file modified assets/example_images/1626.png
100644 → 100755
Empty file modified assets/example_images/1627.png
100644 → 100755
Empty file modified assets/example_images/1654.png
100644 → 100755
Empty file modified assets/example_images/167.png
100644 → 100755
Empty file modified assets/example_images/1670.png
100644 → 100755
Empty file modified assets/example_images/1679.png
100644 → 100755
Empty file modified assets/example_images/1687.png
100644 → 100755
Empty file modified assets/example_images/1698.png
100644 → 100755
Empty file modified assets/example_images/1715.png
100644 → 100755
Empty file modified assets/example_images/1735.png
100644 → 100755
Empty file modified assets/example_images/1738.png
100644 → 100755
Empty file modified assets/example_images/1744.png
100644 → 100755
Empty file modified assets/example_images/1758.png
100644 → 100755
Empty file modified assets/example_images/1772.png
100644 → 100755
Empty file modified assets/example_images/1773.png
100644 → 100755
Empty file modified assets/example_images/1778.png
100644 → 100755
Empty file modified assets/example_images/179.png
100644 → 100755
Empty file modified assets/example_images/1898.png
100644 → 100755
Empty file modified assets/example_images/191.png
100644 → 100755
Empty file modified assets/example_images/195.png
100644 → 100755
Empty file modified assets/example_images/197.png
100644 → 100755
Empty file modified assets/example_images/198.png
100644 → 100755
Empty file modified assets/example_images/202.png
100644 → 100755
Empty file modified assets/example_images/203.png
100644 → 100755
Empty file modified assets/example_images/218.png
100644 → 100755
Empty file modified assets/example_images/219.png
100644 → 100755
Empty file modified assets/example_images/379.png
100644 → 100755
Empty file modified assets/example_images/380.png
100644 → 100755
Empty file modified assets/example_images/419.png
100644 → 100755
Empty file modified assets/example_images/583.png
100644 → 100755
Empty file modified assets/example_images/888.png
100644 → 100755
Empty file modified assets/example_images/895.png
100644 → 100755
Empty file modified assets/example_images/example_000.png
100644 → 100755
Empty file modified assets/example_images/example_002.png
100644 → 100755
Empty file modified assets/images/arch.jpg
100644 → 100755
Empty file modified assets/images/e2e-1.gif
100644 → 100755
Empty file modified assets/images/e2e-2.gif
100644 → 100755
Empty file modified assets/images/system.jpg
100644 → 100755
Empty file modified assets/images/teaser.jpg
100644 → 100755
Empty file modified assets/images/teaser_wo_logo.jpg
100644 → 100755
Empty file modified assets/qrcode/discord.png
100644 → 100755
Empty file modified assets/qrcode/wechat.png
100644 → 100755
Empty file modified assets/qrcode/x.png
100644 → 100755
Empty file modified assets/qrcode/xiaohongshu.png
100644 → 100755
Empty file modified assets/report/Tencent_Hunyuan3D_2_0.pdf
100644 → 100755
Empty file.
19 changes: 7 additions & 12 deletions gradio_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles

from mmgp import offload

def get_example_img_list():
print('Loading example img list ...')
Expand All @@ -34,7 +33,7 @@ def gen_save_folder(max_size=60):
print(f"remove {SAVE_DIR}/{(cur_id + 1) % max_size} success !!!")
save_folder = f"{SAVE_DIR}/{max(0, cur_id)}"
os.makedirs(save_folder, exist_ok=True)
print(f"mkdir {save_folder} suceess !!!")
print(f"mkdir {save_folder} success !!!")
return save_folder


Expand Down Expand Up @@ -106,7 +105,7 @@ def _gen_shape(
try:
image = t2i_worker(caption)
except Exception as e:
raise gr.Error(f"Text to 3D is disable. Please enable it by `python gradio_app.py --enable_t23d`.")
raise gr.Error(f"Text to 3D is disabled. Please enable it by restarted the app with `python gradio_app.py --enable_t23d`.")
time_meta['text2image'] = time.time() - start_time

image.save(os.path.join(save_folder, 'input.png'))
Expand Down Expand Up @@ -245,10 +244,10 @@ def build_app():
info='Example: A 3D model of a cute cat, white background')

with gr.Accordion('Advanced Options', open=False):
num_steps = gr.Slider(maximum=100, minimum=20, value=30, step=1, label='Inference Steps')
num_steps = gr.Slider(maximum=100, minimum=1, value=30, step=1, label='Inference Steps')
octree_resolution = gr.Dropdown([256, 384, 512, 768, 1024], value=256, label='Octree Resolution')
cfg_scale = gr.Number(value=5.5, label='Guidance Scale')
max_facenum_slider = gr.Slider(maximum=150000, minimum=20000, value=40000, step=1000, label='Faces')
max_facenum_slider = gr.Slider(maximum=200000, minimum=20000, value=40000, step=1000, label='Number of Faces')
seed = gr.Slider(maximum=1e7, minimum=0, value=1234, label='Seed')

with gr.Group():
Expand Down Expand Up @@ -282,15 +281,15 @@ def build_app():
gr.HTML("""
<div style="margin-top: 20px;">
<b>Warning: </b>
Texture synthesis is disable due to missing requirements,
please install requirements following README.md to activate it.
Texture synthesis is disabled due to missing requirements,
please refer to the README.md and install the missing requirements to activate it.
</div>
""")
if not args.enable_t23d:
gr.HTML("""
<div style="margin-top: 20px;">
<b>Warning: </b>
Text to 3D is disable. To activate it, please run `python gradio_app.py --enable_t23d`.
Text to 3D is disabled. Please enable it by restarted the app with `python gradio_app.py --enable_t23d`.
</div>
""")

Expand Down Expand Up @@ -345,9 +344,6 @@ def build_app():
parser.add_argument('--host', type=str, default='0.0.0.0')
parser.add_argument('--cache-path', type=str, default='gradio_cache')
parser.add_argument('--enable_t23d', action='store_true')
parser.add_argument('--profile', type=str, default="4")
parser.add_argument('--verbose', type=str, default="1")

args = parser.parse_args()

SAVE_DIR = args.cache_path
Expand All @@ -367,7 +363,6 @@ def build_app():
example_is = get_example_img_list()
example_ts = get_example_txt_list()

torch.set_default_device("cpu")
try:
from hy3dgen.texgen import Hunyuan3DPaintPipeline

Expand Down

0 comments on commit 2663a57

Please sign in to comment.