stablediffusion module — internal port mismatch (3001 vs 7860), UI unreachable
Posted by qualle
Summary: After getting GPU passthrough working (JELLYFINHWACCEL=nvidia, confirmed via nvidia-smi inside the container), A1111 starts up fine, loads the model, and is fully healthy — but the WebUI is unreachable from outside because it's actually listening on port 3001 internally, while the module's compose file only publishes 7860. Evidence: docker ps shows the container publishing 7860 as expected: 0.0.0.0:7860-7860/tcp, [::]:7860-7860/tcp sb-stablediffusion But webui.log shows A1111 launched with --port 3001 and Gradio bound accordingly: Launching Web UI with arguments: -f --port 3001 --listen --api --xformers --skip-install --enable-insecure-extension-access --no-half-vae ... Running on local URL: [0 . 0 . 0 . 0]:3001 Confirmed internally reachable on port 3001, not on the published 7860: docker exec sb-stablediffusion curl -s -o /dev/null -w "%{httpcode}\n" localhost:3001 → 200 curl -s -o /dev/null -w "%{httpcode}\n" localhost:3001 (from host) → 000 Container/image: ghcr.io/ashleykleynhans/stable-diffusion-webui:latest (RunPod-based template, TEMPLATE VERSION 8.11.8) Expected fix: either the module's ports: mapping should be 7860:3001 instead of 7860:7860, or the CLIARGS passed to the entrypoint should force --port 7860 to match what's published. Setup: GPU (RTX 3060) correctly passed through via nvidia-container-toolkit, JELLYFINHWACCEL=nvidia set, nvidia-smi works fine inside the container. Not a GPU/driver issue — purely a port mismatch once the container is actually healthy.
4 replies
Chris wrote:
You found a real bug — nice catch. The Stable Diffusion module publishes port 7860, but this image's WebUI actually listens on 3001, so the two never meet and the page won't load. I've flagged it with Tom for a proper fix. To use it today, create a small override file at /opt/sparkbox/state/overrides/stablediffusion.yml containing: services: stablediffusion: ports: - "7860:3001" Then run sudo sparkbox up and open http://your-box-ip:7860. The health dot may stay amber because the built-in check also looks at 7860 — ignore it for now, the UI itself will load; the proper fix will sort both.
qualle wrote:
I tried this but it doesn’t reached the web ui
Chris wrote:
Right — that's on me. SparkBox merges port mappings rather than replacing them, so that override clashed with the built-in one instead of swapping it — that's why the page still wouldn't load. First remove the override you made, since it's the thing clashing: sudo rm /opt/sparkbox/state/overrides/stablediffusion.yml Then open the module's own config: sudo nano /opt/sparkbox/modules/stablediffusion/docker-compose.yml Change the line - "7860:7860" to - "7860:3001", and a few lines below in the healthcheck line change both localhost:7860 to localhost:3001. Save with Ctrl+O, Enter, Ctrl+X, then run sudo sparkbox up. Open http://your-box-ip:7860 and it'll load.
qualle wrote:
Thanks that helped👍