alon-astria commited on
Commit
22cd415
·
verified ·
1 Parent(s): 50650ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -30,7 +30,7 @@ def virtual_tryon(human_img_path, garment_img_path, garment_type, request: Reque
30
  if not human_img_path or not garment_img_path:
31
  raise gr.Error("Please upload both a human image and a garment image.")
32
 
33
- user_ip = request.client.host if request else "unknown"
34
  if user_ip == "unknown":
35
  # This error is not shown to the user but helps in debugging
36
  print("Warning: Could not determine user IP.")
 
30
  if not human_img_path or not garment_img_path:
31
  raise gr.Error("Please upload both a human image and a garment image.")
32
 
33
+ user_ip = request.headers.get('x-forwarded-for') if request else "unknown"
34
  if user_ip == "unknown":
35
  # This error is not shown to the user but helps in debugging
36
  print("Warning: Could not determine user IP.")