Spaces:
Running
on
L40S
Running
on
L40S
Update gradio_app.py
Browse files- gradio_app.py +6 -2
gradio_app.py
CHANGED
@@ -250,7 +250,7 @@ def generate_and_process_3d(prompt: str, seed: int = 42) -> tuple[str | None, Im
|
|
250 |
print("[debug] calling trimesh_mesh.export(...) to export to .glb")
|
251 |
trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
|
252 |
|
253 |
-
return output_path, generated_image
|
254 |
|
255 |
except Exception as e:
|
256 |
print(f"Error during generation: {str(e)}")
|
@@ -275,6 +275,10 @@ demo = gr.Interface(
|
|
275 |
)
|
276 |
],
|
277 |
outputs=[
|
|
|
|
|
|
|
|
|
278 |
gr.File(
|
279 |
label="Download 3D Model",
|
280 |
file_types=[".glb"]
|
@@ -282,7 +286,7 @@ demo = gr.Interface(
|
|
282 |
gr.Image(
|
283 |
label="Generated Image",
|
284 |
type="pil"
|
285 |
-
)
|
286 |
],
|
287 |
title="Text to 3D Model Generator",
|
288 |
description="Enter a text prompt to generate an image that will be converted into a 3D model",
|
|
|
250 |
print("[debug] calling trimesh_mesh.export(...) to export to .glb")
|
251 |
trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
|
252 |
|
253 |
+
return output_path, output_path, generated_image
|
254 |
|
255 |
except Exception as e:
|
256 |
print(f"Error during generation: {str(e)}")
|
|
|
275 |
)
|
276 |
],
|
277 |
outputs=[
|
278 |
+
gr.Model3D(
|
279 |
+
label="3D Model Preview",
|
280 |
+
clear_color=[0.0, 0.0, 0.0, 0.0],
|
281 |
+
),
|
282 |
gr.File(
|
283 |
label="Download 3D Model",
|
284 |
file_types=[".glb"]
|
|
|
286 |
gr.Image(
|
287 |
label="Generated Image",
|
288 |
type="pil"
|
289 |
+
),
|
290 |
],
|
291 |
title="Text to 3D Model Generator",
|
292 |
description="Enter a text prompt to generate an image that will be converted into a 3D model",
|