diff --git a/lora_gui.py b/lora_gui.py index 5de6a82..e037d1e 100644 --- a/lora_gui.py +++ b/lora_gui.py @@ -1099,6 +1099,8 @@ def UI(**kwargs): launch_kwargs['server_port'] = kwargs.get('server_port', 0) if kwargs.get('inbrowser', False): launch_kwargs['inbrowser'] = kwargs.get('inbrowser', False) + if kwargs.get('listen', True): + launch_kwargs['server_name'] = "0.0.0.0" print(launch_kwargs) interface.launch(**launch_kwargs) @@ -1121,6 +1123,9 @@ if __name__ == '__main__': parser.add_argument( '--inbrowser', action='store_true', help='Open in browser' ) + parser.add_argument( + '--listen', action='store_true', help='Launch gradio with server name 0.0.0.0, allowing LAN access' + ) args = parser.parse_args()