Leonardo-Interactive / leonardo-ts-sdk

Typescript SDK for Leonardo AI
MIT License
52 stars 16 forks source link

Phoenix request requires sd_version to be "PHOENIX" (don't have this option in latest package) #86

Closed Rot4tion closed 1 month ago

Rot4tion commented 1 month ago

@leonardo-ai/sdk 4.16.0

req:

leonardoai.createGeneration({
  alchemy: true,
  height: 896,
  modelId: '6b645e3a-d64f-4341-a6d8-7a3690fbf042',
  num_images: 1,
  presetStyle: 'LEONARDO',
  prompt: 'The design features a humorous ghost with an unimpressed expression, crossed arms, and the text "THIS IS BOO SHEET" above it in a bold, distressed font. The background consists of a retro-style, faded, sunset color palette with horizontal stripes, adding a vintage aesthetic. The ghost illustration has a distressed texture to complement the worn-out, vintage look of the design. The overall tone is playful and sarcastic, suitable for Halloween or humorous apparel.\' }',
  width: 896,
  scheduler: 'LEONARDO',
  sd_version: 'SDXL_LIGHTNING'
})
  .then(({ data }) => console.log(data))
  .catch(err => console.error(err));

res:

  {
  "error": "Phoenix request requires sd_version to be PHOENIX.",
  "path": "$",
  "code": "unexpected"
}

sd_version don't have PHOENIX option Tried:

pcintra11 commented 1 month ago

Ii have the same problem.

mecsantos commented 1 month ago

Hi @Rot4tion @pcintra11 , please try not specifying sd_version. If you specify the model, no need to specify sd_version.

dankiCodeBusiness commented 1 month ago

Same problem here, and I'm not specifying the sdkVersion

peace-furniture commented 1 month ago

@mecsantos Omitting sd_version allows createGeneration request to succeed. However retrieving the image using getGenerationById fails with the same error as OP. The npm package needs to be updated. When is that expected to happen?

If this takes too long, we're switching to a Flux host.

mecsantos commented 1 month ago

Hi @peace-furniture , the only input for getting image generation by ID should be just the generation ID.

In terms of an update, it's a holiday in Australia today. We'll flag to engineering this week and will keep you posted on timing.

This was open for a week because we don't monitor issues here. We probably only noticed when it got flagged via support@leonardo.ai.

We are happy to process refunds, just kindly send this thread via our support. We apologize for the trouble and delay in your development.

peace-furniture commented 1 month ago

Thanks @mecsantos for the quick reply. I'm passing in only the task ID to retrieve the image. The Node SDK might be adding more in, but I can't control that. It looks like the issue is that the response contains PHOENIX which isn't in the library's enum list, throwing an exception.

    const progressResult = await leoClient.image.getGenerationById(taskId as string);
silvamarcel commented 1 month ago

Hey @peace-furniture, @Rot4tion and @pcintra11, I will be publishing a fix to add the missing type soon.

ronvoluted commented 1 month ago

@Rot4tion, @pcintra11, @dankiCodeBusiness and @peace-furniture please find @silvamarcel's changes in version 4.18.1.

peace-furniture commented 1 month ago

Thank you @ronvoluted @silvamarcel for publishing the update. It works great!

pcintra11 commented 1 month ago

Works now! Tks!

silvamarcel commented 1 month ago

Closing the issue for now, if anything comes up, please reach out to us.