Remove images background
{ "image": "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" }
npm install replicate
import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run cjwbw/rembg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", { input: { image: "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
import replicate
output = replicate.run( "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", input={ "image": "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", "input": { "image": "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{ "completed_at": "2022-11-18T01:02:38.869887Z", "created_at": "2022-11-18T01:01:45.735038Z", "data_removed": false, "error": null, "id": "g6t5gk75n5dzdbroexxahqgs3a", "input": { "image": "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" }, "logs": "Downloading...\nFrom: https://drive.google.com/uc?id=1tCU5MM1LhRgGou5OpmpjBQbSrYIUoYab\nTo: /root/.u2net/u2net.onnx\n 0%| | 0.00/176M [00:00<?, ?B/s]\n 3%|▎ | 4.72M/176M [00:00<00:03, 45.3MB/s]\n 24%|██▍ | 42.5M/176M [00:00<00:00, 229MB/s] \n 39%|███▉ | 69.2M/176M [00:00<00:00, 245MB/s]\n 54%|█████▍ | 94.9M/176M [00:00<00:00, 250MB/s]\n 71%|███████ | 124M/176M [00:00<00:00, 264MB/s] \n 87%|████████▋ | 153M/176M [00:00<00:00, 270MB/s]\n100%|██████████| 176M/176M [00:00<00:00, 261MB/s]", "metrics": { "predict_time": 3.887694, "total_time": 53.134849 }, "output": "https://replicate.delivery/pbxt/2hczaMwD9xrsIR8h3Cl8iYGbHaCdFhIOMZ0LfoYfHlKuuIBQA/out.png", "started_at": "2022-11-18T01:02:34.982193Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/g6t5gk75n5dzdbroexxahqgs3a", "cancel": "https://api.replicate.com/v1/predictions/g6t5gk75n5dzdbroexxahqgs3a/cancel" }, "version": "34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786" }
Downloading... From: https://drive.google.com/uc?id=1tCU5MM1LhRgGou5OpmpjBQbSrYIUoYab To: /root/.u2net/u2net.onnx 0%| | 0.00/176M [00:00<?, ?B/s] 3%|▎ | 4.72M/176M [00:00<00:03, 45.3MB/s] 24%|██▍ | 42.5M/176M [00:00<00:00, 229MB/s] 39%|███▉ | 69.2M/176M [00:00<00:00, 245MB/s] 54%|█████▍ | 94.9M/176M [00:00<00:00, 250MB/s] 71%|███████ | 124M/176M [00:00<00:00, 264MB/s] 87%|████████▋ | 153M/176M [00:00<00:00, 270MB/s] 100%|██████████| 176M/176M [00:00<00:00, 261MB/s]
{ "image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" }
const output = await replicate.run( "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", { input: { image: "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
output = replicate.run( "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", input={ "image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" } ) print(output)
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786", "input": { "image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" } }' \ https://api.replicate.com/v1/predictions
{ "completed_at": "2022-11-18T01:06:26.086928Z", "created_at": "2022-11-18T01:06:23.441986Z", "data_removed": false, "error": null, "id": "simzbeoktbfc3faehoot4ikxii", "input": { "image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" }, "logs": null, "metrics": { "predict_time": 2.607303, "total_time": 2.644942 }, "output": "https://replicate.delivery/pbxt/6Zj9HOeXpgyteE29mbF2zkehIsqenvZV1qffQguaO2sWkMSAE/out.png", "started_at": "2022-11-18T01:06:23.479625Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/simzbeoktbfc3faehoot4ikxii", "cancel": "https://api.replicate.com/v1/predictions/simzbeoktbfc3faehoot4ikxii/cancel" }, "version": "34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786" }
Want to make some of these yourself?
A linear estimator on top of clip to predict the aesthetic quality of pictures
Multilingual Stable Diffusion
a dreambooth model trained on a diverse set of analog photographs
Anime-themed text-to-image stable diffusion model
Audio-Driven Synthesis of Photorealistic Portrait Animations
high-quality, highly detailed anime style stable-diffusion
high-quality, highly detailed anime style stable-diffusion with better VAE
high-quality, highly detailed anime-style Stable Diffusion models
App Icons Generator V1 (DreamBooth Model)
Separate Anything You Describe
Real-Time High-Resolution Background Matting
Colorization using a Generative Color Prior for Natural Images
Pre-trained Subject Representation for Controllable Text-to-Image Generation and Editing
Pre-trained Subject Representation for Controllable Text-to-Image Generation and Editing with ControlNet
Language-Free Training of a Text-to-Image Generator with CLIP
Clip-Guided Diffusion Model for Image Generation
Generates pokemon sprites from prompt
openai/clip-vit-large-patch14 with Transformers
A Visual Language Model for GUI Agents
powerful open-source visual language model
This model is warm. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.