Spaces:
Running
on
Zero
Running
on
Zero
use gr.json
Browse files
app.py
CHANGED
|
@@ -385,8 +385,8 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 385 |
)
|
| 386 |
|
| 387 |
# --- Add this section to explicitly register the API function for image to 3D ---
|
| 388 |
-
#
|
| 389 |
-
|
| 390 |
api_input_type_state = gr.State(value="url")
|
| 391 |
api_model_description_state = gr.State(value="ImagenModel")
|
| 392 |
|
|
@@ -398,7 +398,7 @@ with gr.Blocks(delete_cache=(600, 600)) as demo:
|
|
| 398 |
api_image_gen_trigger_btn.click(
|
| 399 |
generate_model_from_images_and_upload,
|
| 400 |
inputs=[
|
| 401 |
-
|
| 402 |
api_input_type_state,
|
| 403 |
seed,
|
| 404 |
ss_guidance_strength,
|
|
|
|
| 385 |
)
|
| 386 |
|
| 387 |
# --- Add this section to explicitly register the API function for image to 3D ---
|
| 388 |
+
# Use gr.JSON for the API input, as it's designed for arbitrary JSON data.
|
| 389 |
+
api_image_inputs_json = gr.JSON(value=[]) # <--- CHANGED to gr.JSON and new variable name
|
| 390 |
api_input_type_state = gr.State(value="url")
|
| 391 |
api_model_description_state = gr.State(value="ImagenModel")
|
| 392 |
|
|
|
|
| 398 |
api_image_gen_trigger_btn.click(
|
| 399 |
generate_model_from_images_and_upload,
|
| 400 |
inputs=[
|
| 401 |
+
api_image_inputs_json, # <--- CHANGED to use the gr.JSON component's variable name
|
| 402 |
api_input_type_state,
|
| 403 |
seed,
|
| 404 |
ss_guidance_strength,
|