John6666 commited on
Commit
6de4530
·
verified ·
1 Parent(s): 6a86353

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +9 -4
gradio_app.py CHANGED
@@ -29,12 +29,17 @@ def generate_and_process_3d(image: Image.Image) -> tuple[str | None, str | None]
29
  print(f"Error during generation: {str(e)}")
30
  return None, None
31
 
 
 
 
 
 
32
  # Create Gradio app using Blocks
33
- with gr.Blocks() as demo:
34
- 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.")
35
 
36
  input_img = gr.Image(
37
- type="pil", label="Input Image", sources="upload", image_mode="RGBA", width=40,
38
  )
39
 
40
  model_output = gr.Model3D(
@@ -42,7 +47,7 @@ with gr.Blocks() as demo:
42
  clear_color=[0.0, 0.0, 0.0, 0.0],
43
  visible=False
44
  )
45
- output_url = gr.Textbox(label="Output URL", value="", lines=1, interactive=False)
46
 
47
  # Event handler
48
  input_img.upload(
 
29
  print(f"Error during generation: {str(e)}")
30
  return None, None
31
 
32
+ css = """
33
+ .image { margin: 0px auto; object-fit: contain; !important; }
34
+ .info { align-items: center; text-align: center; }
35
+ """
36
+
37
  # Create Gradio app using Blocks
38
+ with gr.Blocks(theme=gr.themes.Soft(), fill_width=True, fill_height=True, elem_id="container", css=css) as demo:
39
+ 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")
40
 
41
  input_img = gr.Image(
42
+ type="pil", label="Input Image", sources="upload", image_mode="RGBA", width=40, elem_classes="image",
43
  )
44
 
45
  model_output = gr.Model3D(
 
47
  clear_color=[0.0, 0.0, 0.0, 0.0],
48
  visible=False
49
  )
50
+ output_url = gr.Textbox(label="Output URL", value="", lines=1, interactive=False, show_copy_button=True)
51
 
52
  # Event handler
53
  input_img.upload(