Skip to content

fix:docker build failed without these changes - #625

Open
hschinmayabharadwaj wants to merge 1 commit into
abi:mainfrom
hschinmayabharadwaj:enhancement/image-tool-concurrency
Open

fix:docker build failed without these changes#625
hschinmayabharadwaj wants to merge 1 commit into
abi:mainfrom
hschinmayabharadwaj:enhancement/image-tool-concurrency

Conversation

@hschinmayabharadwaj

Copy link
Copy Markdown

Main Problems Fixed:

  1. Uncontrolled Concurrency - Added IMAGE_TOOL_BATCH_SIZE = 20 to prevent API rate limits
    when processing many images simultaneously
  2. Incorrect Semantics - Changed from applying one prompt to multiple images (edit_image)
    to independent edits with their own prompts (edit_images). This ensures each image gets
    appropriate instructions.
  3. Result Ordering - Implemented explicit order preservation so results match input order,
    fixing frontend display issues
  4. Poor Error Handling - One failed image no longer breaks the entire batch. Errors are
    caught individually and processing continues
  5. Local Asset Support - Automatic conversion of local asset URLs to data URLs for
    providers that can't access localhost

Technical Changes:

  • remove_background() → remove_backgrounds() with batching
  • edit_image() → edit_images() with restructured schema (array of edits)
  • Renamed core functions to remove_background_once() and edit_image_once()
  • Updated frontend to display parallel operations correctly
  • Added comprehensive batching tests

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.

1 participant