Skip to content

Commit 8bb397c

Browse files
authored
Merge pull request #1 from faisal-fida/copilot/fix-ef9c9fc8-3c2b-4ce1-a1c1-fa92b73cd4a1
Add --public argument to webui.py for creating public URLs
2 parents 4526d64 + e7f8865 commit 8bb397c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ cp .env.example .env
8787
```bash
8888
python webui.py --ip 127.0.0.1 --port 7788
8989
```
90+
91+
**Optional Arguments:**
92+
- `--public`: Create a public URL that can be accessed from anywhere (useful for sharing or remote access)
93+
- `--theme`: Choose a UI theme (Default, Soft, Monochrome, Glass, Origin, Citrus, Ocean, Base)
94+
95+
**Example with public access:**
96+
```bash
97+
python webui.py --ip 127.0.0.1 --port 7788 --public
98+
```
99+
90100
2. **Access the WebUI:** Open your web browser and navigate to `http://127.0.0.1:7788`.
91101
3. **Using Your Own Browser(Optional):**
92102
- Set `BROWSER_PATH` to the executable path of your browser and `BROWSER_USER_DATA` to the user data directory of your browser. Leave `BROWSER_USER_DATA` empty if you want to use local user data.

webui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ def main():
99
parser.add_argument("--ip", type=str, default="127.0.0.1", help="IP address to bind to")
1010
parser.add_argument("--port", type=int, default=7788, help="Port to listen on")
1111
parser.add_argument("--theme", type=str, default="Ocean", choices=theme_map.keys(), help="Theme to use for the UI")
12+
parser.add_argument("--public", action="store_true", help="Create a public URL that can be accessed from anywhere")
1213
args = parser.parse_args()
1314

1415
demo = create_ui(theme_name=args.theme)
15-
demo.queue().launch(server_name=args.ip, server_port=args.port)
16+
demo.queue().launch(server_name=args.ip, server_port=args.port, share=args.public)
1617

1718

1819
if __name__ == '__main__':

0 commit comments

Comments
 (0)