Skip to content

lojza3d/draw-things-cli-for-lm-studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Draw Things CLI – LM Studio Plugin

An LM Studio plugin for generating images via draw-things-cli directly in the LM Studio chat. Generated images are displayed inline without any additional tools.

Built with vibe coding assistance from Claude (Anthropic).

Requirements

1. Draw Things

The Draw Things app must be installed on your Mac — draw-things-cli shares its models and configuration with the app.

2. draw-things-cli

draw-things-cli is a standalone tool distributed via Homebrew. Installation compiles the project from source using Swift (Apple Developer Tools required) and takes 20–40 minutes.

# Make sure Xcode is active, not just Command Line Tools
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

# Install (compiles from source — be patient)
brew install --HEAD drawthingsai/draw-things/draw-things-cli

Verify installation:

draw-things-cli --version
draw-things-cli models list --downloaded-only

More info: github.com/drawthingsai/draw-things-community

Installation

Via LM Studio Hub

In LM Studio → Plugins → search for lojza3d/draw-things-cli.

Manually (dev mode)

git clone https://github.com/lojza3d/draw-things-cli-for-lm-studio
cd draw-things-cli-for-lm-studio
npm install
lms dev

Configuration

After installation, the plugin exposes a settings panel in LM Studio:

Field Description Default
Path to draw-things-cli Absolute path to the binary /opt/homebrew/bin/draw-things-cli
Default Model Model filename (.ckpt) — optional (empty)
Output Directory Directory for saving PNG files — empty = session working dir (empty)
Default Width Image width in px 1024
Default Height Image height in px 768
Default Steps Number of diffusion steps 8
Default CFG Scale Classifier-free guidance scale 1
Default Seed Generation seed (-1 = random) -1
Generation Timeout Timeout in seconds 300
Convert chat images to JPEG Compress images displayed in chat off
JPEG Quality JPEG quality 0–100 85

Output Directory

If empty, the plugin saves images directly to the session working directory — LM Studio displays them inline automatically.

If set (e.g. ~/Downloads), the plugin saves the PNG there and also copies it to the session working directory for inline display in chat.

Recommended setup: use Output Directory for archiving the generated images (if you need to) and set JPEG compression on (at about 85) to keep the actual size of the chat files smaller on disk.

JPEG Conversion

When enabled, the plugin compresses the image to JPEG before displaying it in chat. The PNG in the Output Directory is never touched — only the copy in the session working directory is converted.

Tools

generate_image

Generates an image. Only prompt is required.

Parameter Required Description
prompt Description of the image to generate
model Model filename — overrides the plugin setting
negative_prompt What to avoid in the image
width Image width in px
height Image height in px
steps Number of diffusion steps
cfg CFG scale
seed Generation seed (negative = random)

list_dt_models

Lists all downloaded Draw Things models. No parameters.

System Prompt Template

Adjust to your needs, add it to existing system prompt.

You have access to a Draw Things image generation tool running locally on this Mac.

When the user asks to generate, create, or draw an image:
1. Call generate_image with a detailed prompt describing the image.
2. All parameters except 'prompt' are optional — use them only if the user specifies something (model, size, style, seed...).
3. After successful generation, include the `markdown` attribute (image link) in your response to display the image inline.
4. If generation fails, report the error to the user and do NOT retry automatically.

If the user asks which models are available, call list_dt_models.

Notes

  • macOS with Apple Silicon only.
  • Generation typically takes tens of seconds up to tens of minutes, depending on the model and your hardware. Set Generation Timeout accordingly.
  • A negative seed (default -1) produces a random result on every generation (or should - in such a case, the --seed attribute is not passed to draw-things-cli at all as the --seed -1 triggers an error).
  • Models are managed in the Draw Things app — download models there.
  • draw-things-cli requires Draw Things to be installed even if the app itself is not running.

⚠️ This plugin is working, but testing is ongoing. If you spot any trouble, feedback is welcome.

About

Draw Things CLI for LM Studio is a native LM Studio plugin that enables local image generation via draw-things-cli, with results displayed inline in the chat.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors