Spaces:
Running
on
Zero
Running
on
Zero
secret radio btn
Browse files
app.py
CHANGED
|
@@ -271,6 +271,22 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 271 |
|
| 272 |
output_buf = gr.State()
|
| 273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
# Handlers
|
| 275 |
demo.load(start_session)
|
| 276 |
demo.unload(end_session)
|
|
|
|
| 271 |
|
| 272 |
output_buf = gr.State()
|
| 273 |
|
| 274 |
+
# --- Add this section to explicitly register the API function ---
|
| 275 |
+
with gr.Row(visible=False): # Hide this row in the UI
|
| 276 |
+
api_trigger_btn = gr.Button("API Trigger")
|
| 277 |
+
dummy_output_for_api = gr.Textbox(visible=False) # Output type doesn't matter much here
|
| 278 |
+
dummy_inputs_for_api = [
|
| 279 |
+
text_prompt, seed, ss_guidance_strength, ss_sampling_steps,
|
| 280 |
+
slat_guidance_strength, slat_sampling_steps, mesh_simplify, texture_size
|
| 281 |
+
]
|
| 282 |
+
api_trigger_btn.click(
|
| 283 |
+
generate_and_extract_glb,
|
| 284 |
+
inputs=dummy_inputs_for_api, # Define inputs needed
|
| 285 |
+
outputs=[dummy_output_for_api], # Define an output
|
| 286 |
+
api_name="generate_and_extract_glb" # CRITICAL: Register the API name
|
| 287 |
+
)
|
| 288 |
+
# --- End API registration section ---
|
| 289 |
+
|
| 290 |
# Handlers
|
| 291 |
demo.load(start_session)
|
| 292 |
demo.unload(end_session)
|