vargai 0.4.0-alpha38 → 0.4.0-alpha39
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/package.json +1 -1
- package/src/ai-sdk/providers/fal.ts +0 -31
package/package.json
CHANGED
|
@@ -583,37 +583,11 @@ class FalImageModel implements ImageModelV3 {
|
|
|
583
583
|
|
|
584
584
|
const finalEndpoint = this.resolveEndpoint();
|
|
585
585
|
|
|
586
|
-
// Timing diagnostics
|
|
587
|
-
const t0 = Date.now();
|
|
588
|
-
let lastStatus = "";
|
|
589
|
-
const queueStartTime = t0;
|
|
590
|
-
let processingStartTime = 0;
|
|
591
|
-
|
|
592
586
|
const result = await fal.subscribe(finalEndpoint, {
|
|
593
587
|
input,
|
|
594
588
|
logs: true,
|
|
595
|
-
onQueueUpdate: (status) => {
|
|
596
|
-
const elapsed = Date.now() - t0;
|
|
597
|
-
if (status.status !== lastStatus) {
|
|
598
|
-
if (status.status === "IN_PROGRESS" && !processingStartTime) {
|
|
599
|
-
processingStartTime = Date.now();
|
|
600
|
-
console.log(
|
|
601
|
-
`[fal-timing] ${this.modelId}: IN_QUEUE took ${processingStartTime - queueStartTime}ms`,
|
|
602
|
-
);
|
|
603
|
-
}
|
|
604
|
-
console.log(
|
|
605
|
-
`[fal-timing] ${this.modelId}: status=${status.status} at ${elapsed}ms`,
|
|
606
|
-
);
|
|
607
|
-
lastStatus = status.status;
|
|
608
|
-
}
|
|
609
|
-
},
|
|
610
589
|
});
|
|
611
590
|
|
|
612
|
-
const subscribeTime = Date.now() - t0;
|
|
613
|
-
console.log(
|
|
614
|
-
`[fal-timing] ${this.modelId}: total subscribe took ${subscribeTime}ms`,
|
|
615
|
-
);
|
|
616
|
-
|
|
617
591
|
const data = result.data as { images?: Array<{ url?: string }> };
|
|
618
592
|
const images = data?.images ?? [];
|
|
619
593
|
|
|
@@ -621,17 +595,12 @@ class FalImageModel implements ImageModelV3 {
|
|
|
621
595
|
throw new Error("No images in fal response");
|
|
622
596
|
}
|
|
623
597
|
|
|
624
|
-
const t1 = Date.now();
|
|
625
598
|
const imageBuffers = await Promise.all(
|
|
626
599
|
images.map(async (img) => {
|
|
627
600
|
const response = await fetch(img.url!, { signal: abortSignal });
|
|
628
601
|
return new Uint8Array(await response.arrayBuffer());
|
|
629
602
|
}),
|
|
630
603
|
);
|
|
631
|
-
const downloadTime = Date.now() - t1;
|
|
632
|
-
console.log(
|
|
633
|
-
`[fal-timing] ${this.modelId}: image download took ${downloadTime}ms`,
|
|
634
|
-
);
|
|
635
604
|
|
|
636
605
|
return {
|
|
637
606
|
images: imageBuffers,
|