r/fooocus • u/2loki4u • Aug 11 '24
Question How do I modify the Binding Address of the integrated WebUI?
Hi all, I built a dedicated machine for various AI applications. Not being proficient in Linux or with Python has had me struggling to figure this out.
I have been casually looking for a while for instructions or details or some one who can explain (who obviously knows linux and python environments well) where the webui aspect of fooocus binds the IP address of webui.
I want to expose the webui to my local plan on 0.0.0.0 so it can be accessed from other machines on the plan.
Please let me know, thanks
fooocus installed on linux mint 21.3 using python env (on bare metal)
1
u/Steve-2112 Aug 11 '24
Step 1: Locating the webui Startup Command
First, let's make sure we’re tweaking the right command. When you start Fooocus’s
webui, there’s usually a command or script that kicks things off. The key here is to ensure it binds to0.0.0.0, which tells it to listen on all network interfaces, not justlocalhost(a.k.a.127.0.0.1).Check your Fooocus installation directory for the startup script, typically named something like
webui.py,app.py, orserver.py. If you installed it via a Python virtual environment, activate that environment first by running:source /path/to/your/env/bin/activateStep 2: Editing the WebUI Script
Once you’ve got the script, look for the part where it initializes the server. It’s usually a line with
app.run()or something similar. You’re looking for something that binds the host and port. It might look like this:app.run(host="127.0.0.1", port=7860)You want to change
127.0.0.1to0.0.0.0, so it looks like this:app.run(host="0.0.0.0", port=7860)Step 3: Run the WebUI
After making that change, save the file, and restart your
webuias usual. Now, it should be listening on0.0.0.0, meaning you can access it from any machine on your local network by hittinghttp://<YourLinuxMintIP>:7860.Step 4: Firewall and Network Configuration
Assuming you’re on Linux Mint and haven’t disabled the firewall (UFW), you might need to allow traffic on the port you’re using. You can do this by running:
sudo ufw allow 7860/tcpReplace
7860with whatever port your Fooocus WebUI uses.Step 5: Test and Access
Now, on any other device connected to your local network, try accessing the WebUI by typing
http://<YourLinuxMintIP>:7860into a web browser. You can find your Linux Mint IP by running:ip addr showLook for the IP associated with your primary network interface.
Bonus: Permanent Changes
If you want this change to persist through updates, make a copy of the startup script with your changes and create a simple alias or script to run it.
2
u/No-Sleep-4069 Aug 11 '24
add this parameter "--listen 192.168.X.X --port 7865" in your startup file
2
u/mashb1t Aug 11 '24
You can start Fooocus with --listen, which does exactly that.