@xuda.io/ai_module 1.1.4444 → 1.1.4446
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 +19 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6441,7 +6441,15 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6441
6441
|
const uniqueId = Date.now() + '_' + Math.random().toString(36).substring(7);
|
|
6442
6442
|
const tempOutputPath = path.join(tempDir, `output_${uniqueId}.png`);
|
|
6443
6443
|
|
|
6444
|
-
let prompt,
|
|
6444
|
+
let prompt,
|
|
6445
|
+
factual_prompt,
|
|
6446
|
+
originalname,
|
|
6447
|
+
factual_image_mode,
|
|
6448
|
+
imageBase64,
|
|
6449
|
+
image_blob_ret,
|
|
6450
|
+
file,
|
|
6451
|
+
profile_picture_source,
|
|
6452
|
+
resize = {};
|
|
6445
6453
|
|
|
6446
6454
|
switch (account_type) {
|
|
6447
6455
|
case 'personal': {
|
|
@@ -6450,6 +6458,11 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6450
6458
|
facts,
|
|
6451
6459
|
)}" and create realistic fictional profile picture transparent background ,person in the center of the picture add top margin the person should cover the whole picture`;
|
|
6452
6460
|
originalname = normalizeFilename(name) + '_xu_profile.png';
|
|
6461
|
+
resize = {
|
|
6462
|
+
fit: 'inside', // Scale up/down to fit inside 1024×1024 while preserving aspect ratio
|
|
6463
|
+
withoutEnlargement: false, // Allow enlargement if original is smaller
|
|
6464
|
+
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
|
6465
|
+
};
|
|
6453
6466
|
break;
|
|
6454
6467
|
}
|
|
6455
6468
|
|
|
@@ -6457,6 +6470,11 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6457
6470
|
prompt = `find "${name}" icon/logo, Return only png,jpg image url single result e.g: "https://example.com/logo_image.png", nothing else`;
|
|
6458
6471
|
factual_prompt = `create logo for the company named: "${name}" the logo should only be initials of the name or geometric shape`;
|
|
6459
6472
|
originalname = normalizeFilename(name) + '_xu_logo.png';
|
|
6473
|
+
resize = {
|
|
6474
|
+
fit: 'cover', // Fill the 1024×1024 area (may crop edges)
|
|
6475
|
+
position: 'centre', // Center the crop
|
|
6476
|
+
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
|
6477
|
+
};
|
|
6460
6478
|
break;
|
|
6461
6479
|
}
|
|
6462
6480
|
|
|
@@ -6474,7 +6492,6 @@ export const get_profile_picture = async function (uid, account_type = 'business
|
|
|
6474
6492
|
account_profile_info,
|
|
6475
6493
|
tools: [{ type: 'web_search_preview' }],
|
|
6476
6494
|
});
|
|
6477
|
-
// console.log('=============', ret);
|
|
6478
6495
|
|
|
6479
6496
|
return ret.data;
|
|
6480
6497
|
};
|