Sometimes we want to use FaceFusion on other devices within the local area network (LAN), which requires configuring a publicly accessible link and port.
When you run FaceFusion, you’ll see the following prompt:
To create a public link, set `share=True` in `launch()`.
However, this prompt is incorrect. If you’ve researched this issue, you’ll find it’s a leftover problem from the Gradio framework. While Stable Diffusion Web UI (which also uses Gradio) fixed this by modifying the framework, FaceFusion has not implemented this adjustment.
After extensive searching, I found a user mention that you can directly modify Gradio’s environment variables. I then “drew inferences from one example” and used the same approach to change the port as well.
The solution is extremely simple:
# Set IP to 0.0.0.0 to allow access from all devices on the current network (default is 127.0.0.1)
export GRADIO_SERVER_NAME="0.0.0.0"
# Set port to 7861 (default is 7860)
export GRADIO_SERVER_PORT="7861"
If you want these settings to persist permanently, add the above lines to your Shell configuration file (e.g., .bashrc), then run source .bashrc to apply the changes immediately.
I hope these will help someone in need~
Running on local URL but can’t access from outside - answeroverflow: This post explains how to configure a publicly accessible link for Gradio-based applications.
share=True配置方法无效,该问题源于Gradio框架,且FaceFusion未像Stable Diffusion Web UI那样对框架做定制化修改。GRADIO_SERVER_NAME=0.0.0.0允许全网段设备访问,GRADIO_SERVER_PORT可自定义端口避免冲突。.bashrc等Shell配置文件,执行source .bashrc即可即时生效。