@clickraft/cli 0.11.2 → 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/dist/index.js CHANGED
@@ -2061,13 +2061,19 @@ async function generateCreate(opts) {
2061
2061
  const preflightRefs = (opts.referenceImages ?? []).map(
2062
2062
  (v) => isUrlLike(v) ? v : PREFLIGHT_PLACEHOLDER_URL
2063
2063
  );
2064
- buildRequestBody({ ...opts, referenceImages: preflightRefs });
2064
+ const preflightStartFrame = opts.startFrame === void 0 ? void 0 : isUrlLike(opts.startFrame) ? opts.startFrame : PREFLIGHT_PLACEHOLDER_URL;
2065
+ buildRequestBody({ ...opts, referenceImages: preflightRefs, startFrame: preflightStartFrame });
2065
2066
  const referenceImages = await resolveReferenceImages({
2066
2067
  items: opts.referenceImages ?? [],
2067
2068
  client,
2068
2069
  signal: opts.signal
2069
2070
  });
2070
- const body = buildRequestBody({ ...opts, referenceImages });
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 });
2071
2077
  return createGeneration({
2072
2078
  client,
2073
2079
  body,
@@ -2102,11 +2108,12 @@ async function resolveReferenceImages(args) {
2102
2108
  function buildRequestBody(args) {
2103
2109
  const input = {};
2104
2110
  if (args.prompt !== void 0) input.prompt = args.prompt;
2105
- if (args.referenceImages.length === 1) {
2106
- input.referenceImageUrl = args.referenceImages[0];
2107
- } else if (args.referenceImages.length > 1) {
2111
+ if (args.referenceImages.length > 0) {
2108
2112
  input.referenceImages = args.referenceImages.map((url) => ({ url }));
2109
2113
  }
2114
+ if (args.startFrame !== void 0) {
2115
+ input.referenceImageUrl = args.startFrame;
2116
+ }
2110
2117
  if (args.aspectRatio !== void 0) input.aspectRatio = args.aspectRatio;
2111
2118
  if (args.resolution !== void 0) input.resolution = args.resolution;
2112
2119
  if (args.durationSeconds !== void 0) input.durationSeconds = args.durationSeconds;
@@ -4292,7 +4299,8 @@ function renderCommandHelp(command) {
4292
4299
  " --product <spec> Product reference (repeatable)",
4293
4300
  " Format: <uuid> or <uuid>:<imageId>",
4294
4301
  " Server enforces reference cap per model",
4295
- " --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",
4296
4304
  " --aspect-ratio <a:b> e.g. 16:9",
4297
4305
  " --resolution <size> e.g. 1024x768, 720p, 1K",
4298
4306
  " --duration-seconds <n> For video/audio models (1-60)",
@@ -4607,6 +4615,7 @@ async function runGenerateCreate(argv, ctx, rc) {
4607
4615
  ...COMMON_RICH_STRING_FLAGS,
4608
4616
  "prompt",
4609
4617
  "model-slug",
4618
+ "start-frame",
4610
4619
  "aspect-ratio",
4611
4620
  "resolution",
4612
4621
  "duration-seconds",
@@ -4629,6 +4638,7 @@ async function runGenerateCreate(argv, ctx, rc) {
4629
4638
  prompt: parsed.string.prompt ?? parsed.positional[0],
4630
4639
  modelSlug,
4631
4640
  referenceImages: parsed.array["reference-image"],
4641
+ startFrame: parsed.string["start-frame"],
4632
4642
  aspectRatio: parsed.string["aspect-ratio"],
4633
4643
  resolution: parsed.string.resolution,
4634
4644
  durationSeconds: optionalInt(parsed.string["duration-seconds"], "duration-seconds"),