console log image generation time

This commit is contained in:
Riccardo Giorato
2026-01-27 17:09:18 +01:00
parent 0fcb0dae7a
commit 2201bd2e3f
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -225,6 +225,8 @@ Only return the JSON, no other text.`;
let response;
try {
console.log("Starting image generation...");
const startTime = Date.now();
response = await client.images.generate({
model: IMAGE_MODEL,
prompt: fullPrompt,
@@ -234,6 +236,10 @@ Only return the JSON, no other text.`;
reference_images:
referenceImages.length > 0 ? referenceImages : undefined,
});
const endTime = Date.now();
const durationMs = endTime - startTime;
const durationSeconds = (durationMs / 1000).toFixed(2);
console.log(`Image generation completed in ${durationSeconds} seconds`);
} catch (error) {
console.error("Together AI API error:", error);