aiqtech commited on
Commit
521fdd3
โ€ข
1 Parent(s): 46cbcb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -1
app.py CHANGED
@@ -269,7 +269,45 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
269
  outputs=[trial_id, image_prompt]
270
  )
271
 
272
- [์ด์ „ ์ฝ”๋“œ์˜ ๋‚˜๋จธ์ง€ ํ•ธ๋“ค๋Ÿฌ๋“ค์€ ๊ทธ๋Œ€๋กœ ์œ ์ง€]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
 
274
  if __name__ == "__main__":
275
  # 3D ์ƒ์„ฑ ํŒŒ์ดํ”„๋ผ์ธ
 
269
  outputs=[trial_id, image_prompt]
270
  )
271
 
272
+ # ๋‚˜๋จธ์ง€ ํ•ธ๋“ค๋Ÿฌ๋“ค
273
+ image_prompt.upload(
274
+ preprocess_image,
275
+ inputs=[image_prompt],
276
+ outputs=[trial_id, image_prompt],
277
+ )
278
+
279
+ image_prompt.clear(
280
+ lambda: '',
281
+ outputs=[trial_id],
282
+ )
283
+
284
+ generate_3d_btn.click(
285
+ image_to_3d,
286
+ inputs=[trial_id, seed, randomize_seed, ss_guidance_strength, ss_sampling_steps, slat_guidance_strength, slat_sampling_steps],
287
+ outputs=[output_buf, video_output],
288
+ ).then(
289
+ activate_button,
290
+ outputs=[extract_glb_btn],
291
+ )
292
+
293
+ video_output.clear(
294
+ deactivate_button,
295
+ outputs=[extract_glb_btn],
296
+ )
297
+
298
+ extract_glb_btn.click(
299
+ extract_glb,
300
+ inputs=[output_buf, mesh_simplify, texture_size],
301
+ outputs=[model_output, download_glb],
302
+ ).then(
303
+ activate_button,
304
+ outputs=[download_glb],
305
+ )
306
+
307
+ model_output.clear(
308
+ deactivate_button,
309
+ outputs=[download_glb],
310
+ )
311
 
312
  if __name__ == "__main__":
313
  # 3D ์ƒ์„ฑ ํŒŒ์ดํ”„๋ผ์ธ