Remove-Background-ai/rembg.js

Internal server error (500)

Keito-Klein opened this issue · 6 comments

bandicam 2023-07-22 21-58-16-944

Sir that's my code and i got the error:

bandicam 2023-07-22 22-09-53-090

how to solve it?

Hi thanks for your report!
This should not happen, I will get back to you in 2h (aprox).
I would speculate that the backend hit his max connection..

Hi sorry for late reply, I could reproduce the issue will get back to you very soon

Hi thanks for your report! This should not happen, I will get back to you in 2h (aprox). I would speculate that the backend hit his max connection..

did it happen because my apikey was wrong? but i copied and pasted my apikey correctly.

I have tested this one and it worked just fine.
However in my initial test I was able to reproduce the issue, it seems like you were connected to one of the instances that had a crash, I will check my server logs and come back later.

Can you try it on your end again for now?

// script.mjs file

import { rembg } from '@remove-background-ai/rembg.js';
import dotenv from 'dotenv';
// Load environment variables from .env file
dotenv.config();

// API_KEY will be loaded from the .env file
const API_KEY = 'fc1a182a-xxxx-xxxx-a477-6aa7eeab33a1';

// log upload and download progress
const onDownloadProgress = console.log;
const onUploadProgress = console.log;

rembg({
    apiKey: API_KEY,
    inputImagePath: './input.jpg',
    onDownloadProgress,
    onUploadProgress
}).then(({ outputImagePath, cleanup }) => {
    console.log(`✅🎉 background removed and saved under path=${outputImagePath}`);
    // if called, it will cleanup (remove from disk) your removed background image
    // cleanup();
});
image

@Keito-Klein were you able to make it running?

let us know if you need support.

best regards

closing due to inactivity, feel free to re-open if you still has issue, thanks