diff --git a/script_examples/websockets_api_example.py b/script_examples/websockets_api_example.py index 5e80aace..d696d2bb 100644 --- a/script_examples/websockets_api_example.py +++ b/script_examples/websockets_api_example.py @@ -154,7 +154,7 @@ prompt["3"]["inputs"]["seed"] = 5 ws = websocket.WebSocket() ws.connect("ws://{}/ws?clientId={}".format(server_address, client_id)) images = get_images(ws, prompt) - +ws.close() # for in case this example is used in an environment where it will be repeatedly called, like in a Gradio app. otherwise, you'll randomly receive connection timeouts #Commented out code to display the output images: # for node_id in images: diff --git a/script_examples/websockets_api_example_ws_images.py b/script_examples/websockets_api_example_ws_images.py index b37d9893..6508ecc9 100644 --- a/script_examples/websockets_api_example_ws_images.py +++ b/script_examples/websockets_api_example_ws_images.py @@ -147,7 +147,7 @@ prompt["3"]["inputs"]["seed"] = 5 ws = websocket.WebSocket() ws.connect("ws://{}/ws?clientId={}".format(server_address, client_id)) images = get_images(ws, prompt) - +ws.close() # for in case this example is used in an environment where it will be repeatedly called, like in a Gradio app. otherwise, you'll randomly receive connection timeouts #Commented out code to display the output images: # for node_id in images: