Skip to content

Releases

locmodel-image 4.0.0 — video + lip-sync, synced with LocModel 3.6.1

Choose a tag to compare

@jaja1620 jaja1620 released this 24 Nov 04:19

Synced with LocModel 3.6.1. LocModel's 视频 tab holds two unrelated sub-panels; 4.0 covers both and keeps them apart in the tool surface, so an agent can no longer answer a lip-sync request with text-to-video.

Added

  • generate_video / job_status / cancel_job / list_recipes — the 视频 → 生成视频 sub-panel (POST /sdcpp/v1/vid_gen). Asynchronous by default (wait_seconds=0 returns job_id + poll_url immediately) because a 480P clip takes minutes and MCP clients time out; job_status polls, decodes result.b64_json and writes webm/webp/avi to disk. Format is sniffed from RIFF/EBML magic bytes first, so a mislabelled output_format cannot corrupt the file.
  • lipsync_status / lipsync_generate — the 视频 → 对口型视频 sub-panel: LocModel's built-in InfiniteTalk + Wan2.1-I2V-14B-480P pipeline. This is not an HTTP endpoint: LocModel writes a runner.py into its data directory and launches it inside its own Python 3.12 venv, with its own ~24 GB weight tree and offline HF flags. The tool locates those artifacts, reports exactly which of the 13 required pieces are missing, and runs the job in a subprocess.
  • scripts/lipsync_runner_embed.py — embedded copy of the runner LocModel writes, so the pipeline can still be driven where the GUI never ran it.
  • CLI pass-through: locmodel_image.py video <status|generate|job|cancel|recipes> and locmodel_image.py lipsync <status|run>.
  • tests/test_video.py — payload building, data-URI wrapping, mode gating, async submit/poll/save, magic-byte format detection, lip-sync readiness matrix.

Changed

  • Sub-panel routing is documented policy, not a guess. SKILL.md maps wording to the right sub-panel (生成视频 / 文生视频 / 图生视频 → generate_video; 对口型 / 让照片唱歌 / 数字人播报 → lipsync_generate), lists the models and runtime each needs, and records the on-machine evidence behind those claims.
  • Tool count 12 → 18, parameter contract 42 → 50. No existing tool was renamed or re-scoped.
  • pyproject.toml: version 4.0.0, module list covers every bridge module.

Fixed

  • 省内存版 readiness no longer treats t5_fp8 as mandatory — its real layout is split_files/vae/wan_2.1_vae.safetensors + umt5-xxl-encoder-Q8_0.gguf, so the old hard-coded high-quality file check reported missing: umt5/xlm_roberta and pinned ok=false forever. Text encoder now counts as ready with either variant, tokenizer is probed per path, and base is only an anchor for relative paths (three-level fallback).
  • lipsync_status(models_dir=...) override now wins over env/config instead of being silently ignored.
  • Frozen exe RAM probing no longer fails silently: psutil → GlobalMemoryStatusEx → PowerShell fallback chain, failures surface in hardware.ram_error.
  • CLI discoverability: --help lists the forwarded video / lipsync subcommands; lipsync help prints usage plus the hard "not mounted = whole job fails" constraint.
  • lipsync_status returns only actionable fields (ok / variant / models / missing / paths / hardware / mount_required / mount_hint / blocking).

Known constraints

  • Lip sync fails hard when weights are not installed (lipsync_not_mounted). By design: no fallback to generate_video, no cloud call, no background weight install. Only fix: LocModel → 视频 → 对口型视频 → 一键准备.
  • Image and video instances are mutually exclusive — one engine instance serves one mode.
  • ref_audios / ref_video_audios remain unusable on the 3.6.1 engine build (any value → 400). Passed through only when supplied; documented as experimental.
  • Video results expire — completed jobs are kept 600 s by engine default; start the engine with --completed-ttl-seconds 3600 for long interactive sessions.

Install

Three routes. Pick one — they are additive and can coexist on the same machine.

1. Installer (recommended for people)

Download locmodel-image-setup.exe below and run it. Single-file installer, no Python needed on
the target machine; the exe doubles as the MCP stdio server via --serve.

locmodel-image-setup.exe                 # install (payload + host adapters)
locmodel-image-setup.exe --serve         # run as MCP stdio server
locmodel-image-setup.exe --doctor        # diagnose

2. From the repository — scriptable, hash-verified, no exe / no clone / no pip

Deploys the MCP server (scripts/*.py, stdio JSON-RPC) and the companion skill (SKILL.md) at a
pinned ref, verifying every file against install/manifest.json before it is written.

Windows:

$d = Join-Path $env:TEMP 'locmodel-image-install'
New-Item -ItemType Directory -Force -Path $d | Out-Null
Invoke-WebRequest 'https://raw.githubusercontent.com/jaja1620/locmodel-image-MCP/v4.0.0/install/install-from-repo.ps1' -OutFile "$d\install-from-repo.ps1" -UseBasicParsing
powershell -NoProfile -ExecutionPolicy Bypass -File "$d\install-from-repo.ps1"

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/jaja1620/locmodel-image-MCP/v4.0.0/install/install-from-repo.sh -o /tmp/locmodel-install.sh
sh /tmp/locmodel-install.sh

Targets: %LOCALAPPDATA%\locmodel-image\repo (Windows) or
${XDG_DATA_HOME:-~/.local/share}/locmodel-image/repo (Linux/macOS) for the MCP server, plus the
host's skills directory for SKILL.md. Ends with a real MCP initialize handshake.
-Register claude|cursor|vscode also merges the client entry (after a .bak-<timestamp> copy);
Marvis and WorkBuddy manage their own config, so they get a paste-ready snippet instead.

Offline: download locmodel-image-repo-install-v4.0.0.zip below, unpack it, then run
.\install\install-from-repo.ps1 -Source local -FromPath . (or sh install/install-from-repo.sh --source local --from-path .).

Guide: docs/INSTALL-FROM-REPO.md ·
docs/INSTALL-FROM-REPO.zh-CN.md

3. Hand it to an AI agent

Give the agent this one line and it can do the whole install itself:

Read https://raw.githubusercontent.com/jaja1620/locmodel-image-MCP/v4.0.0/install/AGENT-INSTALL.md and install locmodel-image (MCP server + companion skill) on this machine following it.

install/AGENT-INSTALL.md
is self-contained: exact URLs, per-OS destinations, the SHA-256 table, two verification commands, the
per-host config key, a symptom → meaning → action table, and an explicit list of things not to touch.
An agent without shell access can fetch the payload files itself; one without network access can hand
the checklist to a human.

4. From source (developers, Python 3.9+)

git clone https://github.com/jaja1620/locmodel-image-MCP.git
cd locmodel-image-MCP
python scripts/locmodel_image.py doctor

Assets

Asset What it is
locmodel-image-setup.exe single-file installer / frozen MCP stdio server (no Python needed)
locmodel-image-repo-install-v4.0.0.zip scripts/ + SKILL.md + install/ + docs/ — the whole repo-install payload, for offline use

locmodel-image 3.2.0 - synced with LocModel 3.3

Choose a tag to compare

@jaja1620 jaja1620 released this 18 Nov 05:00

locmodel-image 3.2.0

对应引擎版本:LocModel 3.3.0(/sdcpp/v1 · sd-server)

本版以 LocModel 3.3.0 实际对外公布的 capabilities(features / limits / defaults_by_mode / upscalers 对象数组)为契约,把 3.1 里硬编码的假设改成向引擎询问。若你的 LocModel 已升到 3.3,请同步升级到本版:3.1.x 在 3.3 引擎上会因枚举拼写差异直接失败。

Exposes the local LocModel / stable-diffusion.cpp (sd-server) engine as an MCP server plus a CLI bridge. Fully offline. 3.2 targets LocModel 3.3.0 and replaces 3.1's hard-coded assumptions with live engine capabilities.

  • 完整安装使用说明 / Full bilingual guide: 中文 · English

一、简体中文

修了什么

问题 现行为
Latent 系上采样器全部不可用:工具写 Latent(nearest),引擎只认 Latent (nearest),返回 400 invalid generation parameters 枚举匹配忽略空格与标点,5 个 Latent 变体全部可用;枚举值由引擎 upscalers 实时接管,未来改名也不会再断
显式尺寸被悄悄改写:--width 512 --height 512 出 768×768,超过 1536 一律被拉回 改为两档策略:调用方给定的宽高照办(只受引擎 limits 限制并给 warning);工具自选尺寸才走面积下限 / 显存分档长边
兜底默认值与引擎相反:工具用 cfg 7.0 / steps 20,flux 模型实跑 cfg 1.0 / steps 4 / euler FALLBACK 对齐引擎,并优先读 defaults_by_mode
count 上限写死 4 上限取 limits.max_batch_count(当前 8)

新增

  • adopt_capabilities() / engine_limits() / feature_enabled() / unsupported_keys():实时枚举、阈值与特性开关替代离线基线;模型不支持某参数时给 note,不再静默无效
  • 新参数:hires_scale、hires_custom_sigmas、output_format(png / jpeg / webp)、output_compression、vae_rel_size_w / vae_rel_size_h、vae_extra_tiling_args,参数总数 42 项
  • guard 与 dry_run 成为 generate_image 一等参数:出图前可先看完整 payload(含 size_policy),不烧 GPU
  • locmodel_status 报告 limits、features、current_mode、supported_modes 与引擎接管后的枚举
  • get_workflow_params 支持 include_folded=true,并标注当前模型用不了的项(unavailable_reason)
  • 测试:CapabilityAdoptTests(10 例)、显式尺寸用例、e2e 矩阵重写(cli.size_policy / cli.new_params / gen.explicit_640 / gen.jpeg_output / cli.explicit_512)

变更

  • size.hard_max_side 默认 2048 → 4096(对齐 limits.max_width/height)
  • generate.max_count 默认 4 → 8

升级

cd locmodel-image-MCP
git pull                     # 或切到本 tag:git checkout v3.2.0
pip install -U .

升级后请重启宿主(Claude Desktop / Cursor / VS Code / Marvis 等),让 MCP 服务重新加载。

关于安装包

本 Release 附预打包单文件安装器 locmodel-image-setup.exe(8,062,126 字节,SHA-256 065F7A0396A1B88F63B24238A1DF469A9FACCFFB4B277437E283AB3244873FBC),对应 commit 7d15376 加上本次安装器修复,目标机免装 Python:

.\locmodel-image-setup.exe install --mode exe --yes   # 自动识别并写入 Claude Desktop / Claude Code / Cursor / VS Code / Windsurf / DSH / Hermes
.\locmodel-image-setup.exe emit marvis                 # 输出可直接粘给 Marvis 的 mcp_install + skill_install 指令
.\locmodel-image-setup.exe list                        # 看各宿主注册状态
.\locmodel-image-setup.exe doctor                      # 引擎与模型自检
.\locmodel-image-setup.exe uninstall [--purge --yes]   # 卸载(--purge 连配置文件一起删)

exe 自身经 --serve 即为 MCP stdio server;安装后宿主调用的是安装目录里那份 exe,emit marvis 输出的 command 直接指向它,不依赖系统 Python。

本版安装器修复(源码安装不受影响):

  • payload 清单补 scripts/locmodel_workflow.py——3.1.0 起缺失,用 3.1/3.2 源码打出的包会装完即 Core module locmodel_image.py could not be imported
  • locsetup.__version__ 由 3.0.0 同步为 3.2.0,VERSION / install-manifest.json 不再谎报旧版
  • 冻结包补收 payload 用到的标准库(urllib.error / http.client / ssl 等),修掉"能装、tools/list 正常、每次调用都报 import 失败"的问题
  • 打包不再把 scripts/__pycache__/*.pyc 混进 payload

冻结包上已跑通端到端:沙箱安装 → --version 3.2.0 → 12 个工具 → locmodel_status 接真引擎 → generate_image 640×640 显式尺寸出图。


二、English

Fixed

  • Latent upscalers were unusable — the tool sent Latent(nearest); the engine only accepts Latent (nearest) and answered 400 invalid generation parameters. Enum matching is now whitespace/punctuation-insensitive, and the enumeration is adopted from the live upscalers list so a future rename cannot break it again.
  • Explicit sizes were silently rewritten — --width 512 --height 512 came back as 768×768. Two size tiers now exist: caller-supplied width/height is honoured (only the engine's limits may clamp it, with a warning), while tool-chosen sizes keep the area floor / VRAM-tiered long edge.
  • Fallback defaults contradicted the engine — the tool fell back to cfg 7.0 / steps 20 while the shipped flux model runs cfg 1.0 / steps 4 / euler. FALLBACK now mirrors the engine and defaults_by_mode is read when defaults is absent.
  • count was capped at 4; the ceiling now comes from limits.max_batch_count (8).

Added

  • adopt_capabilities() / engine_limits() / feature_enabled() / unsupported_keys() — live enumerations, limits and features replace the offline baseline; a knob the loaded model cannot honour yields a note instead of a silent no-op.
  • New parameters: hires_scale, hires_custom_sigmas, output_format (png / jpeg / webp), output_compression, vae_rel_size_w / vae_rel_size_h, vae_extra_tiling_args — 42 parameters total.
  • guard and dry_run are first-class generate_image arguments: inspect the exact payload (including size_policy) before spending GPU time.
  • locmodel_status reports limits, features, current_mode, supported_modes and the engine-adopted enumerations.
  • get_workflow_params accepts include_folded=true and marks rows the loaded model cannot use (unavailable_reason).
  • Tests: CapabilityAdoptTests (10 cases), explicit-size cases, rewritten e2e matrix.

Changed

  • size.hard_max_side default 2048 → 4096; generate.max_count default 4 → 8.

Upgrade

cd locmodel-image-MCP
git pull                     # or: git checkout v3.2.0
pip install -U .

Restart your host (Claude Desktop / Cursor / VS Code / Marvis, ...) so the MCP server reloads.

Downloads

A prebuilt single-file installer, locmodel-image-setup.exe (8,062,126 bytes, SHA-256 065F7A0396A1B88F63B24238A1DF469A9FACCFFB4B277437E283AB3244873FBC), is attached to this release. It ships commit 7d15376 plus the installer fixes listed above (missing scripts/locmodel_workflow.py in the payload manifest, stale locsetup.__version__, and payload stdlib modules missing from the frozen bundle). Target machines need no Python: the exe doubles as the MCP stdio server via --serve, and emit marvis points the host at the installed copy.


三、对应关系 / Version mapping

locmodel-image LocModel / sd-server
3.2.x 3.3.0(capabilities 含 limits / features / upscalers 对象数组)
3.1.x 3.2.x 及更早(Latent(nearest)、固定尺寸策略假设)
3.0.x 2.x 系列引擎

多版本自动适配(连接前探测引擎版本并挂载对应 profile)已列入 4.0 规划,尚未落地。

locmodel-image 3.0.0 - region-accurate editing + one-click installer

Choose a tag to compare

@jaja1620 jaja1620 released this 10 Nov 05:14

locmodel-image 3.0.0

把本机 LocModel(stable-diffusion.cpp / sd-server)的画图引擎封装成 MCP 服务 + 命令行桥接器。全程离线、不联网、不按张计费。
3.0 新增区域精准改图:只在掩码内重画,掩码外像素由 CPU 侧还原为原图,绝不改动。

Exposes the local LocModel / stable-diffusion.cpp (sd-server) engine as an MCP server plus a CLI bridge. Fully offline. 3.0 adds region-accurate editing: only the mask is repainted, pixels outside are restored on the CPU side.

  • 完整安装使用说明 / Full bilingual guide: 中文 · English

一、简体中文

两种安装方式,任选其一

方式 A:通过安装软件安装(单文件 exe,无需 Python)—— 推荐

文件 大小 SHA-256
locmodel-image-setup.exe 7 928 599 字节(7.56 MB) ED1C09CAFC020B862E8FB2A3C0FB88EDE85B220EBC5EB4D9FDFA2D5C1A2526D1
  1. 下载 本页下方的 locmodel-image-setup.exe。
  2. 双击运行。它会在控制台窗口里列出即将执行的操作,确认后按回车(或 y)继续;结束后窗口停住供你阅读,不会闪退。
  3. 默认装到 %LOCALAPPDATA%\locmodel-image,并把 MCP 服务注册进本机检测到的所有受支持客户端(Claude Desktop、Claude Code、Cursor、VS Code、Windsurf、DSH、Hermes)。
  4. Marvis 用户多一步:执行 locmodel-image-setup.exe emit marvis,把打印出的 mcp_install 与 skill_install 两段指令粘到对话框里。

偏好命令行:

.\locmodel-image-setup.exe install --mode exe --yes      # 全自动
.\locmodel-image-setup.exe install --dry-run             # 预演,不改文件
.\locmodel-image-setup.exe install --targets dsh,hermes --yes
.\locmodel-image-setup.exe list                          # 哪些客户端已注册
.\locmodel-image-setup.exe doctor                        # 引擎/模型/显存/配置自检
.\locmodel-image-setup.exe uninstall --purge --yes       # 卸载并清目录

完整性校验(可选):Get-FileHash .\locmodel-image-setup.exe -Algorithm SHA256,应等于上表值。
改配置前会自动备份为 *.bak.<时间戳>,只增删自己那一条,重复安装返回 unchanged。

方式 B:源码安装(原有方式,需要 Python 3.9+)

git clone https://github.com/jaja1620/locmodel-image-MCP.git
cd locmodel-image-MCP
pip install -e .
python scripts/locmodel_image.py doctor

手动注册 MCP(通用 JSON 写法):

{
  "mcpServers": {
    "locmodel-image": {
      "command": "python",
      "args": ["C:/path/to/locmodel-image-MCP/scripts/locmodel_mcp.py"],
      "env": { "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1" }
    }
  }
}

不用客户端也能直接跑命令行:

python scripts/locmodel_image.py status
python scripts/locmodel_image.py generate --prompt "modern modular building, dusk, wide angle" --aspect 16:9

怎么用

MCP 工具(9 个):

工具 作用
generate_image 文生图,支持尺寸/长宽比、seed、一次 1–4 张、负面提示词
edit_image 局部重绘,只改掩码内,掩码外保持原图
redraw_image 整图重画,原图仅作构图与色彩参考
list_edit_models 哪些模型能改图、自动会选谁、为什么
load_model 显式加载指定模型
locmodel_status 引擎状态、已加载模型、显存、配置
list_models 本机可用模型
engine_doctor 引擎/端口/模型诊断
engine_discover 强制重新发现引擎端口

出图示例:

generate_image(prompt="interior of a timber meeting room, soft north light, 35mm",
               aspect="4:3", out_dir="D:/out")

产物:locmodel_<时间戳>_<序号>_seed<seed>.png + 同名 _meta.json(记录提示词、seed、尺寸、耗时,便于复现)。

改图示例(掩码外不会被改动,这是硬保证):

edit_image(init_image="D:/out/v1.png",
           prompt="night-time glass curtain wall, interior lights on, warm reflections",
           regions={"unit":"norm","regions":[{"type":"rect","x":[0.25,0.18,0.62,0.55]}]},
           strength=0.8)

掩码三种给法:矩形/多边形归一化坐标、掩码 PNG(白=重绘黑=保留)、颜色阈值。
没有坐标可用 annotator/mask_annotator.html——单文件网页,双击打开、拖入图片、画完导出 mask.png 或复制坐标 JSON。

交付说明:files[].path 是已保护的图;引擎未经保护的原始输出另存为同目录 *_raw.png(files[].raw),仅排查用。原图不会被覆盖。

常用 CLI:

python scripts/locmodel_image.py doctor                 # 自检
python scripts/locmodel_image.py generate --prompt "..." --aspect 16:9 --out D:/out --seed 12345
python scripts/locmodel_image.py edit-models            # 能改图的模型与自动选择结果
python scripts/locmodel_image.py edit --image a.png --prompt "oak slat ceiling" --region 0.1,0.1,0.5,0.4
python scripts/locmodel_image.py redraw --image a.png --prompt "watercolour architectural sketch"
python scripts/locmodel_image.py load-model "Qwen-Image-Edit"
python scripts/locmodel_image.py config show

3.0.0 变更

  • 新增 scripts/locmodel_edit.py、annotator/mask_annotator.html、tests/test_edit.py
  • MCP 工具增至 9 个(新增 edit_image / redraw_image / list_edit_models / load_model)
  • 改图默认输出为保护后图,引擎原始输出另存 *_raw.png(修复前实测掩码外 818 348 像素被误改)
  • 安装器载荷补入改图模块与标注页面,装完即为完整版
  • 新增双语 docs/INSTALL.md / docs/INSTALL.zh-CN.md,README 增加两种安装方式入口

常见问题

现象 处理
engine_not_found 打开 LocModel 并加载画图模型,再 engine_discover
generation_failed + no results 显存不足或两个引擎抢卡:关 LM Studio/吃显存的程序,降尺寸
model_unavailable 本机没有可编辑模型:下载 Qwen-Image-Edit / FLUX.2 klein,或改用 redraw_image
改完接缝明显 降 strength,加 mask_blur / inpaint_padding
图内文字乱码 扩散模型固有限制,后期叠字,不要硬修

验证结果

Windows 10 19045 / RTX 3060 Ti 8 GB:tests 67 passed(含 3 subtests)、installer/tests 28 passed;exe --version 输出 locmodel-image-setup 3.0.0;真实引擎端到端改图验证:主输出掩码外 outside_changed=0、掩码内 inside_changed=109060(引擎原始输出掩码外 outside_changed=818366,符合预期)。


二、English

Two ways to install — pick one

Way A — Installer (single-file exe, no Python needed), recommended

File Size SHA-256
locmodel-image-setup.exe 7 928 599 bytes (7.56 MB) ED1C09CAFC020B862E8FB2A3C0FB88EDE85B220EBC5EB4D9FDFA2D5C1A2526D1
  1. Download locmodel-image-setup.exe below.
  2. Double-click it. A console window shows what it is about to do; confirm with Enter (or y). It prints a summary and stays open at the end.
  3. It installs to %LOCALAPPDATA%\locmodel-image and registers the MCP server into every supported client it detects (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, DSH, Hermes).
  4. Marvis users, one extra step: run locmodel-image-setup.exe emit marvis and paste the printed mcp_install / skill_install blocks into the chat.

Prefer the command line:

.\locmodel-image-setup.exe install --mode exe --yes      # fully automatic
.\locmodel-image-setup.exe install --dry-run             # preview, change nothing
.\locmodel-image-setup.exe install --targets dsh,hermes --yes
.\locmodel-image-setup.exe list                          # which clients are registered
.\locmodel-image-setup.exe doctor                        # engine/model/VRAM/config self-check
.\locmodel-image-setup.exe uninstall --purge --yes       # uninstall and delete the directory

Optional integrity check: Get-FileHash .\locmodel-image-setup.exe -Algorithm SHA256 must match the table.
Client configs are backed up to *.bak.<timestamp> first; only its own entry is touched; re-running is idempotent (unchanged).

Way B — From source (the original way, needs Python 3.9+)

git clone https://github.com/jaja1620/locmodel-image-MCP.git
cd locmodel-image-MCP
pip install -e .
python scripts/locmodel_image.py doctor

Register MCP manually (generic JSON):

{
  "mcpServers": {
    "locmodel-image": {
      "command": "python",
      "args": ["C:/path/to/locmodel-image-MCP/scripts/locmodel_mcp.py"],
      "env": { "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1" }
    }
  }
}

Works without any client too:

python scripts/locmodel_image.py status
python scripts/locmodel_image.py generate --prompt "modern modular building, dusk, wide angle" --aspect 16:9

How to use it

Nine MCP tools:

Tool What it does
generate_image Text-to-image with size/aspect, seed, count 1–4, negative prompt
edit_image Inpainting: only the mask is repainted, outside stays original
redraw_image Whole-image redraw; original is a composition/colour reference
list_edit_models Which models can edit, what auto-selection picks, and why
load_model Explicitly load a named model
locmodel_status Engine state, loaded model, VRAM, config
list_models Models available locally
engine_doctor Engine/port/model diagnostics
engine_discover Force a re-scan of the engine port
generate_image(prompt="interior of a timber meeting room, soft north light, 35mm",
               aspect="4:3", out_dir="D:/out")

Outputs: locmodel_<timestamp>_<i>_seed<seed>.png plus a _meta.json with prompt, seed, size and duration.

edit_image(init_image="D:/out/v1.png",
           prompt="night-time glass curtain wall, interior lights on, warm reflections",
           regions={"unit":"norm","regions":[{"type":"rect","x":[0.25,0.18,0.62,0.55]}]},
           strength=0.8)

Mask can be normalised rect/polygon coordinates, a mask PNG (white = repaint, black = keep), or a colour threshold. No coordinates at hand? annotator/mask_annotator.html is a single-file page: double-click, drag the image in, draw, export mask.png or copy the coordinates JSON.

files[].path is the protected image — pixels outside the mask are restored on the CPU side. The engine's raw output is kept as *_raw.png (files[].raw) for troubleshooting only. The original file is never overwritten.

Common CLI:

python scripts/locmodel_image.py doctor
python scripts/locmodel_image.py generate --prompt "..." --aspect 16:9 --out D:/out --seed 12345
python scripts/locmodel_image.py edit-models
python scripts/locmodel_image.py edit --image a.png --prompt "oak slat ceiling" --region 0.1,0.1,0.5,0.4
python scripts/locmodel_image.py redraw --image a.png --prompt "watercolour architectural sketch"
python scripts/locmodel_image.py load-model "Qwen-Image-Edit"
python scripts/locmodel_image.py config show

What changed in 3.0.0

  • Added scripts/locmodel_edit.py, annotator/mask_annotator.html, tests/test_edit.py
  • MCP surface grows to 9 tools (new: edit_image / redraw_image / list_edit_models / load_model)
  • Editing now returns the protected image by default; engine raw output is kept as *_raw.png (before the fix, 818 348 pixels outside the mask were being changed)
  • Installer payload ships the edit module a...
Read more

locmodel-image 2.0.0 — first public release

Choose a tag to compare

@jaja1620 jaja1620 released this 09 Nov 10:10

Turn your own GPU into an image generator that any agent can call. No cloud, no API key, no per-image cost.

This is an MCP server plus a CLI bridge for the stable-diffusion.cpp engine that ships inside
LocModel. It speaks the engine's native HTTP job API (/sdcpp/v1/img_gen),
discovers the port by itself, guards against sizes your card cannot render, and returns a PNG path
you can drop straight into a document.

What you need

  • LocModel installed, with one image model loaded (it starts its own sd-server.exe)
  • Python 3.10+ (the MCP server has zero third-party dependencies)
  • An agent or client that can either run MCP servers or shell out to a CLI

Install

git clone https://github.com/jaja1620/locmodel-image.git
cd locmodel-image
pip install -e .

Check the engine is visible:

locmodel-image status      # where the port came from, which model, GPU headroom
locmodel-image doctor      # full self-check

Use from an agent (MCP)

{
  "mcpServers": {
    "locmodel-image": {
      "command": "python",
      "args": ["<path-to>/scripts/locmodel_mcp.py"],
      "env": { "PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1" }
    }
  }
}

Tools: generate_image, locmodel_status, list_models, engine_doctor, engine_discover.

Use from the shell

locmodel-image generate --prompt "quiet courtyard, soft daylight, 35mm" --aspect 4:3
locmodel-image generate --prompt "concept sketch of a modular pavilion" --aspect 16:9 --count 2
locmodel-image generate --prompt "..." --dry-run    # resolve everything, spend no GPU time

What was verified for 2.0.0

Windows 10 19045, RTX 3060 Ti 8 GB, Z-Image Turbo Q6_K.

Stage Cases Result
unit tests 46 46 passed
CLI diagnostics 8 8 passed
MCP protocol / framing / generation 3 3 passed
real generation matrix 6 6 passed

Aspect ratios survive the size guard (768×768, 1368×768, 768×1368, 1184×888), 34–53 s per image.

Read more

Licence

MIT.