Wiki source code of AI--Ollama---StableDiffusion
Last modified by René Schmidt on 2025/01/30 15:54
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | (% class="jumbotron" %) | ||
| 2 | ((( | ||
| 3 | (% class="container" %) | ||
| 4 | ((( | ||
| 5 | == Setup WSL (Windows) == | ||
| 6 | |||
| 7 | === Install WSL and Ubuntu === | ||
| 8 | |||
| 9 | wsl ~-~-install | ||
| 10 | |||
| 11 | === Connect to a WSL Instance in a new window === | ||
| 12 | |||
| 13 | wsl -d Ubuntu | ||
| 14 | |||
| 15 | == Install Ollama == | ||
| 16 | |||
| 17 | [[https:~~/~~/ollama.com/download>>url:https://ollama.com/download]] | ||
| 18 | |||
| 19 | === Add a model to Ollama === | ||
| 20 | |||
| 21 | ollama pull llama2 | ||
| 22 | |||
| 23 | |||
| 24 | == "Watch" GPU Performance in Linux == | ||
| 25 | |||
| 26 | watch -n 0.5 nvidia-smi | ||
| 27 | |||
| 28 | |||
| 29 | == Install Docker == | ||
| 30 | |||
| 31 | # Add Docker's official GPG key: | ||
| 32 | sudo apt-get update | ||
| 33 | sudo apt-get install ca-certificates curl | ||
| 34 | sudo install -m 0755 -d /etc/apt/keyrings | ||
| 35 | sudo curl -fsSL https:~/~/download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||
| 36 | sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
| 37 | |||
| 38 | # Add the repository to Apt sources: | ||
| 39 | echo \ | ||
| 40 | "deb [arch=$(dpkg ~-~-print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https:~/~/download.docker.com/linux/ubuntu \ | ||
| 41 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
| 42 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
| 43 | sudo apt-get update | ||
| 44 | |||
| 45 | #Install Dockersudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
| 46 | |||
| 47 | == Run Open WebUi Docker Container == | ||
| 48 | |||
| 49 | docker run -d ~-~-network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http:~/~/127.0.0.1:11434 ~-~-name open-webui ~-~-restart always ghcr.io/open-webui/open-webui:main | ||
| 50 | |||
| 51 | |||
| 52 | == Stable Diffusion Install == | ||
| 53 | |||
| 54 | === Prereqs === | ||
| 55 | |||
| 56 | ==== Pyenv ==== | ||
| 57 | |||
| 58 | #Install Pyenv prereqssudo apt install -y make build-essential libssl-dev zlib1g-dev \ | ||
| 59 | libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ | ||
| 60 | libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git | ||
| 61 | |||
| 62 | #Install Pyenv | ||
| 63 | |||
| 64 | curl [[https:~~/~~/pyenv.run>>url:https://pyenv.run/]] | bash | ||
| 65 | |||
| 66 | #Install Python 3.10 | ||
| 67 | |||
| 68 | pyenv install 3.10 | ||
| 69 | |||
| 70 | #Make it global | ||
| 71 | |||
| 72 | pyenv global 3.10 | ||
| 73 | |||
| 74 | |||
| 75 | === Install Stable Diffusion === | ||
| 76 | |||
| 77 | wget -q [[https:~~/~~/raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh>>url:https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh]] | ||
| 78 | |||
| 79 | # Make it executable | ||
| 80 | |||
| 81 | chmod +x webui.sh | ||
| 82 | |||
| 83 | #Run it | ||
| 84 | |||
| 85 | ./webui.sh ~-~-listen ~-~-api | ||
| 86 | ))) | ||
| 87 | ))) |