카테고리 없음

[리눅스서버] sd.webui 설치

tir_hyun21 2023. 10. 9. 21:39

 

https://github.com/AUTOMATIC1111/stable-diffusion-webui
 

GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI

Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.

github.com

 

webui.sh

설치에 들어가기 앞서.

저는 MobaXterm_Personal_23.2의 서버를 사용합니다.

그리고,

관리자 계정과 사용자 계정이 필요합니다.

 

1. 가상환경설치

가상환경을 만들어 주고 사용해줍니다.

코드는 아래와 같습니다. 

conda create -n sd.webui python==3.10.6
conda activate sd.webui

 

그 뒤 

su -

를 입력해서 관리자(root) 계정으로 들어가 주고,

 

conda env list

를 입력해서 만든 가상환경의 주소를 복사하고 사용해줍니다.

conda activate /home/lll6610/.conda/envs/sd.webui

그럼 아래와 같은 상태가 되었을 겁니다.(디렉토리도 변경)

여기서 https://github.com/AUTOMATIC1111/stable-diffusion-webui

코드를 불러오기 위해 아래와 같은 코드를 실행시켜줍니다.

# Debian-based:
sudo apt install wget git python3 python3-venv libgl1 libglib2.0-0

그리고 나서 다시 사용자계정으로 연결해주고, 

가상환경을 활성화합니다.(디렉토리도 변경)

 

su - lll6610
cd /project/lll6610/test/
conda activate sd.webui

그 후 디렉토리 안에 'webui.sh'를 다운해야합니다.

webui.sh 다운

아래와 같은 코드를 사용해서 다운로드합니다.

wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh

여기서 'webui.sh'를 실행시켜야하는데, 

그럴러면 아래와 같은 코드를 입력해줘야합니다.

chmod +x webui.sh

 그리고 나서 'webui.sh'를 실행시키면 

./webui.sh

webui.sh 실행

이런식으로 잔뜩 깔립니다.

그리고 나서 실행되는 사람이 있고,

다음과 같은 오류가 뜨는 사람이 있을 겁니다.

'Ctrl + C'를 눌러줍니다.

그리고 나서 다시 실행해 봅니다.

(sd.webui) lll6610@dsd-MS-7D30:/project/lll6610/test$ ./webui.sh ################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye) ################################################################ ################################################################ Running on lll6610 user ################################################################ ################################################################ Create and activate python venv ################################################################ ################################################################ Launching launch.py... ################################################################ Cannot locate TCMalloc (improves CPU memory usage) Python 3.10.6 (main, Oct 24 2022, 16:07:47) [GCC 11.2.0] Version: v1.6.0 Commit hash: 5ef669de080814067961f28357256e8fe27544f4 Launching Web UI with arguments: no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. Loading weights [6ce0161689] from /project/lll6610/test/stable-diffusion-webui/m odels/Stable-diffusion/v1-5-pruned-emaonly.safetensors Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Startup time: 3.0s (prepare environment: 0.7s, import torch: 1.0s, import gradio : 0.2s, setup paths: 0.3s, other imports: 0.2s, load scripts: 0.2s, create ui: 0 .2s). Creating model from config: /project/lll6610/test/stable-diffusion-webui/configs /v1-inference.yaml Applying attention optimization: Doggettx... done. Model loaded in 1.2s (load weights from disk: 0.3s, create model: 0.2s, apply we ights to model: 0.6s).

오류

위와 같이 오류가 뜬다

여기서 

우선 'conda deactivate'를 입력해서 가상환경을 비활성화시키고,

아래와 같은 코드를 실행시킨다.

eval "$(conda shell.bash hook)"
conda activate sd.webui
export COMMANDLINE_ARGS="--share --xformers --enable-insecure-extension-access"

그리고 다시 

'./webui.sh'를 실행시켜주면

이렇게 뜰 것이고, 여기서

'https://bdf2d6c1fca12306be.gradio.live'

을 클릭해주면 실행된다.

이상이다.