Spaces:
Runtime error
Runtime error
Upload gradio_app.py
Browse files- gradio_app.py +10 -14
gradio_app.py
CHANGED
@@ -229,22 +229,18 @@ def generate_and_process_3d(image: Image.Image) -> tuple[str | None, str | None]
|
|
229 |
traceback.print_exc()
|
230 |
return None, None
|
231 |
|
|
|
|
|
|
|
|
|
|
|
232 |
# Create Gradio app using Blocks
|
233 |
-
with gr.Blocks() as demo:
|
234 |
-
gr.Markdown("This space is based on [Stable Point-Aware 3D](https://huggingface.co/spaces/stabilityai/stable-point-aware-3d) by Stability AI, [Text to 3D](https://huggingface.co/spaces/jbilcke-hf/text-to-3d) by jbilcke-hf.")
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
)
|
240 |
-
|
241 |
-
with gr.Row():
|
242 |
-
model_output = gr.Model3D(
|
243 |
-
label="Generated .GLB model",
|
244 |
-
clear_color=[0.0, 0.0, 0.0, 0.0],
|
245 |
-
visible=False
|
246 |
-
)
|
247 |
-
output_url = gr.Textbox(label="Output URL", value="", lines=1, interactive=False, visible=True)
|
248 |
|
249 |
# Event handler
|
250 |
input_img.upload(
|
|
|
229 |
traceback.print_exc()
|
230 |
return None, None
|
231 |
|
232 |
+
css = """
|
233 |
+
.image { margin: 0px auto; object-fit: contain; !important; }
|
234 |
+
.info { align-items: center; text-align: center; }
|
235 |
+
"""
|
236 |
+
|
237 |
# Create Gradio app using Blocks
|
238 |
+
with gr.Blocks(theme=gr.themes.Soft(), fill_width=True, fill_height=True, elem_id="container", css=css) as demo:
|
239 |
+
gr.Markdown("This space is based on [Stable Point-Aware 3D](https://huggingface.co/spaces/stabilityai/stable-point-aware-3d) by Stability AI, [Text to 3D](https://huggingface.co/spaces/jbilcke-hf/text-to-3d) by jbilcke-hf.", elem_classes="info")
|
240 |
|
241 |
+
input_img = gr.Image(type="pil", label="Input Image", sources="upload", image_mode="RGBA", width=128, elem_classes="image")
|
242 |
+
model_output = gr.Model3D(label="Generated .GLB model", clear_color=[0.0, 0.0, 0.0, 0.0])
|
243 |
+
output_url = gr.Textbox(label="Output URL", value="", lines=1, interactive=False, visible=True, show_copy_button=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
# Event handler
|
246 |
input_img.upload(
|