{"id":13457322,"url":"https://github.com/kevmo314/magic-copy","last_synced_at":"2025-05-15T10:05:25.545Z","repository":{"id":152584721,"uuid":"624716259","full_name":"kevmo314/magic-copy","owner":"kevmo314","description":"Magic Copy is a Chrome extension that uses Meta's Segment Anything Model to extract a foreground object from an image and copy it to the clipboard.","archived":false,"fork":false,"pushed_at":"2024-05-06T20:41:13.000Z","size":34532,"stargazers_count":2467,"open_issues_count":24,"forks_count":154,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-14T16:54:16.926Z","etag":null,"topics":["chrome-extension","computer-vision","image-processing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevmo314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-07T04:59:51.000Z","updated_at":"2025-04-13T15:12:09.000Z","dependencies_parsed_at":"2024-06-19T03:02:43.723Z","dependency_job_id":"740319e2-9a6b-474f-b617-f0e5aa769ff2","html_url":"https://github.com/kevmo314/magic-copy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevmo314%2Fmagic-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevmo314%2Fmagic-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevmo314%2Fmagic-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevmo314%2Fmagic-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevmo314","download_url":"https://codeload.github.com/kevmo314/magic-copy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319716,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-extension","computer-vision","image-processing"],"created_at":"2024-07-31T08:01:39.762Z","updated_at":"2025-05-15T10:05:20.409Z","avatar_url":"https://github.com/kevmo314.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Recent Works","Open Source Projects","Repos","Application"],"sub_categories":["Follow-up Papers","Image Generation"],"readme":"# Magic Copy\n\nMagic Copy is a Chrome extension that uses Meta's [Segment Anything Model](https://segment-anything.com/) to extract a foreground object from an image and copy it to the clipboard.\n\nhttps://user-images.githubusercontent.com/511342/234897336-f2441e00-06e0-4ca8-9b97-601210879cdb.mp4\n\n## Installation\n\n[![Available on the Chrome Web Store](https://storage.googleapis.com/web-dev-uploads/image/WlD8wC6g8khYWPJUsQceQkhXSlv1/UV4C4ybeBTsZt43U4xis.png)](https://chrome.google.com/webstore/detail/nnifclicibdhgakebbnbfmomniihfmkg)\n\n[![Available on the Firefox Add-ons Store](https://extensionworkshop.com/assets/img/documentation/publish/get-the-addon-178x60px.dad84b42.png)](https://addons.mozilla.org/en-US/firefox/addon/magic-copy/)\n\n(This might not be available yet, as the extension is still in review. If you would like to be notified when they do, subscribe to the [Chrome](https://github.com/kevmo314/magic-copy/issues/16) or [Firefox](https://github.com/kevmo314/magic-copy/issues/17) issues.)\n\nAlternatively, the extension can be installed manually:\n\n1. Download the latest `magic-copy.zip` from [releases](https://github.com/kevmo314/magic-copy/releases).\n2. Extract the ZIP file.\n3. In Chrome, go to `chrome://extensions/`, enable \"Developer mode\", and click \"Load unpacked\".\n4. Select the folder where the extension was extracted.\n\n### Figma\n\nMagic Copy is also available as a [Figma plugin](https://www.figma.com/community/plugin/1234171506421686729).\n\n## Implementation\n\nThis extension uses the same procedure as the [Segment Anything Model demo](https://segment-anything.com/demo) to extract a foreground object from an image. The only difference is that the extracted object is copied to the clipboard instead of being displayed on the page.\n\n## Building\n\n### Manually\n\nBuild the extension with `npm` and then run the included `./buildcrx.sh` script to generate the `crx` file:\n\n```sh\nnpm ci\nnpm run build\n./buildcrx.sh -d dist\n```\n\n### Docker\n\nA `Dockerfile` is provided to cleanly build the `crx` file. To build the extension, run:\n\n```sh\ndocker build --output out .\n```\n\n## Self-hosting\n\nThe Meta Segment Anything Model requires running the vision transformer on a server\nto generate the image's embeddings. Magic Copy uses the same service that their\ndemo uses, however some people may not want to send their images to a third party.\n\nThe `server-example` directory contains a simple example of how to self-host the\nvision transformer service. It is not meant to be used in production, but rather as\na proof of concept to document the input/output format of the service.\n\nIn particular, Magic Copy (and the SAM demo) expect a POST endpoint that accepts\nan image file and returns a JSON array of length 1 with the embedding of shape\n`(1, 256, 64, 64)` as a base64 encoded string. See the code for specific details on how\nto perform this encoding to be compatible with the demo.\n\nIf you are looking to quickly get the service running, you can use the provided\n`Dockerfile` to build a container and run it. The container will expose port 8000\nand will serve the service at the `/` endpoint.\n\n```bash\ndocker build -t segment-anything .\ndocker run --gpus all -p 8000:8000 segment-anything\n```\n\nIn the Magic Copy chrome extension, you can then change the endpoint to `http://localhost:8000/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevmo314%2Fmagic-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevmo314%2Fmagic-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevmo314%2Fmagic-copy/lists"}