Stable Diffusion web UI(AUTOMATIC1111) Google Colab 初期設定を変えて起動するためのui-config.jsonを変更するsedスクリプト

2023年3月4日

ui-config.jsonを変更するsedスクリプト サンプル

!sed -i -e 's/\"img2img\/Input directory\/value\": \"\"/\"img2img\/Input directory\/value\": \"\/content\/stable-diffusion-webui\/inputs\/img2img-images\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"img2img\/Output directory\/value\": \"\"/\"img2img\/Output directory\/value\": \"\/content\/stable-diffusion-webui\/outputs\/img2img-images\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"img2img\/Batch size\/value\"\: 1/\"img2img\/Batch size\/value\"\: 8/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Enable\/value\"\: false/\"customscript\/controlnet.py\/img2img\/Enable\/value\"\: true/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Preprocessor\/value\":\ “none\"/\"customscript\/controlnet.py\/img2img\/Preprocessor\/value\": \"scribble\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Model\/value\"\: \"None\"/\"customscript\/controlnet.py\/img2img\/Model\/value\"\: \"control_seg-fp16 [b9c1cc12]\"/g’ /content/stable-diffusion-webui/ui-config.json

!sed -i -e 's/\"img2img\/Input directory\/value\": \"\"/\"img2img\/Input directory\/value\": \"\/content\/stable-diffusion-webui\/inputs\/img2img-images\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"img2img\/Output directory\/value\": \"\"/\"img2img\/Output directory\/value\": \"\/content\/stable-diffusion-webui\/outputs\/img2img-images\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"img2img\/Batch size\/value\"\: 1/\"img2img\/Batch size\/value\"\: 8/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Enable\/value\"\: false/\"customscript\/controlnet.py\/img2img\/Enable\/value\"\: true/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Preprocessor\/value\":\ “none\"/\"customscript\/controlnet.py\/img2img\/Preprocessor\/value\": \"scribble\"/g’ /content/stable-diffusion-webui/ui-config.json
!sed -i -e 's/\"customscript\/controlnet.py\/img2img\/Model\/value\"\: \"None\"/\"customscript\/controlnet.py\/img2img\/Model\/value\"\: \"control_seg-fp16 [b9c1cc12]\"/g’ /content/stable-diffusion-webui/ui-config.json

スクリプト一式ダウンロード

個別に設定するのが大変なので様々なパラメーターのスクリプトファイルを作ってみました。必要なスクリプトを選んで使用してください

stable-diffusion

Posted by eightban