pixelkiln 0.55.0 → 0.56.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/dist/cli.js +70 -10
- package/dist/cli.js.map +1 -1
- package/dist/client/gallery.js +152 -0
- package/dist/index.cjs +70 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +262 -2
- package/dist/index.d.ts +262 -2
- package/dist/index.js +70 -10
- package/dist/index.js.map +1 -1
- package/docs/CHARACTERS.md +6 -1
- package/docs/GENERATORS.md +5 -0
- package/package.json +1 -1
- package/skills/pixelkiln/references/pixellab.md +7 -1
package/dist/cli.js
CHANGED
|
@@ -11426,6 +11426,25 @@ var AssetPatchSchema = z5.object({
|
|
|
11426
11426
|
size: z5.number().int().nullable().optional(),
|
|
11427
11427
|
tags: z5.array(z5.string()).optional()
|
|
11428
11428
|
}).strict();
|
|
11429
|
+
var NewStateSchema = z5.object({
|
|
11430
|
+
/** Asset id of the parent this states; must already exist. */
|
|
11431
|
+
of: z5.string().min(1),
|
|
11432
|
+
paletteFromReference: z5.boolean().optional(),
|
|
11433
|
+
canvas: z5.object({ width: z5.number().int().min(16).max(256), height: z5.number().int().min(16).max(256) }).strict().optional()
|
|
11434
|
+
}).strict();
|
|
11435
|
+
var NewAnimationSchema = z5.object({
|
|
11436
|
+
/** Asset id of the parent this animates; must already exist. */
|
|
11437
|
+
of: z5.string().min(1),
|
|
11438
|
+
/** A PixelLab template id (`character` only; `objectPro` has no template concept). */
|
|
11439
|
+
template: z5.string().min(1).optional(),
|
|
11440
|
+
direction: CharacterDirectionSchema.optional(),
|
|
11441
|
+
frames: z5.number().int().min(4).max(16).optional(),
|
|
11442
|
+
fps: z5.number().int().min(1).max(60).optional(),
|
|
11443
|
+
mode: CharacterAnimationModeSchema.optional(),
|
|
11444
|
+
/** What is being animated, when the parent's own description would mislead the model (`character` only). */
|
|
11445
|
+
subject: z5.string().min(1).optional(),
|
|
11446
|
+
enhancePrompt: z5.boolean().optional()
|
|
11447
|
+
}).strict();
|
|
11429
11448
|
var NewAssetSchema = z5.object({
|
|
11430
11449
|
prompt: z5.string(),
|
|
11431
11450
|
category: z5.string().optional(),
|
|
@@ -11446,8 +11465,16 @@ var NewAssetSchema = z5.object({
|
|
|
11446
11465
|
/** Asset id of the parent this revises; must already exist. */
|
|
11447
11466
|
from: z5.string().min(1),
|
|
11448
11467
|
strength: z5.number().min(0).max(1).optional()
|
|
11449
|
-
}).strict().optional()
|
|
11450
|
-
|
|
11468
|
+
}).strict().optional(),
|
|
11469
|
+
/** A pose or outfit of an existing `character`/`objectPro` base or state. */
|
|
11470
|
+
state: NewStateSchema.optional(),
|
|
11471
|
+
/** A loop of an existing `character`/`objectPro` base or state. */
|
|
11472
|
+
animation: NewAnimationSchema.optional()
|
|
11473
|
+
}).strict().refine((asset) => !(asset.revision && (asset.state || asset.animation)), {
|
|
11474
|
+
message: "an asset is a revision, a state, or an animation \u2014 not more than one"
|
|
11475
|
+
}).refine((asset) => !(asset.state && asset.animation), {
|
|
11476
|
+
message: "an asset is a state or an animation \u2014 not both"
|
|
11477
|
+
});
|
|
11451
11478
|
var CANDIDATE_OPTION = {
|
|
11452
11479
|
retrodiffusion: "numImages",
|
|
11453
11480
|
comfyui: "numImages",
|
|
@@ -11615,6 +11642,12 @@ function applyEdit(raw, edit) {
|
|
|
11615
11642
|
if (edit.asset.revision && !Object.hasOwn(raw.assets, edit.asset.revision.from)) {
|
|
11616
11643
|
throw new ManifestEditError(`revision parent "${edit.asset.revision.from}" is not declared by the manifest`);
|
|
11617
11644
|
}
|
|
11645
|
+
if (edit.asset.state && !Object.hasOwn(raw.assets, edit.asset.state.of)) {
|
|
11646
|
+
throw new ManifestEditError(`state parent "${edit.asset.state.of}" is not declared by the manifest`);
|
|
11647
|
+
}
|
|
11648
|
+
if (edit.asset.animation && !Object.hasOwn(raw.assets, edit.asset.animation.of)) {
|
|
11649
|
+
throw new ManifestEditError(`animation parent "${edit.asset.animation.of}" is not declared by the manifest`);
|
|
11650
|
+
}
|
|
11618
11651
|
raw.assets[edit.assetId] = asset2;
|
|
11619
11652
|
return;
|
|
11620
11653
|
}
|
|
@@ -12265,27 +12298,54 @@ async function samePixels(a, b) {
|
|
|
12265
12298
|
}
|
|
12266
12299
|
var metadataFps = (entry) => entry ? frameSetFps(entry) : null;
|
|
12267
12300
|
function describeCharacter(spec, entry) {
|
|
12268
|
-
const
|
|
12301
|
+
const recordedCharacter = entry?.providerMetadata?.[entry.provider]?.character;
|
|
12269
12302
|
if (spec?.character) {
|
|
12270
12303
|
const character = spec.character;
|
|
12271
12304
|
return {
|
|
12305
|
+
generator: "character",
|
|
12272
12306
|
kind: character.kind,
|
|
12273
12307
|
parentKey: character.parentAssetId ? lockKey(spec.styleId, character.parentAssetId) : null,
|
|
12274
12308
|
mode: character.kind === "animation" ? character.animation.mode : character.mode,
|
|
12275
12309
|
directions: character.directions,
|
|
12276
12310
|
direction: character.animation?.direction ?? null,
|
|
12277
|
-
characterId:
|
|
12311
|
+
characterId: recordedCharacter?.characterId ?? entry?.objectId?.split("#")[0] ?? null
|
|
12312
|
+
};
|
|
12313
|
+
}
|
|
12314
|
+
if (spec?.objectPro) {
|
|
12315
|
+
const objectPro = spec.objectPro;
|
|
12316
|
+
return {
|
|
12317
|
+
generator: "objectPro",
|
|
12318
|
+
kind: objectPro.kind,
|
|
12319
|
+
parentKey: objectPro.parentAssetId ? lockKey(spec.styleId, objectPro.parentAssetId) : null,
|
|
12320
|
+
mode: objectPro.kind === "animation" ? objectPro.animation.mode : "pro-flash",
|
|
12321
|
+
directions: objectPro.directions,
|
|
12322
|
+
direction: objectPro.animation?.direction ?? null,
|
|
12323
|
+
characterId: entry?.objectId?.split("#")[0] ?? null
|
|
12278
12324
|
};
|
|
12279
12325
|
}
|
|
12280
12326
|
if (entry?.generator === "character") {
|
|
12281
|
-
const kind =
|
|
12327
|
+
const kind = recordedCharacter?.kind === "animation" || entry.outputs.some((o) => o.role?.startsWith("frame-")) ? "animation" : "base";
|
|
12328
|
+
return {
|
|
12329
|
+
generator: "character",
|
|
12330
|
+
kind,
|
|
12331
|
+
parentKey: null,
|
|
12332
|
+
mode: recordedCharacter?.mode ?? "standard",
|
|
12333
|
+
directions: recordedCharacter?.directions ?? entry.outputs.length,
|
|
12334
|
+
direction: recordedCharacter?.direction ?? null,
|
|
12335
|
+
characterId: recordedCharacter?.characterId ?? entry.objectId?.split("#")[0] ?? null
|
|
12336
|
+
};
|
|
12337
|
+
}
|
|
12338
|
+
if (entry?.generator === "objectPro") {
|
|
12339
|
+
const recordedObject = entry.providerMetadata?.[entry.provider]?.objectPro;
|
|
12340
|
+
const kind = recordedObject?.kind === "animation" || entry.outputs.some((o) => o.role?.startsWith("frame-")) ? "animation" : "base";
|
|
12282
12341
|
return {
|
|
12342
|
+
generator: "objectPro",
|
|
12283
12343
|
kind,
|
|
12284
12344
|
parentKey: null,
|
|
12285
|
-
mode:
|
|
12286
|
-
directions:
|
|
12287
|
-
direction:
|
|
12288
|
-
characterId:
|
|
12345
|
+
mode: "pro-flash",
|
|
12346
|
+
directions: recordedObject?.directions ?? entry.outputs.length,
|
|
12347
|
+
direction: recordedObject?.direction ?? null,
|
|
12348
|
+
characterId: entry.objectId?.split("#")[0] ?? null
|
|
12289
12349
|
};
|
|
12290
12350
|
}
|
|
12291
12351
|
return null;
|
|
@@ -12621,7 +12681,7 @@ async function buildGallerySnapshot(opts) {
|
|
|
12621
12681
|
view: style?.view ?? null,
|
|
12622
12682
|
noBackground: style?.noBackground ?? true,
|
|
12623
12683
|
quality: Boolean(style?.quality),
|
|
12624
|
-
characters: style?.generator === "character" ? {
|
|
12684
|
+
characters: style?.generator === "character" || style?.generator === "objectPro" ? {
|
|
12625
12685
|
bases: styleItems.filter((item) => item.character?.kind === "base").length,
|
|
12626
12686
|
states: styleItems.filter((item) => item.character?.kind === "state").length,
|
|
12627
12687
|
animations: styleItems.filter((item) => item.character?.kind === "animation").length
|