add guofeng template
This commit is contained in:
		
							parent
							
								
									9c11e2fc02
								
							
						
					
					
						commit
						64601e0f14
					
				
							
								
								
									
										22
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								Dockerfile
									
									
									
									
									
								
							@ -1,22 +0,0 @@
 | 
			
		||||
FROM chilloutai/stable-diffusion:1.0.0
 | 
			
		||||
 | 
			
		||||
SHELL ["/bin/bash", "-c"]
 | 
			
		||||
 | 
			
		||||
ENV PATH="${PATH}:/workspace/stable-diffusion-webui/venv/bin"
 | 
			
		||||
 | 
			
		||||
WORKDIR /
 | 
			
		||||
 | 
			
		||||
ADD model.safetensors /
 | 
			
		||||
 | 
			
		||||
RUN pip install -U xformers
 | 
			
		||||
RUN pip install runpod
 | 
			
		||||
 | 
			
		||||
ADD koreanDollLikeness_v15.safetensors /workspace/stable-diffusion-webui/models/Lora/koreanDollLikeness_v15.safetensors
 | 
			
		||||
ADD japaneseDollLikeness_v10.safetensors /workspace/stable-diffusion-webui/models/Lora/japaneseDollLikeness_v10.safetensors
 | 
			
		||||
ADD taiwanDollLikeness_v10.safetensors /workspace/stable-diffusion-webui/models/Lora/taiwanDollLikeness_v10.safetensors
 | 
			
		||||
 | 
			
		||||
ADD handler.py .
 | 
			
		||||
ADD start.sh /start.sh
 | 
			
		||||
RUN chmod +x /start.sh
 | 
			
		||||
 | 
			
		||||
CMD [ "/start.sh" ]
 | 
			
		||||
							
								
								
									
										17
									
								
								guofeng-api-template/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								guofeng-api-template/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
			
		||||
FROM chilloutai/guofeng-template:1.0.0
 | 
			
		||||
 | 
			
		||||
SHELL ["/bin/bash", "-c"]
 | 
			
		||||
 | 
			
		||||
ENV PATH="${PATH}:/workspace/stable-diffusion-webui/venv/bin"
 | 
			
		||||
 | 
			
		||||
WORKDIR /
 | 
			
		||||
 | 
			
		||||
RUN pip install -U xformers
 | 
			
		||||
RUN pip install runpod
 | 
			
		||||
 | 
			
		||||
ADD webui.py /workspace/stable-diffusion-webui/webui.py
 | 
			
		||||
ADD handler.py .
 | 
			
		||||
ADD start.sh /start.sh
 | 
			
		||||
RUN chmod +x /start.sh
 | 
			
		||||
 | 
			
		||||
CMD [ "/start.sh" ]
 | 
			
		||||
							
								
								
									
										1
									
								
								guofeng-api-template/build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										1
									
								
								guofeng-api-template/build.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
DOCKER_BUILDKIT=1 docker build -t chilloutai/guofeng-api:1.0.0 .
 | 
			
		||||
@ -4,7 +4,7 @@ export PYTHONUNBUFFERED=1
 | 
			
		||||
source /workspace/stable-diffusion-webui/venv/bin/activate
 | 
			
		||||
cd /workspace/stable-diffusion-webui
 | 
			
		||||
echo "starting api"
 | 
			
		||||
python webui.py --port 3000 --nowebui --api --xformers --enable-insecure-extension-access --ckpt /model.safetensors &
 | 
			
		||||
python webui.py --port 3000 --nowebui --api --xformers --enable-insecure-extension-access --ckpt ./models/Stable-diffusion/basemodel.safetensors &
 | 
			
		||||
cd /
 | 
			
		||||
 | 
			
		||||
echo "starting worker"
 | 
			
		||||
							
								
								
									
										21
									
								
								guofeng-template/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								guofeng-template/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
			
		||||
FROM runpod/stable-diffusion:web-automatic-1.5.16
 | 
			
		||||
 | 
			
		||||
SHELL ["/bin/bash", "-c"]
 | 
			
		||||
 | 
			
		||||
ENV PATH="${PATH}:/workspace/stable-diffusion-webui/venv/bin"
 | 
			
		||||
 | 
			
		||||
WORKDIR /
 | 
			
		||||
 | 
			
		||||
RUN rm /workspace/v1-5-pruned-emaonly.ckpt
 | 
			
		||||
 | 
			
		||||
ADD ./models/basemodel.safetensors /workspace/stable-diffusion-webui/models/Stable-diffusion/basemodel.safetensors
 | 
			
		||||
ADD ./models/Lora/ /workspace/stable-diffusion-webui/models/Lora/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ADD relauncher.py .
 | 
			
		||||
ADD webui-user.sh .
 | 
			
		||||
ADD start.sh /start.sh
 | 
			
		||||
RUN chmod a+x /start.sh
 | 
			
		||||
 | 
			
		||||
SHELL ["/bin/bash", "--login", "-c"]
 | 
			
		||||
CMD [ "/start.sh" ]
 | 
			
		||||
							
								
								
									
										1
									
								
								guofeng-template/build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										1
									
								
								guofeng-template/build.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
DOCKER_BUILDKIT=1 docker build -t chilloutai/guofeng-template:1.0.0 .
 | 
			
		||||
							
								
								
									
										3
									
								
								guofeng-template/models/download.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								guofeng-template/models/download.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
wget -O ./Lora/Moxin_1010.safetensors https://civitai.com/api/download/models/14856
 | 
			
		||||
wget -O ./basemodel.safetensors https://civitai.com/api/download/models/12378
 | 
			
		||||
wget -O ./Lora/Moxin_Shukezouma.safetensors https://civitai.com/api/download/models/16075
 | 
			
		||||
							
								
								
									
										12
									
								
								guofeng-template/relauncher.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								guofeng-template/relauncher.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
import os, time
 | 
			
		||||
 | 
			
		||||
n = 0
 | 
			
		||||
while True:
 | 
			
		||||
    print('Relauncher: Launching...')
 | 
			
		||||
    if n > 0:
 | 
			
		||||
        print(f'\tRelaunch count: {n}')
 | 
			
		||||
    launch_string = "/workspace/stable-diffusion-webui/webui.sh -f"
 | 
			
		||||
    os.system(launch_string)
 | 
			
		||||
    print('Relauncher: Process is ending. Relaunching in 2s...')
 | 
			
		||||
    n += 1
 | 
			
		||||
    time.sleep(2)
 | 
			
		||||
							
								
								
									
										32
									
								
								guofeng-template/start.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								guofeng-template/start.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,32 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
echo "Container Started"
 | 
			
		||||
export PYTHONUNBUFFERED=1
 | 
			
		||||
source /workspace/stable-diffusion-webui/venv/bin/activate
 | 
			
		||||
cd /workspace/stable-diffusion-webui
 | 
			
		||||
python relauncher.py &
 | 
			
		||||
 | 
			
		||||
if [[ $PUBLIC_KEY ]]
 | 
			
		||||
then
 | 
			
		||||
    mkdir -p ~/.ssh
 | 
			
		||||
    chmod 700 ~/.ssh
 | 
			
		||||
    cd ~/.ssh
 | 
			
		||||
    echo $PUBLIC_KEY >> authorized_keys
 | 
			
		||||
    chmod 700 -R ~/.ssh
 | 
			
		||||
    cd /
 | 
			
		||||
    service ssh start
 | 
			
		||||
    echo "SSH Service Started"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [[ $JUPYTER_PASSWORD ]]
 | 
			
		||||
then
 | 
			
		||||
    ln -sf /examples /workspace
 | 
			
		||||
    ln -sf /root/welcome.ipynb /workspace
 | 
			
		||||
 | 
			
		||||
    cd /
 | 
			
		||||
    jupyter lab --allow-root --no-browser --port=8888 --ip=* \
 | 
			
		||||
        --ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' \
 | 
			
		||||
        --ServerApp.token=$JUPYTER_PASSWORD --ServerApp.allow_origin=* --ServerApp.preferred_dir=/workspace
 | 
			
		||||
    echo "Jupyter Lab Started"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
sleep infinity
 | 
			
		||||
							
								
								
									
										47
									
								
								guofeng-template/webui-user.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								guofeng-template/webui-user.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
 | 
			
		||||
# #!/bin/bash
 | 
			
		||||
#########################################################
 | 
			
		||||
# Uncomment and change the variables below to your need:#
 | 
			
		||||
#########################################################
 | 
			
		||||
 | 
			
		||||
# Install directory without trailing slash
 | 
			
		||||
install_dir="/workspace"
 | 
			
		||||
 | 
			
		||||
# Name of the subdirectory
 | 
			
		||||
#clone_dir="stable-diffusion-webui"
 | 
			
		||||
 | 
			
		||||
# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
 | 
			
		||||
export COMMANDLINE_ARGS="--port 3000 --xformers --ckpt /workspace/basemodel.safetensors --listen --enable-insecure-extension-access"
 | 
			
		||||
 | 
			
		||||
# python3 executable
 | 
			
		||||
#python_cmd="python3"
 | 
			
		||||
 | 
			
		||||
# git executable
 | 
			
		||||
#export GIT="git"
 | 
			
		||||
 | 
			
		||||
# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
 | 
			
		||||
# venv_dir="/workspace/venv"
 | 
			
		||||
 | 
			
		||||
# script to launch to start the app
 | 
			
		||||
# export LAUNCH_SCRIPT="dummy.py"
 | 
			
		||||
 | 
			
		||||
# install command for torch
 | 
			
		||||
#export TORCH_COMMAND="pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"
 | 
			
		||||
 | 
			
		||||
# Requirements file to use for stable-diffusion-webui
 | 
			
		||||
#export REQS_FILE="requirements_versions.txt"
 | 
			
		||||
 | 
			
		||||
# Fixed git repos
 | 
			
		||||
#export K_DIFFUSION_PACKAGE=""
 | 
			
		||||
#export GFPGAN_PACKAGE=""
 | 
			
		||||
 | 
			
		||||
# Fixed git commits
 | 
			
		||||
#export STABLE_DIFFUSION_COMMIT_HASH=""
 | 
			
		||||
#export TAMING_TRANSFORMERS_COMMIT_HASH=""
 | 
			
		||||
#export CODEFORMER_COMMIT_HASH=""
 | 
			
		||||
#export BLIP_COMMIT_HASH=""
 | 
			
		||||
 | 
			
		||||
# Uncomment to enable accelerated launch
 | 
			
		||||
#export ACCELERATE="True"
 | 
			
		||||
 | 
			
		||||
###########################################
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user