Leonardo-Interactive / leonardo-python-sdk

MIT License
17 stars 6 forks source link

Error generating an image with SDXL models #6

Open lpalombo opened 10 months ago

lpalombo commented 10 months ago

It looks like the class defining SdVersions has not been updated to accommodate the new models available on the API!

Minimum Reproduction:

import leonardoaisdk
from leonardoaisdk.models import operations, shared

sdk = leonardoaisdk.LeonardoAiSDK(bearer_auth=LEONARDO_API_KEY)

req = operations.CreateGenerationRequestBody(
    prompt="a painting of a cat",
    model_id="5c232a9e-9061-4777-980a-ddc8e65647c6", # id for Leonardo Vision XL
    guidance_scale=7,
    width=512,
    height=512,
    nsfw=False,
    num_images=2,
    photo_real=False,
)

res = sdk.generation.create_generation(req)

generation_id = res.object.sd_generation_job.generation_id

sdk.generation.get_generation_by_id(id=generation_id)

Error Received:

Exception: Failed to get generation by ID on Leonardo: 'SDXL_0_9' is not a valid SdVersions
mecsantos commented 9 months ago

Hey @lpalombo, are you still blocked, even with the latest version? If yes, I'll open a support case for you with Leonardo.