rgndgn commited on
Commit
22093b0
·
verified ·
1 Parent(s): 33f5c85
Files changed (1) hide show
  1. gradio_app.py +15 -16
gradio_app.py CHANGED
@@ -175,7 +175,7 @@ def generate_and_process_3d(image: Image.Image) -> str:
175
  filename = f'model_{unique_id}.glb'
176
  output_path = os.path.join(OUTPUT_DIR, filename)
177
  trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
178
- public_url = f"https://rgndgn-i3d.hf.space/file={Path(output_path).resolve()}"
179
 
180
  return public_url
181
 
@@ -187,23 +187,22 @@ def generate_and_process_3d(image: Image.Image) -> str:
187
 
188
  # Create Gradio interface
189
  with gr.Blocks() as demo:
190
- with gr.Row():
191
- input_img = gr.Image(
192
- type="pil",
193
- label=None, # Remove the label
194
- show_label=False, # Further remove label
195
- sources="upload",
196
- image_mode="RGBA",
197
- width=40,
198
- elem_id="hidden-upload" # Add an ID for CSS targeting
199
- )
200
 
201
  # Make textbox visible but hide it with CSS
202
- with gr.Row():
203
- model_url = gr.Textbox(
204
- label="Model URL",
205
- elem_id="model-url-output" # Add this for CSS targeting
206
- )
207
 
208
  input_img.upload(
209
  fn=generate_and_process_3d,
 
175
  filename = f'model_{unique_id}.glb'
176
  output_path = os.path.join(OUTPUT_DIR, filename)
177
  trimesh_mesh.export(output_path, file_type="glb", include_normals=True)
178
+ public_url = f"https://rgndgn-i3d.hf.space/gradio_api/file={Path(output_path).resolve()}"
179
 
180
  return public_url
181
 
 
187
 
188
  # Create Gradio interface
189
  with gr.Blocks() as demo:
190
+ input_img = gr.Image(
191
+ type="pil",
192
+ label=None, # Remove the label
193
+ show_label=False, # Further remove label
194
+ sources="upload",
195
+ image_mode="RGBA",
196
+ width=40,
197
+ elem_id="hidden-upload" # Add an ID for CSS targeting
198
+ )
 
199
 
200
  # Make textbox visible but hide it with CSS
201
+ model_url = gr.Textbox(
202
+ label="Model URL",
203
+ elem_id="model-url-output", # Add this for CSS targeting
204
+ show_copy_button=True,
205
+ )
206
 
207
  input_img.upload(
208
  fn=generate_and_process_3d,