FrozenBurning commited on
Commit
ec9a91e
·
1 Parent(s): 6cf1b17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -74,7 +74,6 @@ config.model.pop("latent_std")
74
  model_primx = load_from_config(config.model)
75
  # load rembg
76
  rembg_session = rembg.new_session()
77
- current_fg_state = None
78
 
79
  # background removal function
80
  def background_remove_process(input_image):
@@ -175,6 +174,7 @@ _DESCRIPTION = '''
175
 
176
  block = gr.Blocks(title=_TITLE).queue()
177
  with block:
 
178
  with gr.Row():
179
  with gr.Column(scale=1):
180
  gr.Markdown('# ' + _TITLE)
@@ -209,7 +209,7 @@ with block:
209
  label="3D GLB Model",
210
  visible=True,
211
  clear_color=[0.0, 0.0, 0.0, 0.0],
212
- camera_position=(180, None, None),
213
  tonemapping="aces",
214
  contrast=1.0,
215
  scale=1.0,
@@ -238,11 +238,9 @@ with block:
238
  outputs=[output_glb],
239
  )
240
 
241
- input_image.change(background_remove_process, inputs=[input_image], outputs=[button_gen, current_fg_state, removal_previewer])
242
-
243
- button_gen.click(process, inputs=[current_fg_state, input_num_steps, input_seed, input_cfg], outputs=[output_rgb_video, output_prim_video, output_mat_video, export_glb_btn])
244
-
245
- export_glb_btn.click(export_mesh, inputs=[], outputs=[output_glb, hdr_row])
246
 
247
  gr.Examples(
248
  examples=[
 
74
  model_primx = load_from_config(config.model)
75
  # load rembg
76
  rembg_session = rembg.new_session()
 
77
 
78
  # background removal function
79
  def background_remove_process(input_image):
 
174
 
175
  block = gr.Blocks(title=_TITLE).queue()
176
  with block:
177
+ current_fg_state = gr.State()
178
  with gr.Row():
179
  with gr.Column(scale=1):
180
  gr.Markdown('# ' + _TITLE)
 
209
  label="3D GLB Model",
210
  visible=True,
211
  clear_color=[0.0, 0.0, 0.0, 0.0],
212
+ camera_position=(270, None, None),
213
  tonemapping="aces",
214
  contrast=1.0,
215
  scale=1.0,
 
238
  outputs=[output_glb],
239
  )
240
 
241
+ input_image.change(background_remove_process, inputs=[input_image], outputs=[button_gen, current_fg_state, removal_previewer])
242
+ button_gen.click(process, inputs=[current_fg_state, input_num_steps, input_seed, input_cfg], outputs=[output_rgb_video, output_prim_video, output_mat_video, export_glb_btn])
243
+ export_glb_btn.click(export_mesh, inputs=[], outputs=[output_glb, hdr_row])
 
 
244
 
245
  gr.Examples(
246
  examples=[