Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initial support for Amazon Nova Canvas model #7838

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

omrishiv
Copy link

Title

Add initial support for Amazon Nova Canvas image generation

Relevant issues

Type

🆕 New Feature

Changes

  • Adds Nova Canvas model to provider list and adds supporting transformations for Bedrock

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

Added new test TestBedrockNova
image

Copy link

vercel bot commented Jan 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 4:31am

@krrishdholakia
Copy link
Contributor

@omrishiv can you share a screenshot of it passing your testing

@omrishiv
Copy link
Author

@krrishdholakia is there not one attached to the text? If you look at the bottom you’ll see the test name and it passing.

"""
No additional OpenAI params are mapped for Nova
"""
return []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does amazon nova not support any openai image gen params?

if you could link me to their optional params that would help

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageGenerationConfig":{"cfgScale":8,"seed":42,"quality":"standard","width":1280,"height":720,"numberOfImages":3}

i see:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m happy to convert those to the Nova ones, I’ll update for that

"""
Map the OpenAI params to the Bedrock params

No OpenAI params are mapped for Nova, so directly return the optional_params
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omrishiv could you please map the params listed above.

this also needs to be be used here -

elif custom_llm_provider == "bedrock":

width, height = _size.split("x")
width, height = int(width), int(height)
number_of_images = non_default_params.get("n", 1)
quality = "premium" if non_default_params.get("quality") == "premium" else "standard"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it also handle the openai equivalent value - hd

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize, I now understand what this is doing. Can you clarify if intend for this to only handle openAI API parameters or if it should work for both? As in, would I expect quality premium|hd is premium or if we are only handling the openAI ones

Signed-off-by: omrishiv <[email protected]>
@omrishiv
Copy link
Author

I've added the rest of the image generation tasks:

  • text_image with image conditioning
  • color guided image generation
  • image variation
  • inpainting
  • outpainting
  • background removal

I'll push the changes soon

Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
@omrishiv
Copy link
Author

@krrishdholakia when you have a moment, can you please take a look at this again. I added all of the image generation tasks and tests for all of them. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants