Setting up Stable Diffusion WebUI Forge on cutting-edge hardware like the NVIDIA GeForce RTX 5070 Ti (Blackwell architecture) running under Linux presents unique bleeding-edge compatibility challenges. Standard Stable Diffusion distributions rely on stable PyTorch releases, which fail on sm_120 architectures with explicit mismatch errors.
This guide serves as a complete blueprint to set up Stable Diffusion WebUI Forge, Ollama, and Open WebUI on a fresh Linux installation, covering all the exact roadblocks and workarounds discovered along the way.
1. Prerequisites & Hardware Specifications
- GPU: NVIDIA GeForce RTX 5070 Ti (16 GB VRAM)
- Architecture: Blackwell (
sm_120) - OS: Ubuntu / Debian-based Linux distribution
- CUDA Toolkit Version: CUDA 12.8+
- Python Version: 3.10.x (recommended inside a virtual environment)
2. The Bottlenecks & Pitfalls (What Broke and Why)
Before running installation scripts, keep these crucial lessons in mind:
Roadblock A: The sm_120 PyTorch Incompatibility
Standard PyTorch (torch 2.1.x or 2.2.x) bundled with default Forge environments supports CUDA compute capabilities up to Ada Lovelace (sm_89) or Hopper (sm_90). Launching Forge on an RTX 5070 Ti yields:
NVIDIA GeForce RTX 5070 Ti with CUDA capability sm_120 is not compatible with the current PyTorch installation.
- Solution: Force-upgrade the internal
venvof Forge to PyTorch Nightly (torch 2.12.0.dev/ CUDA 12.8 build).
Roadblock B: Nightly Dependency Mismatches (torch vs torchvision)
Upgrading PyTorch alone breaks torchvision. When attempting to install matching versions, PyTorch Nightly builds often have date tag mismatches between torch and torchvision wheels (e.g., 20260408 vs 20260407), causing pip dependency resolution loops or ResolutionImpossible errors.
- Solution: Install
torchvisionwith--no-depsdirectly from the PyTorch nightly index URL.
Roadblock C: VRAM Exhaustion (Ollama Context + SDXL)
Running an LLM like gemma4:26b inside Ollama with a 16GB context window can consume ~15.5 GB VRAM (95%+ utilization). Running SDXL (Juggernaut XL) concurrently on a 16GB VRAM GPU will immediately cause a CUDA Out of Memory (OOM) error or system freezes.
- Solution: Temporarily stop or unload Ollama while generating images with Forge.
3. Step-by-Step Installation & Setup
Step 1: Install System Dependencies
Ensure Git, Python 3.10 venv, and build essentials are installed.
sudo apt update
sudo apt install -y git python3.10 python3.10-venv python3-pip wget
Step 2: Clone Stable Diffusion WebUI Forge
Clone the Forge repository to your home directory:
git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git
cd stable-diffusion-webui-forge
Step 3: Initial Virtual Environment Setup
Run the setup script once to create the virtual environment (venv). It will likely fail or output CUDA warning logs—this is expected.
./webui.sh --skip-python-version-check
(Press Ctrl+C once it finishes setting up Python or fails on CUDA check).
Step 4: Fix PyTorch & Torchvision for RTX 50-Series (sm_120)
Activate the Forge virtual environment and upgrade PyTorch and torchvision to the PyTorch Nightly cu128 binaries:
# 1. Activate Forge venv
source venv/bin/activate
# 2. Install PyTorch Nightly with CUDA 12.8 support
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
# 3. Install matching torchvision bypassing dependency checks
pip install --pre torchvision --index-url https://download.pytorch.org/whl/nightly/cu128 --no-deps
# 4. Deactivate venv
deactivate
4. Managing Memory (Ollama vs. Forge)
Because 16GB VRAM is shared across local AI tasks:
To Stop Ollama (Releasing VRAM for SDXL Generation)
sudo systemctl stop ollama
# OR
pkill ollama
To Restart Ollama After Image Generation
sudo systemctl start ollama
5. Running Stable Diffusion Forge
Launch Forge with the API enabled (allowing Open WebUI or external tools to connect):
cd ~/stable-diffusion-webui-forge
./webui.sh --api --skip-python-version-check --listen
Access the Web UI at http://127.0.0.1:7860.
6. Configuring Prompts & Safety Guidelines
SDXL base checkpoints (like Juggernaut XL) have expansive training weights and can render unexpected anatomical output when given extremely minimal prompts (e.g., a single word like "sun").
To guarantee clean, high-quality, and accurate results:
Recommended Positive Prompt Structure:
A vibrant golden sun rising over serene mountain peaks, scenic landscape, highly detailed, 8k resolution, photorealistic
Recommended Negative Prompt (Crucial for filtering):
nude, naked, undressed, NSFW, low quality, blurry, deformed, bad anatomy, cropped, extra limbs
7. Connecting Open WebUI to Forge API
- Open Open WebUI -> Admin Panel -> Settings -> Images.
- Select AUTOMATIC1111 / Forge as the Image Generation engine.
- Set the API URL to: http://172.17.0.1:7860 (Assuming Open WebUI is running as a docker image)
- Test connection and save settings.
AI Assisted Writing
Text: Gemini
Model: Auto
Image: Stable Diffusion
Image Model: juggernautXL_v9.safetensors
Image gen prompt: An AI robot painting a picture using a beautiful brush on a sunny beach with lush greeneries in background.

