try url
Browse files
src/lib/components/PicletGenerator/PicletGenerator.svelte
CHANGED
@@ -302,8 +302,15 @@ Focus on: colors, body shape, eyes, limbs, mouth, and key visual features. Omit
|
|
302 |
}
|
303 |
|
304 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
const output = await joyCaptionClient.predict(0, [
|
306 |
-
|
307 |
"Descriptive", // caption_type
|
308 |
"long", // caption_length
|
309 |
[], // extra_options
|
|
|
302 |
}
|
303 |
|
304 |
try {
|
305 |
+
// Convert File to data URL for Gradio
|
306 |
+
const imageDataUrl = await new Promise((resolve) => {
|
307 |
+
const reader = new FileReader();
|
308 |
+
reader.onload = () => resolve(reader.result);
|
309 |
+
reader.readAsDataURL(workflowState.userImage);
|
310 |
+
});
|
311 |
+
|
312 |
const output = await joyCaptionClient.predict(0, [
|
313 |
+
imageDataUrl, // input_image as data URL
|
314 |
"Descriptive", // caption_type
|
315 |
"long", // caption_length
|
316 |
[], // extra_options
|