Closed
Description
System Info
Hi,
I have been building an app using the briaai/RMBG-2.0 model. Everything is working fine but I am getting one error.
Error: Unsupported model type: null
And, If I use a previous version of the model like briaai/RMBG-1.4
Error: Unsupported model type: SegformerForSemanticSegmentation
Model Initialization
state.model = await AutoModelForImageSegmentation.from_pretrained(MODEL_ID, {
device: "auto",
progress_callback: (progress: ProgressInfo) => {
if (callback) {
callback(progress);
}
},
});
Next Config
import type { NextConfig } from "next";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const nextConfig: NextConfig = {
webpack: (config) => {
config.resolve.alias["@huggingface/transformers"] = path.resolve(
__dirname,
"node_modules/@huggingface/transformers"
);
config.resolve.alias = {
...config.resolve.alias,
sharp$: false,
"onnxruntime-node$": false,
};
return config;
},
};
export default nextConfig;
Packages
"@huggingface/transformers": "^3.2.1",
"next": "15.1.1",
"react": "^19.0.0",
Environment/Platform
- Website/web-app
- Browser extension
- Server-side (e.g., Node.js, Deno, Bun)
- Desktop app (e.g., Electron)
- Other (e.g., VSCode extension)
Description
The model is loaded correctly but not initialized.
Reproduction
Try to load model briaai/RMBG-2.0 in a Nextjs project on the client side.