choephix commited on
Commit
6387666
·
1 Parent(s): 0ce1f9f

Add remesh toggle for GLB export

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -545,6 +545,7 @@ def extract_glb(
545
  state: dict,
546
  decimation_target: int,
547
  texture_size: int,
 
548
  req: gr.Request,
549
  progress=gr.Progress(track_tqdm=True),
550
  ) -> Tuple[str, str]:
@@ -555,6 +556,7 @@ def extract_glb(
555
  state (dict): The state of the generated 3D model.
556
  decimation_target (int): The target face count for decimation.
557
  texture_size (int): The texture resolution.
 
558
 
559
  Returns:
560
  str: The path to the extracted GLB file.
@@ -573,7 +575,7 @@ def extract_glb(
573
  aabb=[[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]],
574
  decimation_target=decimation_target,
575
  texture_size=texture_size,
576
- remesh=True,
577
  remesh_band=1,
578
  remesh_project=0,
579
  use_tqdm=True,
@@ -615,6 +617,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
615
  texture_size = gr.Slider(
616
  1024, 4096, label="Texture Size", value=1024, step=1024
617
  )
 
618
 
619
  generate_btn = gr.Button("Generate")
620
 
@@ -738,7 +741,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
738
 
739
  extract_btn.click(lambda: gr.Walkthrough(selected=1), outputs=walkthrough).then(
740
  extract_glb,
741
- inputs=[output_buf, decimation_target, texture_size],
742
  outputs=[glb_output, download_btn],
743
  )
744
 
 
545
  state: dict,
546
  decimation_target: int,
547
  texture_size: int,
548
+ remesh: bool,
549
  req: gr.Request,
550
  progress=gr.Progress(track_tqdm=True),
551
  ) -> Tuple[str, str]:
 
556
  state (dict): The state of the generated 3D model.
557
  decimation_target (int): The target face count for decimation.
558
  texture_size (int): The texture resolution.
559
+ remesh (bool): Whether to rebuild mesh topology during export.
560
 
561
  Returns:
562
  str: The path to the extracted GLB file.
 
575
  aabb=[[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]],
576
  decimation_target=decimation_target,
577
  texture_size=texture_size,
578
+ remesh=remesh,
579
  remesh_band=1,
580
  remesh_project=0,
581
  use_tqdm=True,
 
617
  texture_size = gr.Slider(
618
  1024, 4096, label="Texture Size", value=1024, step=1024
619
  )
620
+ remesh = gr.Checkbox(label="Remesh", value=False)
621
 
622
  generate_btn = gr.Button("Generate")
623
 
 
741
 
742
  extract_btn.click(lambda: gr.Walkthrough(selected=1), outputs=walkthrough).then(
743
  extract_glb,
744
+ inputs=[output_buf, decimation_target, texture_size, remesh],
745
  outputs=[glb_output, download_btn],
746
  )
747