If you're having problems with a local copy of stable diffusion experiencing a connection timeout.
I've solved it by allowing websockets in my nginx proxy, like so:
location / { proxy_pass http://127.0.0.1:7860/; ## htpasswd [-c] /etc/apache2/.htpasswd user1 auth_basic "Stable Diffusion Area"; auth_basic_user_file /etc/apache2/.htpasswd; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; }