Skip to content

feat: add image URL input support#18

Merged
kocabiyik merged 2 commits into
withoutbg:mainfrom
Harsh-2005d:feat/url-input
Apr 16, 2026
Merged

feat: add image URL input support#18
kocabiyik merged 2 commits into
withoutbg:mainfrom
Harsh-2005d:feat/url-input

Conversation

@Harsh-2005d

Copy link
Copy Markdown
Contributor

Description

Adds support for processing images via URL, so users no longer need to download an image before removing its background. This includes backend endpoint changes, a new API helper, and a UI toggle between file upload and URL input.

Type of Change

  • feat - New feature (MINOR version bump)
  • style - Code style/formatting (no version bump)

Breaking Changes

  • This PR includes breaking changes (MAJOR version bump)

The /api/remove-background endpoint is fully backward compatible — file upload still works as before. image_url is an additional optional field.

Checklist

  • My commit messages follow the Conventional Commits format
  • My code follows the project's style guidelines
  • I have updated the documentation (if needed)
  • I have added tests (if needed)
  • All tests are passing locally

Related Issues

Closes #6

Testing

  1. Start the backend — docker run -p 8000:8000 web-backend:latest
  2. Open the UI and switch to the URL tab in the upload zone
  3. Paste any public image URL (e.g. https://example.com/photo.jpg) and click Process
  4. Verify the result panel shows the background-removed image and download works
  5. Switch back to Upload tab and confirm file upload still works as before

To test the backend directly:

curl -X POST http://localhost:8000/api/remove-background \
  -F "image_url=https://example.com/photo.jpg" \
  -F "format=png" \
  --output result.png

Screenshots (if applicable)


📝 Note: When this PR is merged to main, an automated release will be triggered based on your commit messages.
See AUTOMATED_RELEASES.md for details on how versioning works.

@kocabiyik

Copy link
Copy Markdown
Contributor

Hey @Harsh-2005d, this is your second contribution and I really appreciate it! I spend most of my time on model development, so having contributors like you take care of the product side means a lot.

The feature itself looks great, URL input support is something users have been asking for.

There are just some merge conflicts with main that need to be resolved before we can merge. Here's how to fix it:

git fetch upstream
git checkout feat/url-input
git rebase upstream/main
# resolve any conflicts, then:
git push --force-with-lease origin feat/url-input

If you haven't set upstream yet:

git remote add upstream https://github.com/withoutbg/withoutbg.git

Let me know if you run into any trouble, happy to help!

- accept image_url form field in /api/remove-background endpoint
- fetch and validate remote images via httpx with size/type guards
- add removeBackgroundFromUrl helper in api.js
- add Upload/URL tab toggle in RemoveBackground component
- fix mypy type annotations and ruff line length errors

Signed-off-by: Harsh Dahiya <dahiyaharsh2005@gmail.com>
@kocabiyik kocabiyik merged commit 838acc6 into withoutbg:main Apr 16, 2026
5 of 14 checks passed
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.

add support for image url input

2 participants