Skip to content

fix(generate_image): updating generate_image tool to support additional models in Amazon Bedrock #89

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

Merged
merged 9 commits into from
Jun 26, 2025

Conversation

cerashdan
Copy link
Contributor

@cerashdan cerashdan commented Jun 17, 2025

Description

The model currently used in generate_image tool has a hard-coded region for us-west-2. The model is no longer available in that region. The model is also being phased out of Amazon Bedrock.

This PR will focus on the generate image tool to include the latest supported image generation models and their parameters. The fix has implemented support for all Stable Diffusion and Nova Canvas models.

Related Issues

This will fix issue #75

Documentation PR

This will ensure that PR for multi modal examples is operating as expected- strands-agents/docs#93

Type of Change

  • Bug fix
  • New Tool
  • Breaking change
  • Other (please describe):

Testing

  1. Unit tests, formatter and linters has passed.
  2. Generated 4 invocation to models in scope - generating images using (Nova Canvas, SD Ultra, SD Core and SD 3.5).
  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all

Checklist

  • I have read the CONTRIBUTING document

  • I have added tests that prove my fix is effective or my feature works

  • I have updated the documentation accordingly

  • I have added an appropriate example to the documentation to outline the feature

  • My changes generate no new warnings

  • Any dependent changes have been merged and published

  • By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sorry, something went wrong.

@cerashdan cerashdan requested a review from a team as a code owner June 17, 2025 16:05
@cerashdan cerashdan changed the title switching region to us-east-1 as sdxl model is no longer available in… Updating generate_image tool to support additional models in Amazon Bedrock Jun 18, 2025
cerashdan and others added 2 commits June 18, 2025 23:43
Fix image generation functionality by adding support for Amazon Nova Canvas model in addition to existing Stable Diffusion models. This enhancement allows users to generate images using both model types with appropriate parameters.
@cerashdan
Copy link
Contributor Author

The fix has been implemented and the current update to the branch supports all latest Stable Diffusion models (SD Ultra, SD Core and 3.5) and Nova Canvas.

Tests has been updated accordingly.

The current implementation defaults to SD Core which is the successor of SDXL that was phased out.

@zastrowm could you please review and merge the PR?

@cerashdan cerashdan changed the title Updating generate_image tool to support additional models in Amazon Bedrock fix(gen_image): updating generate_image tool to support additional models in Amazon Bedrock Jun 19, 2025
@cerashdan cerashdan requested a review from zastrowm June 22, 2025 17:21
@cerashdan cerashdan changed the title fix(gen_image): updating generate_image tool to support additional models in Amazon Bedrock fix(generate_image): updating generate_image tool to support additional models in Amazon Bedrock Jun 24, 2025
cerashdan and others added 3 commits June 25, 2025 16:56
Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com>
Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com>
@cerashdan cerashdan requested a review from zastrowm June 25, 2025 22:25
@zastrowm zastrowm merged commit d52cc4e into strands-agents:main Jun 26, 2025
14 of 28 checks passed
jimbrub added a commit to jimbrub/tools that referenced this pull request Jul 15, 2025
author James Brubaker <jimmybrubaker@live.com> 1750079629 -0400
committer James Brubaker <jimmybrubaker@live.com> 1752586952 -0400

* test(memory): add an end-to-end integration test

* test: refactor code to be more readable

---------

Co-authored-by: Jack Yuan <jackypc@amazon.com>

fix(generate_image): updating generate_image tool to support additional models in Amazon Bedrock (strands-agents#89)

* switching region to us-east-1 as sdxl model is no longer available in us-west-2

* fix(image-gen): add support for Amazon Nova Canvas

Fix image generation functionality by adding support for Amazon Nova Canvas model in addition to existing Stable Diffusion models. This enhancement allows users to generate images using both model types with appropriate parameters.

* fix(gen_image): region selection and number of images parmaters

* fix: updating toolspec to include region id and remove number of images parameter (defaulting the tool to generate one image always

* fix(generate_image): update the tool to initial state where it only support stable diffusion models

* Update src/strands_tools/generate_image.py

Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com>

* fix(generate_image): removing conditional for model specific

* Update src/strands_tools/generate_image.py

Add end to end test for read, write, edit tools (strands-agents#100)

* test(read_write_edit): add end to end tests for these tools

---------

Co-authored-by: Jack Yuan <jackypc@amazon.com>

test(generate_read_image): add end to end tests for image tools (strands-agents#107)

Co-authored-by: Jack Yuan <jackypc@amazon.com>

feat: migrate editor tool from TOOL_SPEC to @tool decorator (strands-agents#111)

Adding use_computer tool

fix: Updating readme with fix for use_browser tool

fix: replace colorama with rich's native styling in use_aws tool (strands-agents#118)

* fix: replace colorama with rich's native styling in use_aws tool

- Replace colorama Fore/Style with rich Table for better UI rendering
- Add structured table layout for AWS operation details
- Improve visual consistency with other rich-based tools
- Remove colorama dependency from use_aws module
- Fixes strands-agents#35: use_aws tool rich UI rendering issues

* chore: remove colorama dependency from pyproject.toml

- No longer needed after replacing colorama with Rich native styling
- Fixes Rich panel border rendering issues when mixing ANSI sequences
- Part of use-aws Rich UI rendering improvements

---------

Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>

Add stability tool (strands-agents#101)

Adds a tool that will create images using the Stability AI Platform + related documentation

feat: updating README.md with information about use_computer

test(http_request): add integration test for http_request tool (strands-agents#113)

* test(http_request): add integration test for http_request tool

* test(http_request): use self host server to handle the tests, fix mem0 unit test fail when user has faiss installed

---------

Co-authored-by: Jack Yuan <jackypc@amazon.com>

fix: Fixing optional dependencies for use_browser tool (strands-agents#119)

* fix: Fixing optional dependencies for use_browser tool

* fix: Fixing optional dependencies for use_browser tool

* fix: Updating readme with fix for use_browser tool

fix: fixing dependencies and merging with main branch

feat(a2a): native client tool (strands-agents#108)

Co-authored-by: jer <jerebill@amazon.com>

refactor(a2a): rename dependency target and update docs (strands-agents#125)

Co-authored-by: jer <jerebill@amazon.com>

adding code to delete screenshots taken by use_computer

adding pytesseract dependency as optional
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.

None yet

2 participants