Fraser commited on
Commit
7b83f61
·
1 Parent(s): 644e066
src/lib/components/PicletGenerator/PicletGenerator.svelte CHANGED
@@ -302,22 +302,15 @@ Focus on: colors, body shape, eyes, limbs, mouth, and key visual features. Omit
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
317
- "", // name_input
318
- "" // custom_prompt
319
- ]);
320
-
321
  const [prompt, caption] = output.data;
322
  // Store the detailed object description
323
  workflowState.imageCaption = caption;
 
302
  }
303
 
304
  try {
305
+ const output = await joyCaptionClient.predict({
306
+ input_image: workflowState.userImage,
307
+ caption_type: "Descriptive",
308
+ caption_length: "long",
309
+ extra_options: [],
310
+ name_input: "",
311
+ custom_prompt: ""
312
  });
313
 
 
 
 
 
 
 
 
 
 
314
  const [prompt, caption] = output.data;
315
  // Store the detailed object description
316
  workflowState.imageCaption = caption;