Monikashyapa commited on
Commit
5a0469a
·
verified ·
1 Parent(s): f645d7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -38,8 +38,8 @@ def tryon_local(person_img, garment_img, seed, randomize_seed):
38
  # -----------------------------
39
  hunyuan_client = Client("tencent/Hunyuan3D-2.1")
40
 
41
- # Pick the first available endpoint as default
42
- fn_index_default = hunyuan_client.endpoints[0]["fn_index"] if hunyuan_client.endpoints else 0
43
 
44
  def tryon_to_3d(person_img, garment_img, seed, randomize_seed):
45
  tryon_img, seed_used, tryon_info = tryon_local(person_img, garment_img, seed, randomize_seed)
@@ -47,9 +47,9 @@ def tryon_to_3d(person_img, garment_img, seed, randomize_seed):
47
  return None, "Try-on failed"
48
 
49
  try:
50
- # Call the first endpoint (fn_index_default) of the Hunyuan3D API
51
  result_3d = hunyuan_client.predict(
52
- person_img=person_img,
53
  garment_img=garment_img,
54
  fn_index=fn_index_default
55
  )
 
38
  # -----------------------------
39
  hunyuan_client = Client("tencent/Hunyuan3D-2.1")
40
 
41
+ # Pick the first available endpoint
42
+ fn_index_default = hunyuan_client.endpoints[0].fn_index if hunyuan_client.endpoints else 0
43
 
44
  def tryon_to_3d(person_img, garment_img, seed, randomize_seed):
45
  tryon_img, seed_used, tryon_info = tryon_local(person_img, garment_img, seed, randomize_seed)
 
47
  return None, "Try-on failed"
48
 
49
  try:
50
+ # Send images to Hunyuan3D API
51
  result_3d = hunyuan_client.predict(
52
+ person_img=tryon_img,
53
  garment_img=garment_img,
54
  fn_index=fn_index_default
55
  )