Commit ยท
2c17e80
1
Parent(s): c9aa851
Resolve host and protocol dynamically from proxy headers in start_tryon_wrapper
Browse files270 unmodified lines271272273274275274275276277278270 unmodified lines return result_img, mask_img # If called from Gradio, construct the markdown link with all images generated in this session host = request.headers.get("host", "localhost:7860") if request else "localhost:7860" proto = "https" if "hf.space" in host else "http" host = request.headers.get("x-forwarded-host", request.headers.get("host", "localhost:7860")) if request else "localhost:7860" proto = request.headers.get("x-forwarded-proto", "https" if "hf.space" in host else "http") if request else "http" base_url = f"{proto}://{host}" url = f"{base_url}/static/outputs/{output_filename}"app.py+2-2