← 返回 Skills 市场
dustinparsons

DrawThings Image Generation

作者 dustinparsons · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1968
总下载
1
收藏
10
当前安装
1
版本数
在 OpenClaw 中安装
/install drawthings
功能描述
Generate images with DrawThings (Stable Diffusion) via API. Use when creating images from text prompts, running image generation workflows, or batch generating images. DrawThings runs locally on Mac with MLX/CoreML acceleration.
使用说明 (SKILL.md)

DrawThings Image Generation

Generate images using DrawThings, a local Stable Diffusion implementation for Mac with MLX/CoreML acceleration. DrawThings exposes an Automatic1111-compatible API for programmatic image generation.

When to Use

Use this skill when you need to:

  • Generate images from text prompts
  • Create variations of a concept
  • Batch generate multiple images
  • Test different models/samplers/settings
  • Generate images with specific dimensions or quality settings

Configuration

Set the DRAWTHINGS_URL environment variable (defaults to http://127.0.0.1:7860):

export DRAWTHINGS_URL="http://127.0.0.1:7860"

Or configure in OpenClaw:

openclaw config set env.DRAWTHINGS_URL "http://127.0.0.1:7860"

Quick Start

Generate a single image:

python3 scripts/generate.py "a cyberpunk cat in neon city"

With custom settings:

python3 scripts/generate.py "a cyberpunk cat" \
  --steps 20 \
  --cfg-scale 7.5 \
  --width 768 \
  --height 768 \
  --sampler "DPM++ 2M Karras"

Batch generation (5 variations):

python3 scripts/generate.py "a fantasy landscape" --batch-size 5

Save to specific location:

python3 scripts/generate.py "portrait photo" --output ./outputs/portrait.png

API Usage

The skill provides a Python script that wraps the DrawThings API (Automatic1111-compatible):

Main endpoint: POST /sdapi/v1/txt2img

Common parameters:

  • prompt - Text description of the image
  • negative_prompt - What to avoid in the image
  • steps - Number of diffusion steps (8-50, default: 20)
  • sampler_name - Sampler algorithm (default: "DPM++ 2M Karras")
  • cfg_scale - Classifier-free guidance scale (1.0-20.0, default: 7.0)
  • width / height - Image dimensions (default: 512x512)
  • batch_size - Number of images to generate (default: 1)
  • seed - Random seed for reproducibility (-1 for random)

See references/api-reference.md for complete API documentation.

Presets

Fast (8 steps, UniPC Trailing):

python3 scripts/generate.py "your prompt" --preset fast

Quality (30 steps, DPM++ 2M Karras):

python3 scripts/generate.py "your prompt" --preset quality

NFT (optimized for 512x512 with good detail):

python3 scripts/generate.py "your prompt" --preset nft

Workflow Examples

Character variations:

python3 scripts/generate.py "electric sheep, glowing wool, cyberpunk" \
  --batch-size 10 \
  --steps 20 \
  --cfg-scale 7.5

High-res output:

python3 scripts/generate.py "detailed portrait" \
  --width 1024 \
  --height 1024 \
  --steps 30 \
  --sampler "DPM++ 2M Karras"

Reproducible generation:

python3 scripts/generate.py "landscape" --seed 42
# Re-run with same seed for identical output

Output

Images are saved as PNG files with metadata embedded:

  • Prompt, negative prompt
  • Generation parameters (steps, sampler, cfg_scale, etc.)
  • Timestamp and seed

Default location: ./drawthings_output_YYYYMMDD_HHMMSS.png

Troubleshooting

"Connection refused"

  • Ensure DrawThings is running
  • Check the API server is enabled in DrawThings preferences
  • Verify the port matches (default: 7860)

"Generation failed"

  • Check prompt length (max ~75 tokens per CLIP model)
  • Reduce dimensions if out of memory
  • Try a different sampler

Slow generation

  • Use fewer steps (8-12 for drafts)
  • Reduce image dimensions (512x512)
  • Use faster samplers (UniPC, Euler A)

Canvas display quirk (visual only)

  • DrawThings UI doesn't clear the canvas between generations
  • New images appear to render on top of previous ones in the app
  • This is purely cosmetic - API outputs are unaffected

Tips

  • CFG Scale: Lower (1-3) for creative/artistic, higher (7-12) for prompt adherence
  • Steps: 8-12 for drafts, 20-30 for final images, 50+ rarely needed
  • Samplers: UniPC/Euler A are fast, DPM++ 2M Karras is quality, LCM for ultra-fast
  • Dimensions: Keep to multiples of 64 (512, 768, 1024)
  • Batch processing: Use --batch-size for variations, not multiple script calls

Models

DrawThings supports Stable Diffusion models. To change models:

  1. Open DrawThings app
  2. Select model from the UI
  3. The API will use the currently selected model

See references/models.md for recommended models and download sources.

安全使用建议
This skill is coherent with its stated purpose, but before installing: (1) confirm DRAWTHINGS_URL points to a trusted local DrawThings instance (or a trusted remote host) because prompts and parameters are sent to that endpoint; (2) be aware the script will write generated PNGs and a JSON info file to the working directory; (3) the script requires the Python 'requests' package — it will exit if missing; (4) references mention third-party model download sites (CivitAI, Hugging Face) but the skill does not automatically download models — download models only from trusted sources and respect licenses. If you plan to set DRAWTHINGS_URL to a remote service, treat prompts and any embedded metadata as potentially visible to the remote operator.
功能分析
Type: OpenClaw Skill Name: drawthings Version: 1.0.0 The skill is designed to generate images using a local DrawThings (Stable Diffusion) application via its API. The `scripts/generate.py` script makes HTTP POST requests to `http://127.0.0.1:7860` by default (configurable via `DRAWTHINGS_URL` environment variable) and saves the base64-encoded image results to local PNG files. All observed behaviors, including network communication and local file writing, are directly aligned with the stated purpose and lack any indicators of malicious intent such as data exfiltration, unauthorized remote execution, persistence mechanisms, or prompt injection attempts against the agent.
能力评估
Purpose & Capability
Name/description match the provided Python wrapper and docs. The only required environment variable is DRAWTHINGS_URL (defaults to a local http://127.0.0.1:7860), which is exactly what a local API client needs.
Instruction Scope
SKILL.md and the script only describe contacting the DrawThings API, saving returned images and metadata to disk, and reading DRAWTHINGS_URL (or --api-url). There are no instructions to read unrelated files, harvest credentials, or transmit system data. Note: prompts and generation parameters are sent to whatever DRAWTHINGS_URL you set, so only point it at services you trust.
Install Mechanism
There is no install spec (instruction-only skill plus a single Python script). The script depends on the widely used 'requests' library but does not download or execute arbitrary remote archives or binaries.
Credentials
The skill only requires a single environment variable (DRAWTHINGS_URL) to locate the API. It does not request tokens, passwords, cloud credentials, or unrelated environment/config paths.
Persistence & Privilege
always:false and default autonomy are used; the skill does not request permanent system changes, modify other skills, or require elevated privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install drawthings
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /drawthings 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - DrawThings Stable Diffusion API wrapper with presets, batch generation, and comprehensive documentation
元数据
Slug drawthings
版本 1.0.0
许可证
累计安装 10
当前安装数 10
历史版本数 1
常见问题

DrawThings Image Generation 是什么?

Generate images with DrawThings (Stable Diffusion) via API. Use when creating images from text prompts, running image generation workflows, or batch generating images. DrawThings runs locally on Mac with MLX/CoreML acceleration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1968 次。

如何安装 DrawThings Image Generation?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install drawthings」即可一键安装,无需额外配置。

DrawThings Image Generation 是免费的吗?

是的,DrawThings Image Generation 完全免费(开源免费),可自由下载、安装和使用。

DrawThings Image Generation 支持哪些平台?

DrawThings Image Generation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 DrawThings Image Generation?

由 dustinparsons(@dustinparsons)开发并维护,当前版本 v1.0.0。

💬 留言讨论