@ikijs/mcp 0.12.1 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-EY3AMMEG.mjs → chunk-KPYHC6X2.mjs} +181 -8
- package/dist/chunk-KPYHC6X2.mjs.map +1 -0
- package/dist/cli.js +180 -7
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +180 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-EY3AMMEG.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -32,10 +32,10 @@ The decode/atlas pipeline runs in Node via `sharp` (a native dependency confined
|
|
|
32
32
|
|
|
33
33
|
Composes a directory of AI-generated part PNGs into canvas-aligned, role-named layer PNGs ready for `auto_rig_from_layers`, on a fixed 1100×1100 canvas with a built-in default layout tuned for the character-generation skill's standard front-facing framing. It ports the composer that shipped as a script (`compose.cjs`) in the Claude Code plugin.
|
|
34
34
|
|
|
35
|
-
- **`partsDir`** — directory of the source part PNGs (resolved against the server's working directory). Required sources: `face.png`, `eyewhite.png` (split into the sclera + lash layers), `iris.png`, `mouth.png`, `brow.png`, `hair_front.png`. Optional: `hair_back.png`, `body.png`, `mouth_open.png`, `nose.png` — a parts dir without them still composes, minus those roles. The nose is what the auto-rig leads the head turn with, and a face supplied alongside it must be drawn without one, or the painted nose stays on the face plate while the real one moves.
|
|
35
|
+
- **`partsDir`** — directory of the source part PNGs (resolved against the server's working directory). Required sources: `face.png`, `eyewhite.png` (split into the sclera + lash layers; a light mark drawn detached above the eye white, such as a double-eyelid crease, is dropped from the sclera — the iris's clip — while dark strokes there stay lash ink), `iris.png`, `mouth.png`, `brow.png`, `hair_front.png`. Optional: `hair_back.png`, `body.png`, `mouth_open.png`, `blush.png`, `nose.png` — a parts dir without them still composes, minus those roles. One `blush.png` makes both cheeks' blush: `blush_R` takes it as drawn and `blush_L` mirrored. It is decoration, so the report does not flag a set without it. The nose is what the auto-rig leads the head turn with, and a face supplied alongside it must be drawn without one, or the painted nose stays on the face plate while the real one moves. Each part but the eye pair is cropped to its drawing before it is sized and placed. A faint speck detached from the drawing, one that never reaches alpha 128 and covers under 1 % of the part's pixels (residue a background removal leaves), is cut out with the margin it widened, so it cannot pull the part off its centre. A detached stroke that reaches alpha 128 is kept.
|
|
36
36
|
- **`outDir`** — an existing directory (resolved against the working directory, confined to it exactly like `auto_rig_from_layers`'s `outputPath`; the tool never creates directories) to write the role layer PNGs and a flattened `preview.png` into. Reusing a directory across runs is intentional — a role this run skips (e.g. composing a head-only set that omits `body`) has its stale `<role>.png` from an earlier run deleted, so the directory always holds exactly this run's roles.
|
|
37
37
|
- **`layout`** — optional per-role override merged over the built-in defaults, e.g. `{ "eye_L": { "cx": 660 } }`, so a character can be retuned by re-running compose rather than editing a script. Each of `cx`, `cy`, `w`, `h` is optional; `w` and `h` must be integers in 1..1100 (the canvas size). Omitting `h` keeps the part's own aspect ratio, which is what every role wants until one does not: a generated eyewhite often comes back flatter than its reference, and stretching a flat white lens costs nothing where regenerating it is billed and unreliable. The nose is sized and placed by its dense core — its pixels at alpha ≥ 128, the drawing a viewer reads inside a soft nose's feather — rather than its whole part, which for a shaded-bump nose is mostly feather: `w` (default 40) and `h` size the core, `cx` (default 550) centres it, and a set `cy` centres its rows. By default its `cy` is unset, and the core's bottom row (the tip) lands 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. A nose with no pixel at alpha ≥ 128 is sized and placed whole, and so is one whose core is a speck of its trimmed part — under a quarter of its width or height, such as a lone nostril mark or highlight, which sized to `w` would blow the whole nose up — and the report warns of the speck. Set `h` on a sclera and its lash together — they share one frame, and the blink fold tears if they diverge, so a pair set to land on different frames is rejected.
|
|
38
|
-
- **`mirrorParts`** — optional list of part files to flip left-right as they are read, e.g. `["eyewhite.png"]`. Which way a part faces is fixed by the layout, and "left eye" cannot pin it down — it reads as the viewer's left or the character's — so in image terms: `eyewhite.png` is read as the eye on the screen left, lash wing (outer corner) at the image's left end and lash-free tear duct at its right; `brow.png` as the brow on the screen right, thick head at the image's left end and tail at its right. A part drawn the other way round is fixed here for free instead of regenerated. It flips the source, so every role cut from it flips together and an eye's sclera and lash stay in one frame.
|
|
38
|
+
- **`mirrorParts`** — optional list of part files to flip left-right as they are read, e.g. `["eyewhite.png"]`. Which way a part faces is fixed by the layout, and "left eye" cannot pin it down — it reads as the viewer's left or the character's — so in image terms: `eyewhite.png` is read as the eye on the screen left, lash wing (outer corner) at the image's left end and lash-free tear duct at its right; `brow.png` as the brow on the screen right, thick head at the image's left end and tail at its right; `blush.png` as the blush on the screen left, outer end (toward the face's edge) at the image's left end and inner end at its right. A part drawn the other way round is fixed here for free instead of regenerated. It flips the source, so every role cut from it flips together and an eye's sclera and lash stay in one frame.
|
|
39
39
|
- **Result** — on success the text is the written layer paths (one per line) followed by the same geometry report `measure_layers` returns — except that when the composer found the core of the nose's source part a speck, its nose check reports that verdict instead of what the composed file shows, so a speck that resampling erased from the layer is warned about here and not by `measure_layers`. `structuredContent` is `{ ok: true, outDir, layers, skipped, preview, measure }`. Invalid input (a missing required part, an unknown `layout` role, an out-of-range `w` or `h`, a lash placed on a different frame from its sclera's, a `mirrorParts` entry that is not a part file, a part that lands entirely off-canvas, a non-existent `outDir`) returns `{ ok: false, error }` with `INVALID: …` text.
|
|
40
40
|
|
|
41
41
|
### `measure_layers`
|
|
@@ -1202,12 +1202,15 @@ function formatMeasureReport(result) {
|
|
|
1202
1202
|
import fs3 from "fs";
|
|
1203
1203
|
import path5 from "path";
|
|
1204
1204
|
import sharp2 from "sharp";
|
|
1205
|
+
import { ALPHA_OPAQUE as ALPHA_OPAQUE2 } from "@ikijs/editor";
|
|
1205
1206
|
var CANVAS = 1100;
|
|
1206
1207
|
var EYE_W = 128;
|
|
1207
1208
|
var IRIS_W = Math.round(EYE_W * 0.5625);
|
|
1208
1209
|
var EYEWHITE_SRC = "eyewhite.png";
|
|
1209
1210
|
var EYE_LASH_LUMA = 120;
|
|
1210
1211
|
var LASH_KEEP_FRACTION = 0.5;
|
|
1212
|
+
var TRIM_THRESHOLD = 12;
|
|
1213
|
+
var STRAY_SPECK_FRACTION = 0.01;
|
|
1211
1214
|
var NOSE_TIP_AT = 0.86;
|
|
1212
1215
|
var DEFAULT_LAYOUT = {
|
|
1213
1216
|
// Back hair and body sit behind the face. Both are OPTIONAL: a parts dir
|
|
@@ -1217,6 +1220,19 @@ var DEFAULT_LAYOUT = {
|
|
|
1217
1220
|
// floating head. It rides its own `bodyDeformer`, which only breathes.
|
|
1218
1221
|
body: { src: "body.png", cx: 550, cy: 1017, w: 840, optional: true },
|
|
1219
1222
|
face: { src: "face.png", cx: 550, cy: 475, w: 400 },
|
|
1223
|
+
// The cheek blush, one part for both cheeks: blush_R (screen left) takes it
|
|
1224
|
+
// as drawn and blush_L mirrors it, like the eyewhite. It draws over the face
|
|
1225
|
+
// and under the nose. Its box sits below each eye, centred just outside the
|
|
1226
|
+
// eye's centre and above the nose tip. Tuned on the hero's face at its
|
|
1227
|
+
// default placement, which narrows fast below the eye row: a 96-wide box at
|
|
1228
|
+
// row 552 ran up to 24 px past the cheek's drawn outline (inside the ears),
|
|
1229
|
+
// and this one, for a 2:1 blush, stays inside it by 1 px at its lower outer
|
|
1230
|
+
// corner. OPTIONAL, and decoration: a parts dir without it composes, and
|
|
1231
|
+
// nothing reports it missing.
|
|
1232
|
+
blush_L: { src: "blush.png", cx: 662, cy: 530, w: 56, optional: true, mirror: true },
|
|
1233
|
+
// prettier-ignore
|
|
1234
|
+
blush_R: { src: "blush.png", cx: 438, cy: 530, w: 56, optional: true, mirror: false },
|
|
1235
|
+
// prettier-ignore
|
|
1220
1236
|
// The nose, drawn on its own (the face is drawn without one): the auto-rig
|
|
1221
1237
|
// leads the head turn with it and keys the other features' slide on its
|
|
1222
1238
|
// presence, so without it the features stay on the face plate. `w` is the
|
|
@@ -1265,6 +1281,8 @@ var ORDER = [
|
|
|
1265
1281
|
"hair_back",
|
|
1266
1282
|
"body",
|
|
1267
1283
|
"face",
|
|
1284
|
+
"blush_L",
|
|
1285
|
+
"blush_R",
|
|
1268
1286
|
"nose",
|
|
1269
1287
|
"mouth",
|
|
1270
1288
|
"mouth_open",
|
|
@@ -1381,7 +1399,15 @@ async function partBuffer(role, cfg, partsDir, inMemory, flipSource) {
|
|
|
1381
1399
|
raw: { width: png.width, height: png.height, channels: 4 }
|
|
1382
1400
|
});
|
|
1383
1401
|
}
|
|
1384
|
-
if (!cfg.noTrim)
|
|
1402
|
+
if (!cfg.noTrim) {
|
|
1403
|
+
const kept = await img.trim({ threshold: TRIM_THRESHOLD }).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
1404
|
+
const { width: keptW, height: keptH } = kept.info;
|
|
1405
|
+
img = sharp2(kept.data, {
|
|
1406
|
+
raw: { width: keptW, height: keptH, channels: 4 }
|
|
1407
|
+
});
|
|
1408
|
+
const box = boxWithoutStraySpecks(kept.data, keptW, keptH);
|
|
1409
|
+
if (box !== null) img = img.extract(box);
|
|
1410
|
+
}
|
|
1385
1411
|
if ((cfg.mirror ?? false) !== flipSource) img = img.flop();
|
|
1386
1412
|
const trimmed = await img.png().toBuffer({ resolveWithObject: true });
|
|
1387
1413
|
const { width: trimmedW, height: trimmedH } = trimmed.info;
|
|
@@ -1448,6 +1474,152 @@ function blankCanvas() {
|
|
|
1448
1474
|
}
|
|
1449
1475
|
});
|
|
1450
1476
|
}
|
|
1477
|
+
function luma(rgba, i) {
|
|
1478
|
+
return 0.299 * rgba[i] + 0.587 * rgba[i + 1] + 0.114 * rgba[i + 2];
|
|
1479
|
+
}
|
|
1480
|
+
function boxWithoutStraySpecks(rgba, W, H) {
|
|
1481
|
+
const n = W * H;
|
|
1482
|
+
let kept = 0;
|
|
1483
|
+
for (let p = 0; p < n; p++) if (rgba[p * 4 + 3] > TRIM_THRESHOLD) kept++;
|
|
1484
|
+
const visited = new Uint8Array(n);
|
|
1485
|
+
let stack = new Int32Array(1024);
|
|
1486
|
+
const drawing = [W, H, -1, -1];
|
|
1487
|
+
const strays = [W, H, -1, -1];
|
|
1488
|
+
let anyOpaque = false;
|
|
1489
|
+
for (let start = 0; start < n; start++) {
|
|
1490
|
+
if (visited[start] || rgba[start * 4 + 3] <= TRIM_THRESHOLD) continue;
|
|
1491
|
+
let setLeft = W;
|
|
1492
|
+
let setTop = H;
|
|
1493
|
+
let setRight = -1;
|
|
1494
|
+
let setBottom = -1;
|
|
1495
|
+
let size = 0;
|
|
1496
|
+
let opaque = false;
|
|
1497
|
+
let depth = 0;
|
|
1498
|
+
visited[start] = 1;
|
|
1499
|
+
stack[depth++] = start;
|
|
1500
|
+
while (depth > 0) {
|
|
1501
|
+
const p = stack[--depth];
|
|
1502
|
+
size++;
|
|
1503
|
+
if (rgba[p * 4 + 3] >= ALPHA_OPAQUE2) opaque = true;
|
|
1504
|
+
const px = p % W;
|
|
1505
|
+
const py = (p - px) / W;
|
|
1506
|
+
setLeft = Math.min(setLeft, px);
|
|
1507
|
+
setTop = Math.min(setTop, py);
|
|
1508
|
+
setRight = Math.max(setRight, px);
|
|
1509
|
+
setBottom = Math.max(setBottom, py);
|
|
1510
|
+
for (let y = Math.max(0, py - 1); y <= Math.min(H - 1, py + 1); y++) {
|
|
1511
|
+
for (let x = Math.max(0, px - 1); x <= Math.min(W - 1, px + 1); x++) {
|
|
1512
|
+
const q = y * W + x;
|
|
1513
|
+
if (!visited[q] && rgba[q * 4 + 3] > TRIM_THRESHOLD) {
|
|
1514
|
+
visited[q] = 1;
|
|
1515
|
+
if (depth === stack.length) {
|
|
1516
|
+
const grown = new Int32Array(Math.min(n, stack.length * 2));
|
|
1517
|
+
grown.set(stack);
|
|
1518
|
+
stack = grown;
|
|
1519
|
+
}
|
|
1520
|
+
stack[depth++] = q;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
anyOpaque ||= opaque;
|
|
1526
|
+
const into = !opaque && size < kept * STRAY_SPECK_FRACTION ? strays : drawing;
|
|
1527
|
+
into[0] = Math.min(into[0], setLeft);
|
|
1528
|
+
into[1] = Math.min(into[1], setTop);
|
|
1529
|
+
into[2] = Math.max(into[2], setRight);
|
|
1530
|
+
into[3] = Math.max(into[3], setBottom);
|
|
1531
|
+
}
|
|
1532
|
+
if (!anyOpaque || strays[2] < 0) return null;
|
|
1533
|
+
const [left, top, right, bottom] = drawing;
|
|
1534
|
+
if (strays[0] >= left && strays[1] >= top && strays[2] <= right && strays[3] <= bottom)
|
|
1535
|
+
return null;
|
|
1536
|
+
return { left, top, width: right - left + 1, height: bottom - top + 1 };
|
|
1537
|
+
}
|
|
1538
|
+
function detachedAboveWhite(rgba, W, H) {
|
|
1539
|
+
const n = W * H;
|
|
1540
|
+
const ink = new Uint8Array(n);
|
|
1541
|
+
for (let p = 0; p < n; p++) {
|
|
1542
|
+
const alpha = rgba[p * 4 + 3];
|
|
1543
|
+
if (alpha > 0 && luma(rgba, p * 4) >= EYE_LASH_LUMA)
|
|
1544
|
+
ink[p] = alpha >= ALPHA_OPAQUE2 ? 2 : 1;
|
|
1545
|
+
}
|
|
1546
|
+
const label = new Int32Array(n).fill(-1);
|
|
1547
|
+
const stack = new Int32Array(n);
|
|
1548
|
+
const near = (p, visit) => {
|
|
1549
|
+
const px = p % W;
|
|
1550
|
+
const py = (p - px) / W;
|
|
1551
|
+
for (let y = Math.max(0, py - 1); y <= Math.min(H - 1, py + 1); y++) {
|
|
1552
|
+
for (let x = Math.max(0, px - 1); x <= Math.min(W - 1, px + 1); x++) {
|
|
1553
|
+
visit(y * W + x);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
};
|
|
1557
|
+
const sizes = [];
|
|
1558
|
+
const fill = (start) => {
|
|
1559
|
+
const id = sizes.length;
|
|
1560
|
+
let size = 0;
|
|
1561
|
+
let depth = 0;
|
|
1562
|
+
label[start] = id;
|
|
1563
|
+
stack[depth++] = start;
|
|
1564
|
+
while (depth > 0) {
|
|
1565
|
+
const p = stack[--depth];
|
|
1566
|
+
size++;
|
|
1567
|
+
near(p, (q) => {
|
|
1568
|
+
if (ink[q] === ink[start] && label[q] === -1) {
|
|
1569
|
+
label[q] = id;
|
|
1570
|
+
stack[depth++] = q;
|
|
1571
|
+
}
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
sizes.push(size);
|
|
1575
|
+
};
|
|
1576
|
+
for (let p = 0; p < n; p++) if (ink[p] === 2 && label[p] === -1) fill(p);
|
|
1577
|
+
const paintedSets = sizes.length;
|
|
1578
|
+
let head = 0;
|
|
1579
|
+
let tail = 0;
|
|
1580
|
+
for (let p = 0; p < n; p++) if (ink[p] === 2) stack[tail++] = p;
|
|
1581
|
+
while (head < tail) {
|
|
1582
|
+
const p = stack[head++];
|
|
1583
|
+
near(p, (q) => {
|
|
1584
|
+
if (ink[q] === 1 && label[q] === -1 && rgba[q * 4 + 3] <= rgba[p * 4 + 3]) {
|
|
1585
|
+
label[q] = label[p];
|
|
1586
|
+
stack[tail++] = q;
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
}
|
|
1590
|
+
for (let p = 0; p < n; p++) if (ink[p] === 1 && label[p] === -1) fill(p);
|
|
1591
|
+
const detached = new Uint8Array(n);
|
|
1592
|
+
if (paintedSets === 0 || sizes.length < 2) return detached;
|
|
1593
|
+
let white = 0;
|
|
1594
|
+
for (let id = 1; id < paintedSets; id++) {
|
|
1595
|
+
if (sizes[id] > sizes[white]) white = id;
|
|
1596
|
+
}
|
|
1597
|
+
const own = (p) => ink[p] === 2 || label[p] >= paintedSets;
|
|
1598
|
+
const whiteTop = new Int32Array(W).fill(-1);
|
|
1599
|
+
for (let p = 0; p < n; p++) {
|
|
1600
|
+
const x = p % W;
|
|
1601
|
+
if (label[p] === white && own(p) && whiteTop[x] === -1)
|
|
1602
|
+
whiteTop[x] = (p - x) / W;
|
|
1603
|
+
}
|
|
1604
|
+
let first = 0;
|
|
1605
|
+
while (whiteTop[first] === -1) first++;
|
|
1606
|
+
let last = W - 1;
|
|
1607
|
+
while (whiteTop[last] === -1) last--;
|
|
1608
|
+
whiteTop.fill(whiteTop[first], 0, first);
|
|
1609
|
+
whiteTop.fill(whiteTop[last], last + 1);
|
|
1610
|
+
const above = new Uint8Array(sizes.length).fill(1);
|
|
1611
|
+
for (let p = 0; p < n; p++) {
|
|
1612
|
+
const id = label[p];
|
|
1613
|
+
if (id === -1 || id === white || !own(p)) continue;
|
|
1614
|
+
const x = p % W;
|
|
1615
|
+
if ((p - x) / W >= whiteTop[x]) above[id] = 0;
|
|
1616
|
+
}
|
|
1617
|
+
for (let p = 0; p < n; p++) {
|
|
1618
|
+
const id = label[p];
|
|
1619
|
+
if (id !== -1 && id !== white && above[id]) detached[p] = 1;
|
|
1620
|
+
}
|
|
1621
|
+
return detached;
|
|
1622
|
+
}
|
|
1451
1623
|
async function prepEyeSplit(partsDir) {
|
|
1452
1624
|
const srcPath = path5.join(partsDir, EYEWHITE_SRC);
|
|
1453
1625
|
if (!fs3.existsSync(srcPath)) {
|
|
@@ -1472,14 +1644,15 @@ async function prepEyeSplit(partsDir) {
|
|
|
1472
1644
|
throw new AutoRigInputError(`eyewhite is fully transparent: ${srcPath}`);
|
|
1473
1645
|
}
|
|
1474
1646
|
const lashCutoffY = minY + LASH_KEEP_FRACTION * (maxY - minY + 1);
|
|
1647
|
+
const detached = detachedAboveWhite(data, W, H);
|
|
1475
1648
|
const sclera = Buffer.from(data);
|
|
1476
1649
|
const lash = Buffer.from(data);
|
|
1477
1650
|
for (let y = 0; y < H; y++) {
|
|
1478
1651
|
for (let x = 0; x < W; x++) {
|
|
1479
1652
|
const i = (y * W + x) * 4;
|
|
1480
|
-
const
|
|
1481
|
-
const isDark = data[i + 3] > 0 && lum < EYE_LASH_LUMA;
|
|
1653
|
+
const isDark = data[i + 3] > 0 && luma(data, i) < EYE_LASH_LUMA;
|
|
1482
1654
|
if (isDark) sclera[i] = sclera[i + 1] = sclera[i + 2] = 255;
|
|
1655
|
+
if (detached[y * W + x]) sclera[i + 3] = 0;
|
|
1483
1656
|
if (!(isDark && y <= lashCutoffY)) lash[i + 3] = 0;
|
|
1484
1657
|
}
|
|
1485
1658
|
}
|
|
@@ -1597,7 +1770,7 @@ async function composeLayersFromParts(input) {
|
|
|
1597
1770
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
1598
1771
|
import { z } from "zod";
|
|
1599
1772
|
function createIkiMcpServer() {
|
|
1600
|
-
const server = new McpServer({ name: "iki", version: "0.
|
|
1773
|
+
const server = new McpServer({ name: "iki", version: "0.13.1" });
|
|
1601
1774
|
server.registerTool(
|
|
1602
1775
|
"validate_iki",
|
|
1603
1776
|
{
|
|
@@ -1717,7 +1890,7 @@ function createIkiMcpServer() {
|
|
|
1717
1890
|
server.registerTool(
|
|
1718
1891
|
"compose_layers_from_parts",
|
|
1719
1892
|
{
|
|
1720
|
-
description: "Composes AI-generated part PNGs into canvas-aligned, role-named PNG layers on disk, ready for auto_rig_from_layers (the eyewhite split, alpha-trim/white-key, and placement pipeline the character-generation skill needs), with the same geometry report measure_layers returns standalone included inline. face, mouth, eyewhite, iris, brow, hair_front are required; hair_back, body, mouth_open, nose are optional \u2014 without a nose layer the head still turns on the rig's Live2D profile, but it has no nose to lead the turn, and `auto_rig_from_layers` fits no turn to the art (`turnTargets` is inert, no `turn` report). A nose whose dense core is a speck \u2014 under a quarter of its trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole, and the inline report warns of it.",
|
|
1893
|
+
description: "Composes AI-generated part PNGs into canvas-aligned, role-named PNG layers on disk, ready for auto_rig_from_layers (the eyewhite split, alpha-trim/white-key, and placement pipeline the character-generation skill needs), with the same geometry report measure_layers returns standalone included inline. face, mouth, eyewhite, iris, brow, hair_front are required; hair_back, body, mouth_open, blush (one blush.png makes the blush_L/blush_R pair) and nose are optional \u2014 without a nose layer the head still turns on the rig's Live2D profile, but it has no nose to lead the turn, and `auto_rig_from_layers` fits no turn to the art (`turnTargets` is inert, no `turn` report). A nose whose dense core is a speck \u2014 under a quarter of its trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole, and the inline report warns of it. A light mark drawn detached above the eye white, such as a double-eyelid crease, is dropped from the sclera (the iris's clip); dark strokes there stay lash ink.",
|
|
1721
1894
|
inputSchema: {
|
|
1722
1895
|
partsDir: z.string().describe(
|
|
1723
1896
|
"Directory of the source part PNGs (resolved against cwd)."
|
|
@@ -1734,10 +1907,10 @@ function createIkiMcpServer() {
|
|
|
1734
1907
|
h: z.number()
|
|
1735
1908
|
}).partial()
|
|
1736
1909
|
).optional().describe(
|
|
1737
|
-
"Per-role override merged over the built-in defaults, keyed by role \u2014 hair_back, body, face, nose, mouth, mouth_open, eye_L, eye_R, iris_L, iris_R, lash_L, lash_R, brow_L, brow_R, hair_front \u2014 e.g. `{ eye_L: { cx: 660 } }`. `w` and `h` are integers in 1..1100; omit `h` to keep the part's own aspect, set it to stretch. The nose is sized and placed by its dense core (its pixels at alpha >= 128, the drawing inside a soft nose's feather), not its whole part: `w`/`h` size the core, `cx` centres it, and a set `cy` centres its rows. A nose whose core is a speck \u2014 under a quarter of the trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole instead, and the report warns of it. Its `cy` defaults to unset, which lands the core's bottom row (the tip) 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. eye_L/lash_L and eye_R/lash_R are cut from one eyewhite into one frame, so each pair must land on the same frame \u2014 a pair set to land apart is rejected."
|
|
1910
|
+
"Per-role override merged over the built-in defaults, keyed by role \u2014 hair_back, body, face, blush_L, blush_R, nose, mouth, mouth_open, eye_L, eye_R, iris_L, iris_R, lash_L, lash_R, brow_L, brow_R, hair_front \u2014 e.g. `{ eye_L: { cx: 660 } }`. `w` and `h` are integers in 1..1100; omit `h` to keep the part's own aspect, set it to stretch. The nose is sized and placed by its dense core (its pixels at alpha >= 128, the drawing inside a soft nose's feather), not its whole part: `w`/`h` size the core, `cx` centres it, and a set `cy` centres its rows. A nose whose core is a speck \u2014 under a quarter of the trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole instead, and the report warns of it. Its `cy` defaults to unset, which lands the core's bottom row (the tip) 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. eye_L/lash_L and eye_R/lash_R are cut from one eyewhite into one frame, so each pair must land on the same frame \u2014 a pair set to land apart is rejected."
|
|
1738
1911
|
),
|
|
1739
1912
|
mirrorParts: z.array(z.string()).optional().describe(
|
|
1740
|
-
"Part files to flip left-right as they are read, e.g. `[\"eyewhite.png\"]`. The composer reads eyewhite.png as the eye on the screen LEFT (lash wing at the image's left end, lash-free tear duct at its right)
|
|
1913
|
+
"Part files to flip left-right as they are read, e.g. `[\"eyewhite.png\"]`. The composer reads eyewhite.png as the eye on the screen LEFT (lash wing at the image's left end, lash-free tear duct at its right), brow.png as the brow on the screen RIGHT (thick head at the image's left end, tail at its right), and blush.png as the blush on the screen LEFT (outer end, toward the face's edge, at the image's left end, inner end at its right); a part drawn the other way round is fixed here for free. It flips the source, so every role cut from it flips together and an eye's sclera and lash stay in one frame."
|
|
1741
1914
|
)
|
|
1742
1915
|
}
|
|
1743
1916
|
},
|
|
@@ -1839,4 +2012,4 @@ export {
|
|
|
1839
2012
|
composeLayersFromParts,
|
|
1840
2013
|
createIkiMcpServer
|
|
1841
2014
|
};
|
|
1842
|
-
//# sourceMappingURL=chunk-
|
|
2015
|
+
//# sourceMappingURL=chunk-KPYHC6X2.mjs.map
|