How to Connect Local Image Models to MindStudio AI Agents

Connect local image generation models running on your computer to MindStudio, so you can build AI agents with image generation capabilities without paying for cloud-based model usage.

What You'll Need

Step 1: Install Node.js

  1. Visit nodejs.org.
  2. Download the installer for your operating system.
  3. Run the installer and follow the prompts.

Step 2: Set Up Stable Diffusion (Forge)

First-Time Setup

Install command-line developer tools on macOS if prompted. This does not apply to other operating systems.

Terminal
git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git
cd stable-diffusion-webui-forge
./webui.sh --api

Subsequent Runs

Terminal
cd stable-diffusion-webui-forge
./webui.sh --api

Note: Python 3.10 is required.

Step 3: Download an Image Generation Model

  1. Go to https://civitai.com/models.
  2. Filter by base model "SDXL 1.0" and model type "Checkpoint".
  3. Download the model into this folder: stable-diffusion-webui-forge/models/Stable-diffusion.

You need a Civitai account to download models. Image generation models are 6GB+. Try this model for testing.

Step 4: Install the MindStudio Tunnel

Open a new Terminal window (keep Stable Diffusion running in the first one) and install the tunnel tool:

Terminal
sudo npm install -g @mindstudio-ai/local-model-tunnel

Step 5: Connect to Your MindStudio Account

Run this command to authenticate:

Terminal
mindstudio-local auth

This will open your browser and create an API key in your MindStudio account (found under Developer > API Keys).

Step 6: Register Your Models

  1. Ensure that Stable Diffusion Forge is running.
  2. Tell MindStudio about your local models:
Terminal
mindstudio-local register

This scans your local setup and makes your image models available in MindStudio.

Step 7: Start the Tunnel

Launch the connection between your computer and MindStudio:

Terminal
mindstudio-local start

Keep this Terminal window open while you're using your local models. The tunnel will stay active until you close it or lose internet connection.

Step 8: Verify Everything Works

  1. Log into MindStudio.
  2. Navigate to Service Router > Self-Hosted Models.
  3. Your local image models should appear in the list.

Step 9: Use Your Local Image Model in an AI Agent

  1. Create a new AI agent in MindStudio.
  2. Add a "Generate Image" block.
  3. Click "Model Settings" in that block.
  4. Look under the Local Models category.
  5. Select your local image model.
  6. Build and test your agent as usual.

As long as the tunnel is running, your agent will use your local image model instead of cloud-based models.

Useful Commands

  • mindstudio-local auth — Log in to MindStudio
  • mindstudio-local register — Refresh your model list
  • mindstudio-local start — Start the tunnel
  • mindstudio-local models — See available models
  • mindstudio-local status — Check connection status
  • mindstudio-local logout — Sign out

Advanced: Custom Server URL

If Stable Diffusion Forge runs on a different port:

Terminal
mindstudio-local set-config --sd-url http://127.0.0.1:7860

mindstudio-local set-config --sd-url http://127.0.0.1:7860

That's it! You're now running local image generation models while building agents in MindStudio's visual interface. This setup avoids cloud model costs and keeps your data on your own machine.

Launch Your First Agent Today