-
Notifications
You must be signed in to change notification settings - Fork 90
Local Installation
"Local Installation" means that you are running Stable Diffusion on your own machine, instead of using a 3rd party service like DreamStudio. Running locally gives you the ability to create unlimited images for free, but it also requires some advanced setup and a good gpu.
Currently, AI Render only integrates with Automatic1111's Stable Diffusion Web UI
. And their code is changing almost daily, so you will need to update it to the latest version.
Setting up Stable Diffusion locally is for advanced users. There are a number of steps, and you may have to do some serious troubleshooting! You will also need to know your way around a Terminal, or be willing to do a lot of googling.
-
Get this version of AI Render (not publicly released yet). Install it and restart Blender.
-
If you DON'T have the Automatic1111 Stable Diffusion Web UI installed:
- Install the Automatic1111 Stable Diffusion Web UI. Follow all the installation instructions on their page, and make sure you can see it successfully running in a web browser. (You can then close the web browser).
- In the Automatic1111 terminal window, quit the web server and keep the terminal window open.
-
If you DO already have the Automatic1111 Stable Diffusion Web UI installed:
- Open a terminal window and
cd
to the web ui directory (wherever you previously installed it). - Make sure the web ui is not running.
- Open a terminal window and
-
In the terminal window, in the Automatic1111 directory, run this command to make sure you've got the latest version:
git pull
Note: If this doesn't run successfully, you'll need to do a fresh reinstall Automatic1111. (Copy the 4gb model weights file out first, so you don't have to download it again)
-
In the terminal window, update the Automatic1111 config so it starts its API:
-
On Windows:
- Run
notepad.exe .\webui.bat
- In Notepad, change
set COMMANDLINE_ARGS=
toset COMMANDLINE_ARGS=--api
- Save the file and close Notepad
- Run
-
On Mac:
- Run
vi run_webui_mac.sh
- Find the line that starts with
python webui.py
and add--api
right after it. (In vim (the text editor), typea
to enter edit mode. Then add--api
to the right place) - Save the file by hitting the
ESC
key, then typingZZ
(holdingShift
)
- Run
-
On Linux:
- Run
vi webui-user.sh
- Change
export COMMANDLINE_ARGS=""
toexport COMMANDLINE_ARGS="--api"
(In vim (the text editor), typea
to enter edit mode. Then add--api
to the right place) - Save the file by hitting the
ESC
key, then typingZZ
(holdingShift
)
- Run
-
-
Start the Automatic1111 server, using the user script you just edited:
-
On Windows: Run
.\webui-user.bat
-
On Mac: Run
./run_webui_mac.sh
-
On Linux: Run
./webui-user.sh
-
On Windows: Run
-
In Blender, in the add-on preferences for AI Render, enable Local Stable Diffusion. Make sure the settings match what you saw in Automatic1111.
You're ready to go!
When you render, you should see the progress in the Automatic1111 terminal, and the output image should be pulled into Blender when it's done.
-
For issues when installing Automatic1111's Stable Diffusion Web UI, please see their wiki or other installation tutorials
-
If the Web UI installed successfully, when it's running, you should be able to see it at http://127.0.0.1:7860/. If you can't see it, it's not installed correctly.
-
If you don't see the preferences in the add-on preferences screenshot above, make sure to restart Blender after installing the latest AI Render release.
-
If you see this error:
Received an unexpected response from the Automatic1111 Stable Diffusion server
, your version of the Web UI is either too old or too new. Run these commands in the terminal (in the web ui directory), and make sure they are successful:git pull
git checkout df0a1f8
-
If you see this error:
It looks like the Automatic1111 server is running, but it's not in API mode
, make sure to carefully follow steps 5 and 6 above. (As of the writing of these instructions, the Web UI doesn't start its API by default).
If you are still having issues, please submit a bug report. If have suggestions on how to improve these instructions, please submit a feature request.