climage 0.6.0 → 0.6.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/dist/cli.js CHANGED
@@ -1313,11 +1313,22 @@ async function generateVercelImage(req, apiKey) {
1313
1313
  const gw = makeGateway(apiKey);
1314
1314
  const model = req.model ?? DEFAULT_IMAGE_MODEL2;
1315
1315
  log5("Starting image generation, model:", model);
1316
+ const hasInputImages = req.inputImages && req.inputImages.length > 0;
1317
+ let prompt;
1318
+ if (hasInputImages) {
1319
+ const images2 = req.inputImages.map(
1320
+ (img) => img.startsWith("data:") ? dataUriToUint8Array(img) : Uint8Array.from(Buffer.from(img))
1321
+ );
1322
+ prompt = { images: images2, text: req.prompt };
1323
+ log5("Using image editing mode with", images2.length, "input image(s)");
1324
+ } else {
1325
+ prompt = req.prompt;
1326
+ }
1316
1327
  log5("Calling generateImage...");
1317
1328
  const startTime = Date.now();
1318
1329
  const result = await sdkGenerateImage({
1319
1330
  model: gw.image(model),
1320
- prompt: req.prompt,
1331
+ prompt,
1321
1332
  ...req.aspectRatio ? { aspectRatio: req.aspectRatio } : {},
1322
1333
  n: req.n
1323
1334
  });
@@ -1341,7 +1352,7 @@ var vercelCapabilities = {
1341
1352
  supportsCustomAspectRatio: true,
1342
1353
  supportsVideoInterpolation: false,
1343
1354
  videoDurationRange: [1, 15],
1344
- supportsImageEditing: false
1355
+ supportsImageEditing: true
1345
1356
  };
1346
1357
  var vercelProvider = {
1347
1358
  id: "vercel",