cjwbw / rembg
Remove images background
Want to make some of these yourself?
Run this modelRemove 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
Run cjwbw/rembg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
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.
Run cjwbw/rembg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
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.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/cjwbw/rembg@sha256:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786 \
-i 'image="https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg"'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/cjwbw/rembg@sha256:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/Ho28olmw8dnOffOz7yjuPK6UGsOPqFUfpCnq1ur8zaAKxiPH/animal-1.jpeg" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
{
"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"
}
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/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);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
import replicate
Run cjwbw/rembg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/rembg:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786",
input={
"image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
Run cjwbw/rembg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
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
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/cjwbw/rembg@sha256:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786 \
-i 'image="https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg"'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/cjwbw/rembg@sha256:34bd50c3cdcf667a839abdcdde7201d5b39bbebb54aa037da542ee6e670d9786
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/Ho2DCxhF0FUFCCbW1xEdrgTQfIrbX4769tifxUdXpZET2f0y/girl-2.jpeg" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
{
"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?
Run this modelThis 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.
This model runs on L40S. View more.
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]