test
Browse files
src/lib/components/PicletGenerator/PicletGenerator.svelte
CHANGED
@@ -302,18 +302,25 @@ Focus on: colors, body shape, eyes, limbs, mouth, and key visual features. Omit
|
|
302 |
}
|
303 |
|
304 |
try {
|
|
|
|
|
|
|
305 |
// Call Joy Caption Alpha Two with correct parameters
|
306 |
const output = await joyCaptionClient.predict([
|
307 |
-
|
308 |
-
"Descriptive",
|
309 |
-
"long",
|
310 |
-
[],
|
311 |
-
"",
|
312 |
-
""
|
313 |
]);
|
314 |
|
315 |
// Joy Caption Alpha Two returns (prompt_str, caption)
|
316 |
const [prompt_str, caption] = output.data;
|
|
|
|
|
|
|
|
|
317 |
// Store the detailed object description
|
318 |
workflowState.imageCaption = caption;
|
319 |
console.log('Detailed object description generated:', caption);
|
|
|
302 |
}
|
303 |
|
304 |
try {
|
305 |
+
// Create blob URL directly from the File object
|
306 |
+
const imageUrl = URL.createObjectURL(workflowState.userImage);
|
307 |
+
|
308 |
// Call Joy Caption Alpha Two with correct parameters
|
309 |
const output = await joyCaptionClient.predict([
|
310 |
+
imageUrl, // input_image (as blob URL)
|
311 |
+
"Descriptive", // caption_type
|
312 |
+
"long", // caption_length
|
313 |
+
[], // extra_options
|
314 |
+
"", // name_input
|
315 |
+
"" // custom_prompt
|
316 |
]);
|
317 |
|
318 |
// Joy Caption Alpha Two returns (prompt_str, caption)
|
319 |
const [prompt_str, caption] = output.data;
|
320 |
+
|
321 |
+
// Cleanup blob URL
|
322 |
+
URL.revokeObjectURL(imageUrl);
|
323 |
+
|
324 |
// Store the detailed object description
|
325 |
workflowState.imageCaption = caption;
|
326 |
console.log('Detailed object description generated:', caption);
|