@xuda.io/account_module 1.2.269 → 1.2.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +14 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1555,11 +1555,19 @@ export const get_user_name = async function (uid) {
|
|
|
1555
1555
|
};
|
|
1556
1556
|
|
|
1557
1557
|
const removeBg = async function (req, job_id, headers) {
|
|
1558
|
-
const ASSET_PATH = path.join(process.cwd(), 'assets/imgly-bg');
|
|
1559
|
-
const config = {
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
};
|
|
1558
|
+
// const ASSET_PATH = path.join(process.cwd(), 'assets/imgly-bg');
|
|
1559
|
+
// const config = {
|
|
1560
|
+
// publicPath: `file://${ASSET_PATH}/`, // Points to your local folder
|
|
1561
|
+
// debug: true, // Optional: Logs fetch attempts for debugging
|
|
1562
|
+
// };
|
|
1563
|
+
|
|
1564
|
+
const ASSET_PATH = '/var/xuda/assets/imgly-bg'; // <-- your folder
|
|
1565
|
+
|
|
1566
|
+
const config = {
|
|
1567
|
+
publicPath: `file://${ASSET_PATH}/`, // ← this fixes everything
|
|
1568
|
+
debug: false,
|
|
1569
|
+
model: "medium" as const, // or "small" if you want faster/smaller
|
|
1570
|
+
};
|
|
1563
1571
|
debugger;
|
|
1564
1572
|
const drive_module = await import(`${module_path}/drive_module/index.mjs`);
|
|
1565
1573
|
const { url } = req;
|
|
@@ -1577,7 +1585,7 @@ const removeBg = async function (req, job_id, headers) {
|
|
|
1577
1585
|
const arrayBuffer = await res.arrayBuffer();
|
|
1578
1586
|
imageBuffer = Buffer.from(arrayBuffer);
|
|
1579
1587
|
}
|
|
1580
|
-
const blob = await removeBackground(imageBuffer);
|
|
1588
|
+
const blob = await removeBackground(imageBuffer, config);
|
|
1581
1589
|
|
|
1582
1590
|
// Convert to buffer and save
|
|
1583
1591
|
const outputBuffer = Buffer.from(await blob.arrayBuffer());
|