dream.py: use localhost in url when host is 0.0.0.0

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
This commit is contained in:
Cragin Godley 2022-09-02 14:56:52 -04:00 committed by GitHub
parent 68f62c8352
commit 918ade12ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,7 +281,10 @@ def dream_server_loop(t2i, host, port):
DreamServer.model = t2i
dream_server = ThreadingDreamServer((host, port))
print("\nStarted Stable Diffusion dream server!")
print(f"Point your browser at http://{host}:{port} or use the host's DNS name or IP address.")
if host == '0.0.0.0':
print(f"Point your browser at http://localhost:{port} or use the host's DNS name or IP address.")
else:
print(f"Point your browser at http://{host}:{port}.")
try:
dream_server.serve_forever()