Draw Things Image Generation

Andres Rovira@acwilan

OpenClaw tool for Draw Things CLI - local AI image generation on Apple Silicon

Capabilities

Image generationCreate images from prompts and supported references.

Readme

OpenClaw Draw Things

Local AI image generation for OpenClaw using Draw Things CLI on Apple Silicon. Generate images with Stable Diffusion, FLUX, and other models without API costs.

Features

  • ๐Ÿ–ผ๏ธ Local image generation - No API keys needed
  • ๐ŸŽจ Image editing (img2img) - Transform existing images with AI
  • ๐ŸŽ Apple Silicon optimized - Uses Core ML for fast inference
  • ๐Ÿค– Multiple models - SD, FLUX, and more
  • โšก OpenClaw integration - Native tool support

Prerequisites

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Draw Things CLI installed via Homebrew:
    bash
    brew tap drawthingsai/draw-things
    brew install draw-things-cli
    
  • (Optional) Draw Things App from Mac App Store โ€” easier GUI for browsing and downloading models
  • OpenClaw 2026.4.0 or later
  • AI Models downloaded (see Models section below)

๐Ÿ’ก Note: Only the CLI is required. The Draw Things app is optional but provides a convenient GUI for browsing and downloading models.

Installation

From ClawHub (Recommended)

bash
openclaw plugins install openclaw-draw-things --dangerously-force-unsafe-install

โš ๏ธ Security Notice: This plugin executes shell commands to run the Draw Things CLI. OpenClaw's security scanner flags this as "dangerous code patterns". This is expected and necessary for the plugin to function โ€” it uses child_process to spawn the draw-things-cli binary for local image generation. Use the --dangerously-force-unsafe-install flag to proceed with installation.

Manual Installation

bash
git clone https://github.com/acwilan/openclaw-draw-things.git
cd openclaw-draw-things
npm install
npm run build
openclaw plugins install "$(pwd)"

Configuration

Add to your ~/.openclaw/openclaw.json:

json
{
  "plugins": {
    "entries": {
      "draw-things": {
        "enabled": true,
        "config": {
          "cliPath": "draw-things-cli",
          "outputDir": "~/Downloads/draw-things-output",
          "defaultModel": "realistic_vision_v5.1_f16.ckpt",
          "defaultSize": "1024x1024",
          "defaultEditStrength": 0.5,
          "defaultPromptMode": "auto",
          "defaultPromptAppend": "watercolor, soft brush strokes, cohesive painterly style",
          "defaultConfigJson": {
            "sampler": 12,
            "loras": [
              {
                "mode": "all",
                "file": "breath_of_the_wild_style_lora_f16.ckpt",
                "weight": 1
              }
            ]
          }
        }
      }
    }
  },
  "agents": {
    "defaults": {
      "imageGenerationModel": {
        "primary": "draw-things/realistic_vision_v5.1_f16.ckpt"
      }
    }
  }
}

Config Options

OptionTypeDefaultDescription
cliPathstringdraw-things-cliPath to Draw Things CLI binary
modelsDirstring-Optional override for models directory
outputDirstring~/Downloads/draw-things-outputWhere to save generated images
defaultModelstringrealistic_vision_v5.1_f16.ckptDefault model file
defaultSizestringmodel-specificDefault output size like 1024x1024; reduced to Draw Things-compatible multiples of 64 and takes precedence over aspect ratio/defaultWidth/defaultHeight when request size is omitted
defaultWidthnumbermodel-specificLegacy/default output width (reduced to multiple of 64)
defaultHeightnumbermodel-specificLegacy/default output height (reduced to multiple of 64)
defaultStepsnumbermodel-specificOverride sampling steps
defaultCfgnumbermodel-specificOverride CFG guidance scale
defaultEditStrengthnumber0.5Img2img/edit strength from 0-1
defaultPromptModestringautoauto, natural, or tagged prompt handling
defaultPromptAppendstring-Text appended to every generation/edit prompt before optimization; useful for fixed profiles like watercolor, cartoons, selfies, or charcoal
defaultConfigJsonobject-Draw Things JSGenerationConfiguration overrides forwarded through --config-json, including LoRAs, sampler, hires fix, upscaler, and other CLI-supported options
enablePromptOptimizationbooleanmode-dependentEnable/disable model-aware prompt conversion
highResStepsnumber15SD 1.5 high-resolution img2img upscale steps
timeoutMsnumber300000Per-generation CLI timeout in milliseconds

Models

The provider now uses a generated Draw Things CLI model catalog plus curated overrides for defaults like size, steps, CFG, prompt mode, and high-resolution behavior. Unknown model names still work via best-effort type inference, but adding curated overrides in src/model-metadata.ts gives more predictable behavior.

At runtime, the plugin checks draw-things-cli models list --downloaded-only and falls back to a downloaded model if the configured/requested model is not present locally.

Models are stored in:
~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/

Or specify a custom modelsDir in the plugin config.

Downloading Models via CLI

If you prefer not to use the Draw Things app, you can download models entirely via CLI:

bash
# List currently downloaded models
draw-things-cli models list --downloaded-only

# List all available models for download
draw-things-cli models list

# Download a specific model
draw-things-cli models ensure --model <model-name>

๐Ÿ’ก Tip: If using a custom models directory, add --models-dir <path> to match your plugin config.

Recommended Models

ModelDescription
realistic_vision_v5.1_f16.ckptPhotorealistic images (recommended default)
flux_2_klein_4b_q6p.ckptFLUX.2 Klein 4-bit quantized (fast, good quality)
flux_1_schnell_4b_q8p.ckptFLUX.1 Schnell for fast generation
sd_xl_base_1.0_f16.ckptStable Diffusion XL

Via Draw Things App (optional GUI method):
Open Draw Things app โ†’ Models โ†’ Download Models

Usage

Once installed and configured, OpenClaw can generate images:

text
Generate an image of a sunset over mountains

Or use explicit tool calls:

text
Use image_generate to create a cartoon cat

Default Prompt Append

Use defaultPromptAppend to lock a Draw Things-backed agent into a consistent visual profile. The plugin appends this text to every generation/edit prompt before model-aware prompt optimization, so a user prompt like a portrait of a woman can become a portrait of a woman, watercolor, soft brush strokes, cohesive painterly style.

Example profiles:

json
{
  "defaultPromptAppend": "watercolor, soft brush strokes, cohesive painterly style"
}
json
{
  "defaultPromptAppend": "cartoon illustration, bold outlines, vibrant colors"
}

Draw Things Configuration Overrides and LoRAs

Use defaultConfigJson for Draw Things-native options that are not part of OpenClaw's shared image-generation contract. The object is serialized and passed to draw-things-cli generate --config-json for both initial generation and high-resolution generation passes.

json
{
  "defaultConfigJson": {
    "sampler": 12,
    "hiresFix": false,
    "loras": [
      {
        "mode": "all",
        "file": "breath_of_the_wild_style_lora_f16.ckpt",
        "weight": 1
      }
    ]
  }
}

The CLI applies these values before the plugin's explicit model, dimensions, steps, CFG, and edit-strength arguments, so the shared OpenClaw request controls continue to win for overlapping settings.

OpenClaw's current image_generate request only defines provider-specific options for OpenAI. This means Draw Things overrides are persistent plugin configuration, not per-call tool parameters; supporting dynamic per-request LoRA selection requires an upstream extension of the image-generation contract.

Image Editing (img2img)

Transform existing images using AI:

text
Turn this photo into a watercolor painting [attach image]

Or explicitly:

text
Edit this image to look like a comic book style

The plugin supports:

  • One input image per edit request
  • Configurable strength via defaultEditStrength (how much the image changes)
  • Style transformations - watercolor, oil painting, cartoon, etc.
  • Detail enhancement - improve or modify specific aspects

Tips for best results:

  • Use clear style descriptions (e.g., "oil painting", "anime style", "sketch")
  • For subtle changes, the strength is moderate (0.5)
  • Works with any supported model

Troubleshooting

Provider does not show as configured

The plugin reports configured only when it can find draw-things-cli, the output path is plausible, and draw-things-cli models list --downloaded-only returns at least one local model.

"No image-generation provider registered"

Make sure the imageGenerationModel.primary is set correctly:

json
"imageGenerationModel": {
  "primary": "draw-things/your-model.ckpt"
}

"Model not found"

  • Verify the model file exists in Draw Things
  • Check the exact filename in the Models directory
  • Ensure modelsDir config matches your setup if using custom location

"draw-things-cli command not found"

Install the CLI via Homebrew:

bash
brew tap drawthingsai/draw-things
brew install draw-things-cli

Plugin not loading

Check the plugin is enabled:

bash
openclaw plugins list

If needed, restart the gateway:

bash
openclaw gateway restart

Development

bash
# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Run tests
npm test

Releasing

bash
# Patch version (1.0.0 โ†’ 1.0.1)
npm run release:patch

# Minor version (1.0.0 โ†’ 1.1.0)
npm run release:minor

# Major version (1.0.0 โ†’ 2.0.0)
npm run release:major

This handles version bump, manifest sync, changelog, commit, tag, and push automatically.

License

MIT ยฉ Andres Rovira

Links