Skip to content

Is there a way I can share my local automatic1111 webui to control it from my phone ?

I was using steamlink but not happy with that too much.
It will be better if I can use it through IP+safari with my iphone.

I know that somehow you can make it public but I dont know how it works.

I edited webui user.bat but it didnt worked for me somehow, maybe i did it wrong.

Thanks for any feedback.

19 points43 comments
Open on Reddit
About this post
Posted
Archived
Score
19 · 89% up
Kind
Text
ID
xtkovu

Author

32
posts
210
comments
52
media
View profile

53 comments

Two options - and sorry if I don't explain these in detail, I started doing that and the reply got crazily long - searching on Reddit should give you various tutorials.

​

  1. The UI library that it's built on has a feature where you can have it create a publicly accessible URL on the gradio server so anyone with an Internet connection anywhere with the URL can access your instance. This is very cool!! But also means you're sending the data via a third party site, and also it's genuinely public, so don't give that URL out publicly otherwise you might get flooded with requests.

  2. Otherwise you can set the UI to listen on either the IP address of the machine you're running it on specifically, or 0.0.0.0 will also work. Then you use your router or the machine itself to find it's IP address on your home network. e.g. 192.168.1.154 etc. Then on your phone you would connect to your home wifi, and then enter that IP address and the port that the web UI is running on.

If you want to do it while out and about you could either use option 2) and then VPN into your home network, or open a port on your router and forward to the machine in question (not recommended unless you know exactly what you're doing).

or.... and I recommend this for 90% of people out there, take advantage of gradio's ability to create the public URL. Then you can be anywhere you have data or wifi on your mobile and get to it.

That option is free, but those URLs will only work for 72 hours, then you need to restart the UI.

The ideal solution is 2) and then use Wireguard to connect into your home network.

16 points

90% of

wow thank you for your time and help ... will try when home ... big upvote for you ♥

4 points
unknown author

Deleted before we saved it.

1 points

I've done the local network setup, and it works great for my partner and I. Helps to have a networking background. Beyond your IP address, you also need to include the port, unless you've set the port to 80 (which may require running the UI as admin?). Also, that setup didn't work when using an all-in -one modem/router when I tried it (sample size = 1).

1 points

I just got this working myself, for those who might be having issues, this is what worked:

text edit the webui-user.bat file. Change this line to be exactly this:

set COMMANDLINE_ARGS=--listen

Save and close the file.

Then you need to make sure that port 7860 is open. This is one way to open a port easily:

  • Navigate to Control Panel -> System and Security -> Windows Firewall
  • Select Advanced Settings and highlight Inbound Rules in the left pane.
  • Right-click Inbound Rules and select New Rule or select New Rule from Actions on the left
  • Choose Port and click Next
  • Choose TCP and enter 7860 in Specific local ports and click Next.
  • Add the protocol (TCP)and port 7860 into the next window and click Next.
  • Select Allow the connection in the next window and hit Next.
  • Select the network types as you see fit and click Next. I enabled all three.
  • Name the rule something meaningful and click Finish.

Launch webui-user.bat as normal. It will now say Running on local URL: http://0.0.0.0:7860. For me, this URL does not work, but my machine's IP does. To get your IP, open a CMD shell (type cmd into your windows search bar) and type ipconfig. You are looking for the IPv4 Address. On the machine that you want to work from, open a browser and type http://XXX.XX.X.XX:7860 where the XXX.XX.X.XX is the IP of the machine running the webgui service.

Now it should work. Note that it will save images on the host machine as you generate them, to save them to the machine you are using to connect to the webgui, you must right-click save image as.

For reasons unknown, the above did not work at first, the webgui came up but no commands worked. I redid the steps and it works fine now, so perhaps I messed something up the first time. Just sharing that detail in case someone has the same experience.

If you want to use a different port, follow all of the above instructions for opening the port but change the COMMANDLINE_ARGS to:

set COMMANDLINE_ARGS=--listen --port XXXX

Where XXXX is the number of the port you want to use.

15 points

Thanks for the highly detailed post! I made all the steps and still can't access from my phone, I'm curious why the webui.bat file says at the end "To create a public link, set "share=True" in "launch()".
Did I miss something? Help would be very appreciated!

1 points

Listen and Share are two different things. The above is for listen, which only works on your local network. Share creates a public link, allegedly, but even the AUTOMATIC1111 docs say that it does not work.

1 points

I can't seem to make it work.
When I am using my own ip and the consequent port it works but when I try to access it from another machine it doesn't work.
Is there any extra set-up that I need to do to the other machine in order to work?
thank

1 points

UPDATE

for anyone wondering. it works if I input in the browser the ip address of the machine that runs the SD server

1 points

Now it should work. Note that it will save images on the host machine as you generate them, to save them to the machine you are using to connect to the webgui, you must right-click

save image as

.

Now it should work. Note that it will save images on the host machine as you generate them, to save them to the machine you are using to connect to the webgui, you must right-click

save image as

How would I set-up the output folder on my other machine and not on the host one?

1 points

If it’s PC you can use Windows Remote Desktop from your phone.

4 points

I figured out what I needed to do and got it working:

  • In Windows 11, I had to go to Settings > Network and internet > Ethernet
  • Then, under Network profile type, select "Private network."

This instantly got it working for me. I think this was preventing my PC from communicating with other devices on my network. I hope this helps someone looking for a solution.

3 points

This worked for me. Changed to a private network on the machine that's running A1111. Thanks 👍

1 points

You edit the webui-user.bat and change a line to "set COMMANDLINE_ARGS=---share" Then you'll get a gradio url link in the command line, which will work for your mobile, though the link expires after 72 hours.

2 points

Can I just paste this exact line in the code using notepad? Is there somewhere specific I need to place the line?

1 points

--share gives the gradio link..you have to forward ports to make it available in your mobile device

1 points

I often use automatic1111 webui but on my phone I prefer to use Photoleap. It basically has unlimited generation for free. I wish they would have a web version to use on my Mac.

1 points

I just included it in the webui.bat and I can connect from my phone on the same network entering the PC's IP. Not sure if there is anything more to it.

1 points

Personally, when im out of the house I use AnyDesk so my connection is password protected. Although it's a bit annoying to use AnyDesk with a phone screen.

1 points

If you plan to access outside of your network (the web) and you're behind a firewall or router it might help to open you port too.

1 points

For anyone still having this issue double check you are using the right ip address. I was trying it with the one I use when transferring things to my phone from my pc, but of course that was my phones ip so it didn't work. A quick ipconfig in cmd on my computer and it works perfect. No need for the firewall rule or changing network type to private. Just --listen and using http://XXX.XX.X.XX:7860 worked for me.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.