cronos3k commited on
Commit
0334211
·
verified ·
1 Parent(s): 75a999c

Update app.py

Browse files

Fixed high quality mesh extraction to use only supported parameters
Added proper button state handling for both full and reduced quality downloads
Fixed the event handlers to correctly handle all UI states
Added descriptive "Download Options" header above buttons

Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -157,7 +157,7 @@ def image_to_3d(
157
  del video
158
  torch.cuda.empty_cache()
159
 
160
- # Pack state including the original high-res mesh data
161
  state = pack_state(outputs['gaussian'][0], outputs['mesh'][0], trial_id)
162
  return state, video_path
163
 
@@ -260,6 +260,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
260
  with gr.Column():
261
  video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
262
  model_output = LitModel3D(label="3D Model Preview", exposure=20.0, height=300)
 
263
  with gr.Row():
264
  download_full = gr.DownloadButton(label="Download Full-Quality GLB", interactive=False)
265
  download_reduced = gr.DownloadButton(label="Download Reduced GLB", interactive=False)
@@ -299,8 +300,8 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
299
  inputs=[image_prompt, seed, ss_guidance_strength, ss_sampling_steps, slat_guidance_strength, slat_sampling_steps],
300
  outputs=[output_buf, video_output],
301
  ).then(
302
- lambda: [gr.Button(interactive=True), gr.Button(interactive=True)],
303
- outputs=[extract_full_btn, extract_reduced_btn],
304
  )
305
 
306
  extract_full_btn.click(
 
157
  del video
158
  torch.cuda.empty_cache()
159
 
160
+ # Pack state
161
  state = pack_state(outputs['gaussian'][0], outputs['mesh'][0], trial_id)
162
  return state, video_path
163
 
 
260
  with gr.Column():
261
  video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
262
  model_output = LitModel3D(label="3D Model Preview", exposure=20.0, height=300)
263
+ gr.Markdown("### Download Options")
264
  with gr.Row():
265
  download_full = gr.DownloadButton(label="Download Full-Quality GLB", interactive=False)
266
  download_reduced = gr.DownloadButton(label="Download Reduced GLB", interactive=False)
 
300
  inputs=[image_prompt, seed, ss_guidance_strength, ss_sampling_steps, slat_guidance_strength, slat_sampling_steps],
301
  outputs=[output_buf, video_output],
302
  ).then(
303
+ lambda: [gr.Button(interactive=True), gr.Button(interactive=True), gr.Button(interactive=False), gr.Button(interactive=False)],
304
+ outputs=[extract_full_btn, extract_reduced_btn, download_full, download_reduced],
305
  )
306
 
307
  extract_full_btn.click(