generate_stable_diffusion_imageLABSCO SUMMARY
Two model families, one interface, nothing leaving the machine.
Flux and Stable Diffusion have different strengths and usually different tooling; here they are two tools with the same parameter set, so a fast draft and a detailed final render are one word apart. Everything runs locally against a compiled runtime, which is why it works on modest hardware — and why the first run is a real download.
What it is
A local image generator exposed as an MCP server. It drives a compiled C++ Stable Diffusion runtime rather than a Python pipeline, and covers both the Flux family and the Stable Diffusion family behind one interface.
What you get
- Images generated with Stable Diffusion models, SDXL among them (generate_stable_diffusion_image)
- Images generated with the Flux models, which are tuned for fast drafts (generate_flux_image)
- Control over dimensions, sampling steps, guidance scale, seed and sampling method on every call
- Negative prompts on the Stable Diffusion side, where the models support them
- Generation from a plain sentence in the editor chat, with parameters named inline
- The same engine reachable from the command line and through a separate REST interface, for use outside MCP
- Generated files written to an output directory you configure, with the path returned to the caller
Requirements
A local build of the stable-diffusion.cpp runtime and the model weights downloaded — the setup script does both, interactively. Python, and a GPU if you want it fast; it runs on modest hardware without one. Configuration lives in a single JSON file you copy into your editor's MCP settings.
Setup effort
Build from source — git clone https://github.com/CLOUDWERX-DEV/DiffuGen.git
USE CASES
Sketching a visual idea without leaving the editor
Ask for the image in the chat and get a file path back.
Producing a higher-quality version of a draft you liked
Rerun the same prompt on a Stable Diffusion model with more sampling steps.
Reproducing an image exactly
Fix the seed and keep the other parameters, so the same prompt gives the same picture.
Steering the result away from something
Add a negative prompt on the Stable Diffusion side.
Iterating on composition cheaply
Use the fast Flux model to settle the shape, then switch models once the composition is right.
2 tools
Listed in project docs. Your client may show a different list.
generate_flux_imageBEFORE YOU INSTALL
What to know first
Tools you get
2 tools named in the project's documentation.
Requires
- Python 3.8 or newer (3.10 or newer recommended)
- RAM: 8GB system memory
- Storage: 5GB free disk space (SSD preferred for faster model loading)
- GPU optional; NVIDIA GPU with 6GB+ VRAM recommended (RTX 2060 or better)
Where it runs
All 4 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/CLOUDWERX-DEV/DiffuGen.git
cd DiffuGen
chmod +x diffugen.sh
chmod +x setup_diffugen.sh
./setup_diffugen.shMCP Clients
Cursor
{
"mcpServers": {
"diffugen": {
"command": "/home/cloudwerxlab/Desktop/Servers/MCP/Tools/DiffuGen/diffugen.sh",
"args": [],
"env": {
"CUDA_VISIBLE_DEVICES": "0",
"SD_CPP_PATH": "<YOUR_SD_CPP_PATH>",
"DIFFUGEN_OUTPUT_DIR": "/cursor/specific/output/directory",
"default_model": "flux-schnell"
},
"cursorOptions": {
"autoApprove": true,
"category": "Image Generation",
"icon": "🖼️",
"displayName": "DiffuGen"
}
}
}
}The path /home/cloudwerxlab in the block above is on the machine of whoever wrote it, not on yours.
Windsurf
{
"mcpServers": {
"diffugen": {
"command": "/home/cloudwerxlab/Desktop/Servers/MCP/Tools/DiffuGen/diffugen.sh",
"args": [],
"env": {
"CUDA_VISIBLE_DEVICES": "0",
"SD_CPP_PATH": "<YOUR_SD_CPP_PATH>",
"DIFFUGEN_OUTPUT_DIR": "/windsurf/specific/output/directory",
"default_model": "sdxl"
},
"windsurfOptions": {
"displayName": "DiffuGen",
"icon": "🖼️",
"category": "Creative Tools"
}
}
}
}The path /home/cloudwerxlab in the block above is on the machine of whoever wrote it, not on yours.
Roo Code, Cline
{
"mcpServers": {
"diffugen": {
"command": "/home/cloudwerxlab/Desktop/Servers/MCP/Tools/DiffuGen/diffugen.sh",
"args": [],
"env": {
"CUDA_VISIBLE_DEVICES": "0",
"SD_CPP_PATH": "<YOUR_SD_CPP_PATH>",
"default_model": "flux-schnell"
}
}
}
}The path /home/cloudwerxlab in the block above is on the machine of whoever wrote it, not on yours.