Skip to content

Local Installation

Ben Rugg edited this page Oct 22, 2022 · 25 revisions

Instructions for running Stable Diffusion locally

Intro

"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 there's a good chance you will need to update it or install it fresh, if you already have it on your machine.

Disclaimer

This page will soon have more detailed instructions... At the moment, this is meant for users who know their way around git, etc.

Please test this beta release of AI Render and submit an issue if it isn't working. Or consider contributing to improve the Automatic1111 integration or add other local Stable Diffusion installations.

Instructions

  1. Get this version of AI Render (not publicly released yet). Install it and restart Blender.

  2. If you DON'T have the Automatic1111 Stable Diffusion Web UI installed:

    1. 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).
    2. In the Automatic1111 terminal window, quit the web server and keep the terminal window open.
  3. If you DO already have the Automatic1111 Stable Diffusion Web UI installed:

    1. Open a terminal window and cd to the web ui directory.
    2. Make sure the web ui is not running.
  4. In the terminal window, in the Automatic1111 directory, run these commands:

    1. git pull
    2. git checkout f49c08e
    3. If these don'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)
  5. Start the Automatic1111 Web UI (./webui-user.bat or ./run_webui_mac.sh).

  6. 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 in to Blender when it's done.

Contributing

The way I integrated Automatic1111 is pretty brittle. As far as I can tell, they don't have an actual API yet for img2img. If anyone knows otherwise, please tell me! And if you have the python/Blender skills to help me get all the API calls running asynchronously, I would LOVE that help, too.

Clone this wiki locally