@clickraft/cli 0.11.1 → 0.12.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/CHANGELOG.md +34 -3
- package/dist/cli.js +20 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -95,8 +95,8 @@ var TokensListResponseSchema = z4.array(TokenRowSchema);
|
|
|
95
95
|
var DeclaredParamSchema = z5.object({
|
|
96
96
|
name: z5.string(),
|
|
97
97
|
type: z5.string(),
|
|
98
|
-
required: z5.boolean(),
|
|
99
|
-
defaultValue: z5.
|
|
98
|
+
required: z5.boolean().optional(),
|
|
99
|
+
defaultValue: z5.unknown().optional(),
|
|
100
100
|
enumValues: z5.array(z5.string()).nullable().optional(),
|
|
101
101
|
description: z5.string().nullable().optional()
|
|
102
102
|
}).strict();
|
|
@@ -139,6 +139,8 @@ var GenerateCreateRequestSchema = z6.object({
|
|
|
139
139
|
"resolution must match WxH (e.g. 1280x720), p-token (e.g. 720p), or K-token (e.g. 1K)"
|
|
140
140
|
).optional(),
|
|
141
141
|
durationSeconds: z6.number().int().min(1).max(60).optional(),
|
|
142
|
+
width: z6.number().int().min(64).max(8192).optional(),
|
|
143
|
+
height: z6.number().int().min(64).max(8192).optional(),
|
|
142
144
|
providerParams: z6.record(z6.string(), z6.unknown()).optional()
|
|
143
145
|
}).strict(),
|
|
144
146
|
options: z6.object({
|
|
@@ -2059,13 +2061,19 @@ async function generateCreate(opts) {
|
|
|
2059
2061
|
const preflightRefs = (opts.referenceImages ?? []).map(
|
|
2060
2062
|
(v) => isUrlLike(v) ? v : PREFLIGHT_PLACEHOLDER_URL
|
|
2061
2063
|
);
|
|
2062
|
-
|
|
2064
|
+
const preflightStartFrame = opts.startFrame === void 0 ? void 0 : isUrlLike(opts.startFrame) ? opts.startFrame : PREFLIGHT_PLACEHOLDER_URL;
|
|
2065
|
+
buildRequestBody({ ...opts, referenceImages: preflightRefs, startFrame: preflightStartFrame });
|
|
2063
2066
|
const referenceImages = await resolveReferenceImages({
|
|
2064
2067
|
items: opts.referenceImages ?? [],
|
|
2065
2068
|
client,
|
|
2066
2069
|
signal: opts.signal
|
|
2067
2070
|
});
|
|
2068
|
-
const
|
|
2071
|
+
const startFrame = opts.startFrame === void 0 ? void 0 : (await resolveReferenceImages({
|
|
2072
|
+
items: [opts.startFrame],
|
|
2073
|
+
client,
|
|
2074
|
+
signal: opts.signal
|
|
2075
|
+
}))[0];
|
|
2076
|
+
const body = buildRequestBody({ ...opts, referenceImages, startFrame });
|
|
2069
2077
|
return createGeneration({
|
|
2070
2078
|
client,
|
|
2071
2079
|
body,
|
|
@@ -2100,11 +2108,12 @@ async function resolveReferenceImages(args) {
|
|
|
2100
2108
|
function buildRequestBody(args) {
|
|
2101
2109
|
const input = {};
|
|
2102
2110
|
if (args.prompt !== void 0) input.prompt = args.prompt;
|
|
2103
|
-
if (args.referenceImages.length
|
|
2104
|
-
input.referenceImageUrl = args.referenceImages[0];
|
|
2105
|
-
} else if (args.referenceImages.length > 1) {
|
|
2111
|
+
if (args.referenceImages.length > 0) {
|
|
2106
2112
|
input.referenceImages = args.referenceImages.map((url) => ({ url }));
|
|
2107
2113
|
}
|
|
2114
|
+
if (args.startFrame !== void 0) {
|
|
2115
|
+
input.referenceImageUrl = args.startFrame;
|
|
2116
|
+
}
|
|
2108
2117
|
if (args.aspectRatio !== void 0) input.aspectRatio = args.aspectRatio;
|
|
2109
2118
|
if (args.resolution !== void 0) input.resolution = args.resolution;
|
|
2110
2119
|
if (args.durationSeconds !== void 0) input.durationSeconds = args.durationSeconds;
|
|
@@ -4290,7 +4299,8 @@ function renderCommandHelp(command) {
|
|
|
4290
4299
|
" --product <spec> Product reference (repeatable)",
|
|
4291
4300
|
" Format: <uuid> or <uuid>:<imageId>",
|
|
4292
4301
|
" Server enforces reference cap per model",
|
|
4293
|
-
" --reference-image <v> URL or local path (repeatable, max 8)",
|
|
4302
|
+
" --reference-image <v> Reference image: URL or local path (repeatable, max 8)",
|
|
4303
|
+
" --start-frame <v> Image-to-video start frame: URL or local path",
|
|
4294
4304
|
" --aspect-ratio <a:b> e.g. 16:9",
|
|
4295
4305
|
" --resolution <size> e.g. 1024x768, 720p, 1K",
|
|
4296
4306
|
" --duration-seconds <n> For video/audio models (1-60)",
|
|
@@ -4605,6 +4615,7 @@ async function runGenerateCreate(argv, ctx, rc) {
|
|
|
4605
4615
|
...COMMON_RICH_STRING_FLAGS,
|
|
4606
4616
|
"prompt",
|
|
4607
4617
|
"model-slug",
|
|
4618
|
+
"start-frame",
|
|
4608
4619
|
"aspect-ratio",
|
|
4609
4620
|
"resolution",
|
|
4610
4621
|
"duration-seconds",
|
|
@@ -4627,6 +4638,7 @@ async function runGenerateCreate(argv, ctx, rc) {
|
|
|
4627
4638
|
prompt: parsed.string.prompt ?? parsed.positional[0],
|
|
4628
4639
|
modelSlug,
|
|
4629
4640
|
referenceImages: parsed.array["reference-image"],
|
|
4641
|
+
startFrame: parsed.string["start-frame"],
|
|
4630
4642
|
aspectRatio: parsed.string["aspect-ratio"],
|
|
4631
4643
|
resolution: parsed.string.resolution,
|
|
4632
4644
|
durationSeconds: optionalInt(parsed.string["duration-seconds"], "duration-seconds"),
|