Skip to content

Commit

Permalink
Add --listen support
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 6, 2023
1 parent 9e6b4cb commit 414a98d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ This will store your a backup file with your current locally installed pip packa

* 2023/03/05 (v21.1.5):
- Add replace underscore with space option to WD14 captioning. Thanks @sALTaccount!
- Improve how custom preset is set and handles. Still not perfect but better.
- Improve how custom preset is set and handles.
- Add support for `--listen` argument. This allow gradio to listen for connections from other devices on the network (or internet). For example: `gui.ps1 --listen "0.0.0.0"` will allow anyone to connect to the gradio webui.
* 2023/03/05 (v21.1.4):
- Removing legacy and confusing use 8bit adam chackbox. It is now configured using the Optimiser drop down list. It will be set properly based on legacy config files.
* 2023/03/04 (v21.1.3):
Expand Down
7 changes: 7 additions & 0 deletions kohya_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def UI(**kwargs):
server_port = kwargs.get('server_port', 0)
inbrowser = kwargs.get('inbrowser', False)
share = kwargs.get('share', False)
server_name = kwargs.get('listen')

launch_kwargs['server_name'] = server_name
if username and password:
launch_kwargs['auth'] = (username, password)
if server_port > 0:
Expand All @@ -66,6 +69,9 @@ def UI(**kwargs):
if __name__ == '__main__':
# torch.cuda.set_per_process_memory_fraction(0.48)
parser = argparse.ArgumentParser()
parser.add_argument(
'--listen', type=str, default='127.0.0.1', help='IP to listen on for connections to Gradio'
)
parser.add_argument(
'--username', type=str, default='', help='Username for authentication'
)
Expand Down Expand Up @@ -93,4 +99,5 @@ def UI(**kwargs):
inbrowser=args.inbrowser,
server_port=args.server_port,
share=args.share,
listen=args.listen,
)

0 comments on commit 414a98d

Please sign in to comment.