LM Studio + Stable Diffusion WebUI image generation setup

Learn to connect LM Studio to Stable Diffusion WebUI through a local MCP server, enable the API, and reuse 1024 × 1024 image settings.

Player not loading? Watch on YouTube

This tutorial connects LM Studio to Stable Diffusion WebUI ReForge so a chat prompt can trigger image generation. The speaker explains that the local LLM calls an image model through a tool; the language model does not generate the picture itself. He describes the completed workflow as running offline on his own hardware.

The setup starts with Node.js and Stability Matrix, which the speaker uses to install ReForge and download an image checkpoint. His example uses Epic Realism. He enables the WebUI API with the --api launch argument, then tests an orange-cat prompt at 22 steps and 1024 × 1024 resolution. Those generation settings become a reference for the later chat request.

Next, he downloads an MCP server package, runs npm install and npm run build, and configures LM Studio with the resulting build/index.js path. The configuration also specifies the WebUI address and an image output directory. A JSON error interrupts the setup because a Windows path contains a missing escape character; the tutorial shows the correction before saving.

The final example requires a model with tool calling capability and the image generation integration enabled in the chat. The speaker submits a prompt with the earlier settings and receives an image through LM Studio. He also explains that tool access can require approval unless the user selects allow all.