@ikijs/mcp 0.14.0 → 0.16.0
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 +3 -3
- package/dist/{chunk-PKIN326J.mjs → chunk-J4J3D4ZR.mjs} +101 -40
- package/dist/chunk-J4J3D4ZR.mjs.map +1 -0
- package/dist/cli.js +99 -38
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +99 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-PKIN326J.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -395,6 +395,13 @@ declare const DEFAULT_LAYOUT: {
|
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
397
|
type Role = keyof typeof DEFAULT_LAYOUT;
|
|
398
|
+
/** The lower lash of each eye, and the eye whose placement it takes. */
|
|
399
|
+
declare const LOWER_LASH: {
|
|
400
|
+
readonly lash_lower_L: "eye_L";
|
|
401
|
+
readonly lash_lower_R: "eye_R";
|
|
402
|
+
};
|
|
403
|
+
/** A role the composer writes a layer for. */
|
|
404
|
+
type LayerRole = Role | keyof typeof LOWER_LASH;
|
|
398
405
|
/** Per-role placement overrides; anything omitted keeps the default above. */
|
|
399
406
|
type LayoutOverride = Partial<Record<Role, {
|
|
400
407
|
cx?: number;
|
|
@@ -422,7 +429,7 @@ interface ComposeInput {
|
|
|
422
429
|
mirrorParts?: string[];
|
|
423
430
|
}
|
|
424
431
|
interface ComposedLayer {
|
|
425
|
-
role:
|
|
432
|
+
role: LayerRole;
|
|
426
433
|
path: string;
|
|
427
434
|
/** Size of the placed part itself (the file is always CANVAS x CANVAS). */
|
|
428
435
|
width: number;
|
|
@@ -434,8 +441,11 @@ type ComposeResult = {
|
|
|
434
441
|
ok: true;
|
|
435
442
|
outDir: string;
|
|
436
443
|
layers: ComposedLayer[];
|
|
437
|
-
/**
|
|
438
|
-
|
|
444
|
+
/**
|
|
445
|
+
* Roles whose optional part was absent from the parts dir, and the lower
|
|
446
|
+
* lashes when the eyewhite draws no dark lower lid.
|
|
447
|
+
*/
|
|
448
|
+
skipped: LayerRole[];
|
|
439
449
|
preview: string;
|
|
440
450
|
measure: MeasureReport;
|
|
441
451
|
} | {
|
package/dist/index.d.ts
CHANGED
|
@@ -395,6 +395,13 @@ declare const DEFAULT_LAYOUT: {
|
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
397
|
type Role = keyof typeof DEFAULT_LAYOUT;
|
|
398
|
+
/** The lower lash of each eye, and the eye whose placement it takes. */
|
|
399
|
+
declare const LOWER_LASH: {
|
|
400
|
+
readonly lash_lower_L: "eye_L";
|
|
401
|
+
readonly lash_lower_R: "eye_R";
|
|
402
|
+
};
|
|
403
|
+
/** A role the composer writes a layer for. */
|
|
404
|
+
type LayerRole = Role | keyof typeof LOWER_LASH;
|
|
398
405
|
/** Per-role placement overrides; anything omitted keeps the default above. */
|
|
399
406
|
type LayoutOverride = Partial<Record<Role, {
|
|
400
407
|
cx?: number;
|
|
@@ -422,7 +429,7 @@ interface ComposeInput {
|
|
|
422
429
|
mirrorParts?: string[];
|
|
423
430
|
}
|
|
424
431
|
interface ComposedLayer {
|
|
425
|
-
role:
|
|
432
|
+
role: LayerRole;
|
|
426
433
|
path: string;
|
|
427
434
|
/** Size of the placed part itself (the file is always CANVAS x CANVAS). */
|
|
428
435
|
width: number;
|
|
@@ -434,8 +441,11 @@ type ComposeResult = {
|
|
|
434
441
|
ok: true;
|
|
435
442
|
outDir: string;
|
|
436
443
|
layers: ComposedLayer[];
|
|
437
|
-
/**
|
|
438
|
-
|
|
444
|
+
/**
|
|
445
|
+
* Roles whose optional part was absent from the parts dir, and the lower
|
|
446
|
+
* lashes when the eyewhite draws no dark lower lid.
|
|
447
|
+
*/
|
|
448
|
+
skipped: LayerRole[];
|
|
439
449
|
preview: string;
|
|
440
450
|
measure: MeasureReport;
|
|
441
451
|
} | {
|
package/dist/index.js
CHANGED
|
@@ -1230,14 +1230,14 @@ function formatMeasureReport(result) {
|
|
|
1230
1230
|
|
|
1231
1231
|
// src/compose.ts
|
|
1232
1232
|
var CANVAS = 1100;
|
|
1233
|
-
var EYE_W =
|
|
1234
|
-
var IRIS_W =
|
|
1233
|
+
var EYE_W = 98;
|
|
1234
|
+
var IRIS_W = 50;
|
|
1235
1235
|
var EYEWHITE_SRC = "eyewhite.png";
|
|
1236
1236
|
var EYE_LASH_LUMA = 120;
|
|
1237
1237
|
var LASH_KEEP_FRACTION = 0.5;
|
|
1238
1238
|
var TRIM_THRESHOLD = 12;
|
|
1239
1239
|
var STRAY_SPECK_FRACTION = 0.01;
|
|
1240
|
-
var NOSE_TIP_AT = 0.
|
|
1240
|
+
var NOSE_TIP_AT = 0.66;
|
|
1241
1241
|
var DEFAULT_LAYOUT = {
|
|
1242
1242
|
// Back hair and body sit behind the face. Both are OPTIONAL: a parts dir
|
|
1243
1243
|
// without them still composes (head-only character).
|
|
@@ -1245,19 +1245,20 @@ var DEFAULT_LAYOUT = {
|
|
|
1245
1245
|
// The torso, cut off by the canvas bottom, so the character is not a
|
|
1246
1246
|
// floating head. It rides its own `bodyDeformer`, which only breathes.
|
|
1247
1247
|
body: { src: "body.png", cx: 550, cy: 1017, w: 840, optional: true },
|
|
1248
|
-
face
|
|
1248
|
+
// The face is drawn without a neck, so its box is the skull and centres
|
|
1249
|
+
// above the eye row (bob's skull at 437 against his eyes' 475).
|
|
1250
|
+
face: { src: "face.png", cx: 550, cy: 437, w: 400 },
|
|
1249
1251
|
// The cheek blush, one part for both cheeks: blush_R (screen left) takes it
|
|
1250
1252
|
// as drawn and blush_L mirrors it, like the eyewhite. It draws over the face
|
|
1251
|
-
// and under the nose. Its box sits below each eye, centred
|
|
1252
|
-
// eye's centre and above the nose tip
|
|
1253
|
-
//
|
|
1254
|
-
//
|
|
1255
|
-
// and
|
|
1256
|
-
//
|
|
1257
|
-
|
|
1258
|
-
blush_L: { src: "blush.png", cx: 662, cy: 530, w: 56, optional: true, mirror: true },
|
|
1253
|
+
// and under the nose. Its box sits below each eye, centred 5 px outside the
|
|
1254
|
+
// eye's centre and 55 px under its row, above the nose tip: on bob's face,
|
|
1255
|
+
// which narrows fast below the eye row, a 2:1 blush there stays on the
|
|
1256
|
+
// cheek through the turn, where one 26 px further out reached the ears.
|
|
1257
|
+
// OPTIONAL, and decoration: a parts dir without it composes, and nothing
|
|
1258
|
+
// reports it missing.
|
|
1259
|
+
blush_L: { src: "blush.png", cx: 641, cy: 530, w: 56, optional: true, mirror: true },
|
|
1259
1260
|
// prettier-ignore
|
|
1260
|
-
blush_R: { src: "blush.png", cx:
|
|
1261
|
+
blush_R: { src: "blush.png", cx: 459, cy: 530, w: 56, optional: true, mirror: false },
|
|
1261
1262
|
// prettier-ignore
|
|
1262
1263
|
// The nose, drawn on its own (the face is drawn without one): the auto-rig
|
|
1263
1264
|
// leads the head turn with it and keys the other features' slide on its
|
|
@@ -1265,8 +1266,8 @@ var DEFAULT_LAYOUT = {
|
|
|
1265
1266
|
// width of its dense core, and it has no `cy`: its row comes from the tip
|
|
1266
1267
|
// rule (NOSE_TIP_AT), between the eyes and the mouth, so it follows them
|
|
1267
1268
|
// when they are retuned. OPTIONAL: a parts dir without it composes.
|
|
1268
|
-
nose: { src: "nose.png", cx: 550, w:
|
|
1269
|
-
mouth: { src: "mouth.png", cx: 550, cy:
|
|
1269
|
+
nose: { src: "nose.png", cx: 550, w: 20, optional: true },
|
|
1270
|
+
mouth: { src: "mouth.png", cx: 550, cy: 594, w: 76 },
|
|
1270
1271
|
// Cross-fades with `mouth` on ParamMouthOpenY (opacity, not scaleY) once the
|
|
1271
1272
|
// auto-rig sees both roles. Same cx/w as `mouth` so the lip width matches;
|
|
1272
1273
|
// its top edge (not center) lines up with the closed mouth's top edge since
|
|
@@ -1275,34 +1276,37 @@ var DEFAULT_LAYOUT = {
|
|
|
1275
1276
|
mouth_open: {
|
|
1276
1277
|
src: "mouth_open.png",
|
|
1277
1278
|
cx: 550,
|
|
1278
|
-
cy:
|
|
1279
|
-
w:
|
|
1279
|
+
cy: 596,
|
|
1280
|
+
w: 76,
|
|
1280
1281
|
optional: true
|
|
1281
1282
|
},
|
|
1282
1283
|
// eye_* (sclera) and lash_* share the eyewhite's cropped frame via noTrim (so
|
|
1283
1284
|
// they are NOT re-bboxed independently): the upper lash stays anchored ABOVE
|
|
1284
1285
|
// the sclera center, so on blink it folds DOWN over the eye like the sample
|
|
1285
1286
|
// model instead of the whole eye shrinking in place. Same cx/cy/w.
|
|
1286
|
-
eye_L: { src: "eyewhite_sclera.png", cx:
|
|
1287
|
+
eye_L: { src: "eyewhite_sclera.png", cx: 636, cy: 475, w: EYE_W, mirror: true, noTrim: true },
|
|
1287
1288
|
// prettier-ignore
|
|
1288
|
-
eye_R: { src: "eyewhite_sclera.png", cx:
|
|
1289
|
+
eye_R: { src: "eyewhite_sclera.png", cx: 464, cy: 475, w: EYE_W, mirror: false, noTrim: true },
|
|
1289
1290
|
// prettier-ignore
|
|
1290
|
-
|
|
1291
|
-
|
|
1291
|
+
// A little under the white's centre and toward the nose, as bob's sits.
|
|
1292
|
+
iris_L: { src: "iris.png", cx: 631, cy: 480, w: IRIS_W, mirror: false },
|
|
1293
|
+
iris_R: { src: "iris.png", cx: 469, cy: 480, w: IRIS_W, mirror: false },
|
|
1292
1294
|
lash_L: {
|
|
1293
1295
|
src: "eyewhite_lash.png",
|
|
1294
|
-
cx:
|
|
1296
|
+
cx: 636,
|
|
1295
1297
|
cy: 475,
|
|
1296
1298
|
w: EYE_W,
|
|
1297
1299
|
mirror: true,
|
|
1298
1300
|
noTrim: true
|
|
1299
1301
|
},
|
|
1300
|
-
lash_R: { src: "eyewhite_lash.png", cx:
|
|
1302
|
+
lash_R: { src: "eyewhite_lash.png", cx: 464, cy: 475, w: EYE_W, mirror: false, noTrim: true },
|
|
1301
1303
|
// prettier-ignore
|
|
1302
|
-
brow_L: { src: "brow.png", cx: 645, cy: 405, w:
|
|
1303
|
-
brow_R: { src: "brow.png", cx: 455, cy: 405, w:
|
|
1304
|
+
brow_L: { src: "brow.png", cx: 645, cy: 405, w: 105, mirror: false },
|
|
1305
|
+
brow_R: { src: "brow.png", cx: 455, cy: 405, w: 105, mirror: true },
|
|
1304
1306
|
hair_front: { src: "hair_front.png", cx: 550, cy: 425, w: 660 }
|
|
1305
1307
|
};
|
|
1308
|
+
var LOWER_LASH = { lash_lower_L: "eye_L", lash_lower_R: "eye_R" };
|
|
1309
|
+
var LOWER_LASH_SRC = "eyewhite_lash_lower.png";
|
|
1306
1310
|
var ORDER = [
|
|
1307
1311
|
"hair_back",
|
|
1308
1312
|
"body",
|
|
@@ -1316,6 +1320,8 @@ var ORDER = [
|
|
|
1316
1320
|
"eye_R",
|
|
1317
1321
|
"iris_L",
|
|
1318
1322
|
"iris_R",
|
|
1323
|
+
"lash_lower_L",
|
|
1324
|
+
"lash_lower_R",
|
|
1319
1325
|
"lash_L",
|
|
1320
1326
|
"lash_R",
|
|
1321
1327
|
"brow_L",
|
|
@@ -1328,9 +1334,24 @@ var PART_FILES = [
|
|
|
1328
1334
|
),
|
|
1329
1335
|
EYEWHITE_SRC
|
|
1330
1336
|
];
|
|
1337
|
+
var FACE_FEATURES = [
|
|
1338
|
+
"blush_L",
|
|
1339
|
+
"blush_R",
|
|
1340
|
+
"mouth",
|
|
1341
|
+
"mouth_open",
|
|
1342
|
+
"eye_L",
|
|
1343
|
+
"eye_R",
|
|
1344
|
+
"iris_L",
|
|
1345
|
+
"iris_R",
|
|
1346
|
+
"lash_L",
|
|
1347
|
+
"lash_R",
|
|
1348
|
+
"brow_L",
|
|
1349
|
+
"brow_R"
|
|
1350
|
+
];
|
|
1331
1351
|
function resolveLayout(overrides) {
|
|
1332
1352
|
const resolved = { ...DEFAULT_LAYOUT };
|
|
1333
1353
|
if (overrides === void 0) return resolved;
|
|
1354
|
+
const sets = /* @__PURE__ */ new Map();
|
|
1334
1355
|
for (const [role, override] of Object.entries(overrides)) {
|
|
1335
1356
|
if (!Object.prototype.hasOwnProperty.call(DEFAULT_LAYOUT, role)) {
|
|
1336
1357
|
throw new AutoRigInputError(
|
|
@@ -1359,9 +1380,30 @@ function resolveLayout(overrides) {
|
|
|
1359
1380
|
}
|
|
1360
1381
|
set[field] = value;
|
|
1361
1382
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1383
|
+
sets.set(role, set);
|
|
1384
|
+
}
|
|
1385
|
+
const face = { ...resolved.face, ...sets.get("face") };
|
|
1386
|
+
resolved.face = face;
|
|
1387
|
+
const base = DEFAULT_LAYOUT.face;
|
|
1388
|
+
const scale = face.w / base.w;
|
|
1389
|
+
const x = (cx) => face.cx + (cx - base.cx) * scale;
|
|
1390
|
+
const w = (width) => Math.max(1, Math.round(width * scale));
|
|
1391
|
+
for (const role of FACE_FEATURES) {
|
|
1392
|
+
const d = DEFAULT_LAYOUT[role];
|
|
1393
|
+
const cy = face.cy + (d.cy - base.cy) * scale;
|
|
1394
|
+
resolved[role] = { ...d, cx: x(d.cx), cy, w: w(d.w), ...sets.get(role) };
|
|
1395
|
+
}
|
|
1396
|
+
const nose = DEFAULT_LAYOUT.nose;
|
|
1397
|
+
resolved.nose = {
|
|
1398
|
+
...nose,
|
|
1399
|
+
cx: x(nose.cx),
|
|
1400
|
+
w: w(nose.w),
|
|
1401
|
+
...sets.get("nose")
|
|
1402
|
+
};
|
|
1403
|
+
for (const [role, set] of sets) {
|
|
1404
|
+
if (role === "face" || role === "nose") continue;
|
|
1405
|
+
if (FACE_FEATURES.includes(role)) continue;
|
|
1406
|
+
resolved[role] = { ...resolved[role], ...set };
|
|
1365
1407
|
}
|
|
1366
1408
|
return resolved;
|
|
1367
1409
|
}
|
|
@@ -1393,6 +1435,10 @@ async function coreAndBoundsOf(png) {
|
|
|
1393
1435
|
bounds: { x: 0, y: 0, w: info.width, h: info.height }
|
|
1394
1436
|
};
|
|
1395
1437
|
}
|
|
1438
|
+
async function hasCoverage(png) {
|
|
1439
|
+
const { data, info } = await (0, import_sharp2.default)(png).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
1440
|
+
return (0, import_editor5.detectAlphaBbox)(data, info.width, info.height) !== null;
|
|
1441
|
+
}
|
|
1396
1442
|
async function noseSizingOf(png) {
|
|
1397
1443
|
const { core, bounds } = await coreAndBoundsOf(png);
|
|
1398
1444
|
if (core === null) return { box: bounds, whole: true };
|
|
@@ -1673,13 +1719,18 @@ async function prepEyeSplit(partsDir) {
|
|
|
1673
1719
|
const detached = detachedAboveWhite(data, W, H);
|
|
1674
1720
|
const sclera = Buffer.from(data);
|
|
1675
1721
|
const lash = Buffer.from(data);
|
|
1722
|
+
const lashLower = Buffer.from(data);
|
|
1723
|
+
let lowerInk = false;
|
|
1676
1724
|
for (let y = 0; y < H; y++) {
|
|
1677
1725
|
for (let x = 0; x < W; x++) {
|
|
1678
1726
|
const i = (y * W + x) * 4;
|
|
1679
1727
|
const isDark = data[i + 3] > 0 && luma(data, i) < EYE_LASH_LUMA;
|
|
1680
|
-
|
|
1728
|
+
const upper = y <= lashCutoffY;
|
|
1729
|
+
if (isDark && upper) sclera[i] = sclera[i + 1] = sclera[i + 2] = 255;
|
|
1681
1730
|
if (detached[y * W + x]) sclera[i + 3] = 0;
|
|
1682
|
-
if (!(isDark &&
|
|
1731
|
+
if (!(isDark && upper)) lash[i + 3] = 0;
|
|
1732
|
+
if (isDark && !upper) lowerInk = true;
|
|
1733
|
+
else lashLower[i + 3] = 0;
|
|
1683
1734
|
}
|
|
1684
1735
|
}
|
|
1685
1736
|
const region = {
|
|
@@ -1690,7 +1741,8 @@ async function prepEyeSplit(partsDir) {
|
|
|
1690
1741
|
};
|
|
1691
1742
|
return {
|
|
1692
1743
|
sclera: await cropToBuffer(sclera, W, H, region),
|
|
1693
|
-
lash: await cropToBuffer(lash, W, H, region)
|
|
1744
|
+
lash: await cropToBuffer(lash, W, H, region),
|
|
1745
|
+
lashLower: lowerInk ? await cropToBuffer(lashLower, W, H, region) : null
|
|
1694
1746
|
};
|
|
1695
1747
|
}
|
|
1696
1748
|
async function composeLayersFromParts(input) {
|
|
@@ -1709,11 +1761,20 @@ async function composeLayersFromParts(input) {
|
|
|
1709
1761
|
["eyewhite_sclera.png", split.sclera],
|
|
1710
1762
|
["eyewhite_lash.png", split.lash]
|
|
1711
1763
|
]);
|
|
1764
|
+
if (split.lashLower !== null) {
|
|
1765
|
+
splitSources.set(LOWER_LASH_SRC, split.lashLower);
|
|
1766
|
+
}
|
|
1712
1767
|
const placed = [];
|
|
1713
1768
|
const skipped = [];
|
|
1714
1769
|
let noseSpeck;
|
|
1715
1770
|
for (const role of ORDER) {
|
|
1716
|
-
const
|
|
1771
|
+
const lower = role === "lash_lower_L" || role === "lash_lower_R";
|
|
1772
|
+
const key = lower ? LOWER_LASH[role] : role;
|
|
1773
|
+
if (lower && split.lashLower === null) {
|
|
1774
|
+
skipped.push(role);
|
|
1775
|
+
continue;
|
|
1776
|
+
}
|
|
1777
|
+
const cfg = lower ? { ...layout[key], src: LOWER_LASH_SRC } : layout[key];
|
|
1717
1778
|
const inMemory = splitSources.get(cfg.src);
|
|
1718
1779
|
const part = await partBuffer(
|
|
1719
1780
|
role,
|
|
@@ -1723,19 +1784,19 @@ async function composeLayersFromParts(input) {
|
|
|
1723
1784
|
// The split halves are cut from eyewhite.png, the file a caller names.
|
|
1724
1785
|
mirrored.has(inMemory === void 0 ? cfg.src : EYEWHITE_SRC)
|
|
1725
1786
|
);
|
|
1726
|
-
if (part === null) {
|
|
1787
|
+
if (part === null || lower && !await hasCoverage(part.buf)) {
|
|
1727
1788
|
skipped.push(role);
|
|
1728
1789
|
continue;
|
|
1729
1790
|
}
|
|
1730
1791
|
let left;
|
|
1731
1792
|
let top;
|
|
1732
|
-
if (
|
|
1793
|
+
if (key === "nose") {
|
|
1733
1794
|
noseSpeck = part.nose?.speck;
|
|
1734
1795
|
const { core, bounds } = await coreAndBoundsOf(part.buf);
|
|
1735
1796
|
const box = part.nose?.whole ? bounds : core ?? bounds;
|
|
1736
1797
|
({ left, top } = nosePlacement(layout, box, part.w, part.h));
|
|
1737
1798
|
} else {
|
|
1738
|
-
({ left, top } = placement(
|
|
1799
|
+
({ left, top } = placement(key, layout[key], part.w, part.h));
|
|
1739
1800
|
}
|
|
1740
1801
|
if (role === "lash_L" || role === "lash_R") {
|
|
1741
1802
|
const eyeRole = role === "lash_L" ? "eye_L" : "eye_R";
|
|
@@ -1796,7 +1857,7 @@ async function composeLayersFromParts(input) {
|
|
|
1796
1857
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
1797
1858
|
var import_zod = require("zod");
|
|
1798
1859
|
function createIkiMcpServer() {
|
|
1799
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
1860
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.16.0" });
|
|
1800
1861
|
server.registerTool(
|
|
1801
1862
|
"validate_iki",
|
|
1802
1863
|
{
|
|
@@ -1916,7 +1977,7 @@ function createIkiMcpServer() {
|
|
|
1916
1977
|
server.registerTool(
|
|
1917
1978
|
"compose_layers_from_parts",
|
|
1918
1979
|
{
|
|
1919
|
-
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 default 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.",
|
|
1980
|
+
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 default 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. The eyewhite's dark lower lid \u2014 its line and lashes \u2014 becomes lash_lower_L/lash_lower_R, drawn over the iris; a white with none writes none and lists them in `skipped`.",
|
|
1920
1981
|
inputSchema: {
|
|
1921
1982
|
partsDir: import_zod.z.string().describe(
|
|
1922
1983
|
"Directory of the source part PNGs (resolved against cwd)."
|
|
@@ -1933,7 +1994,7 @@ function createIkiMcpServer() {
|
|
|
1933
1994
|
h: import_zod.z.number()
|
|
1934
1995
|
}).partial()
|
|
1935
1996
|
).optional().describe(
|
|
1936
|
-
"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.
|
|
1997
|
+
"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 defaults of the face's features \u2014 blush, nose, mouth, mouth_open, eyes, irises, lashes, brows \u2014 are proportions of the face: an override of face.cx, face.cy or face.w carries them with it (scaled by the width; face.h stretches the face alone), while a feature's own override names canvas px. 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.66 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. lash_lower_L/lash_lower_R are cut from it too and have no key: they land on their eye's frame."
|
|
1937
1998
|
),
|
|
1938
1999
|
mirrorParts: import_zod.z.array(import_zod.z.string()).optional().describe(
|
|
1939
2000
|
"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."
|