Spaces:
mashroo
/
Running on Zero

YoussefAnso commited on
Commit
2fe5022
·
1 Parent(s): 0d60bce

Refine Gradio interface by simplifying API endpoint settings, maintaining minimal configurations for the Blocks interface and button actions to enhance usability and performance.

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -212,10 +212,9 @@ def generate(image, bg_choice, fg_ratio, bg_color, seed_val, guidance, steps):
212
  processed = preprocess_image(image, bg_choice, fg_ratio, bg_color)
213
  return gen_image(processed, seed_val, guidance, steps)
214
 
215
- # Create a Blocks interface with API info disabled
216
  with gr.Blocks(
217
  analytics_enabled=False,
218
- api_name=None, # Disable API endpoint generation
219
  title="CRM: Single Image to 3D Textured Mesh with Convolutional Reconstruction Model"
220
  ) as demo:
221
  gr.Markdown(_DESCRIPTION)
@@ -251,13 +250,12 @@ with gr.Blocks(
251
  output_ccm = gr.Image(interactive=False, label="Output CCM image")
252
  output_glb = gr.Model3D(label="Output GLB", interactive=False)
253
 
254
- # Connect the button click event with API name disabled
255
  generate_btn.click(
256
  fn=generate,
257
  inputs=[input_image, bg_choice, fg_ratio, bg_color, seed_val, guidance, steps],
258
  outputs=[output_rgb, output_ccm, output_glb],
259
- concurrency_limit=1,
260
- api_name=None # Disable API endpoint for this event
261
  )
262
 
263
  # Add examples without caching
@@ -290,5 +288,5 @@ if __name__ == "__main__":
290
  server_port=7860,
291
  show_error=True,
292
  share=True, # Only use share=True for local development
293
- api_name=None # Disable API endpoint generation
294
  )
 
212
  processed = preprocess_image(image, bg_choice, fg_ratio, bg_color)
213
  return gen_image(processed, seed_val, guidance, steps)
214
 
215
+ # Create a Blocks interface with minimal settings
216
  with gr.Blocks(
217
  analytics_enabled=False,
 
218
  title="CRM: Single Image to 3D Textured Mesh with Convolutional Reconstruction Model"
219
  ) as demo:
220
  gr.Markdown(_DESCRIPTION)
 
250
  output_ccm = gr.Image(interactive=False, label="Output CCM image")
251
  output_glb = gr.Model3D(label="Output GLB", interactive=False)
252
 
253
+ # Connect the button click event
254
  generate_btn.click(
255
  fn=generate,
256
  inputs=[input_image, bg_choice, fg_ratio, bg_color, seed_val, guidance, steps],
257
  outputs=[output_rgb, output_ccm, output_glb],
258
+ concurrency_limit=1
 
259
  )
260
 
261
  # Add examples without caching
 
288
  server_port=7860,
289
  show_error=True,
290
  share=True, # Only use share=True for local development
291
+ api_name=None # Disable API endpoint
292
  )