mirror of
				https://github.com/AbdBarho/stable-diffusion-webui-docker.git
				synced 2025-11-03 18:53:14 -05:00 
			
		
		
		
	
		
			
	
	
		
			29 lines
		
	
	
		
			774 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
		
		
			
		
	
	
			29 lines
		
	
	
		
			774 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| 
								 | 
							
								#!/bin/bash
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								declare -A MODELS
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								MODELS["${WORKDIR}/models/ldm/stable-diffusion-v1/model.ckpt"]=model.ckpt
							 | 
						||
| 
								 | 
							
								MODELS["${ROOT}/GFPGANv1.3.pth"]=GFPGANv1.3.pth
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								for path in "${!MODELS[@]}"; do
							 | 
						||
| 
								 | 
							
								  name=${MODELS[$path]}
							 | 
						||
| 
								 | 
							
								  base=$(dirname "${path}")
							 | 
						||
| 
								 | 
							
								  from_path="/models/${name}"
							 | 
						||
| 
								 | 
							
								  if test -f "${from_path}"; then
							 | 
						||
| 
								 | 
							
								    mkdir -p "${base}" && ln -sf "${from_path}" "${path}" && echo "Mounted ${name}"
							 | 
						||
| 
								 | 
							
								  else
							 | 
						||
| 
								 | 
							
								    echo "Skipping ${name}"
							 | 
						||
| 
								 | 
							
								  fi
							 | 
						||
| 
								 | 
							
								done
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# force realesrgan cache
							 | 
						||
| 
								 | 
							
								rm -rf /opt/conda/lib/python3.7/site-packages/realesrgan/weights
							 | 
						||
| 
								 | 
							
								ln -s -T /models /opt/conda/lib/python3.7/site-packages/realesrgan/weights
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# force facexlib cache
							 | 
						||
| 
								 | 
							
								mkdir -p /cache/weights/ ${WORKDIR}/gfpgan/
							 | 
						||
| 
								 | 
							
								ln -sf /cache/weights/ ${WORKDIR}/gfpgan/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# mount config
							 | 
						||
| 
								 | 
							
								ln -sf /docker/config.json ${WORKDIR}/config.json
							 |