Follow these steps carefully for a successful installation.
Step 1: Set Up Environment
Make sure you are in the Sagemaker directory. Remember, everything you do outside this directory won’t get saved.
Step 2: Install Miniconda
Miniconda is crucial for creating isolated Python environments. Install it using the following commands:
ls (to check which directory you are in)
cd SageMaker
wget <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-Linux-x86_64.sh> -O "miniconda.sh"
bash "miniconda.sh" -b -u -p "miniconda"
Activate the base environment with this command:
source miniconda/bin/activate
Step 3: Install Automatic1111
Make sure you activate the environment
cd SageMaker
source miniconda/bin/activate
git clone <https://github.com/AUTOMATIC1111/stable-diffusion-webui.git>
cd stable-diffusion-webui
bash webui.sh --xformers
If you see this “Running on local URL: http://127.0.0.1:7860 or http://127.0.0.1:7861” then you can proceed to the next step.
Step 4: Install Ngrok for Hosting in a New Terminal
Ngrok is used for exposing local servers to the internet. Install it with these commands:
OPEN A NEW TERMINAL
cd SageMaker
source miniconda/bin/activate
pip install ngrok
pip install pyngrok
Run ngrok
to check if it’s installed.
Sign up on https://ngrok.com/ and copy the authtoken code snippet.
Paste the auth token and press enter
Finally, run this command based on which UI you are running:
ngrok http 127.0.0.1:7860
or
ngrok http *your local URL*
Click the link forwarding to open a new tab.
Congrats! You’re all set.
How to open Automatic 1111 again after stopping the instance
Step 1 – Activate your environment
Activate your environment
cd SageMaker
source miniconda/bin/activate
cd stable-diffusion-webui
python launch.py
If you see this “Running on local URL: http://127.0.0.1:7860 ” then you can proceed to the next step.
Step 2 – Open a new terminal
Activate your environment
cd SageMaker
source miniconda/bin/activate
copy the authtoken code snippet.
Paste the Authtoken and press enter
Finally, run this command
ngrok http 127.0.0.1:7860
or
ngrok http *your local URL*
Click the link forwarding to open a new tab.
Congrats! You’re all set.