@xuda.io/ai_module 1.1.4762 → 1.1.4764
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 +7 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6510,8 +6510,8 @@ const create_ai_agent_image = async function (req, job_id, headers) {
|
|
|
6510
6510
|
const image_blob_ret = await get_image_blob_from_downloaded_image(url);
|
|
6511
6511
|
//////////////////
|
|
6512
6512
|
imageBase64 = Buffer.from(await image_blob_ret.image_blob.arrayBuffer()).toString('base64');
|
|
6513
|
-
|
|
6514
|
-
const model = 'gpt-image-1-mini';
|
|
6513
|
+
const model = 'chatgpt-image-latest';
|
|
6514
|
+
// const model = 'gpt-image-1-mini';
|
|
6515
6515
|
const prompt = `
|
|
6516
6516
|
Create a futuristic, profile portrait with a transparent background.
|
|
6517
6517
|
make the character look like the person from the provided image with complete metal face hairless ,
|
|
@@ -6546,6 +6546,11 @@ const create_ai_agent_image = async function (req, job_id, headers) {
|
|
|
6546
6546
|
console.log('Normalizing final avatar to 1024 with transparent padding...');
|
|
6547
6547
|
imageBase64 = await normalizeBase64To1024(imageBase64);
|
|
6548
6548
|
|
|
6549
|
+
// imageBase64 = await normalizeBase64To1024(imageBase64, {
|
|
6550
|
+
// fit: 'contain', // Preserve aspect ratio, fit within 211x211
|
|
6551
|
+
// background: { r: 0, g: 0, b: 0, alpha: 0 }, // Transparent background for padding
|
|
6552
|
+
// });
|
|
6553
|
+
|
|
6549
6554
|
const outputBuffer = Buffer.from(imageBase64, 'base64');
|
|
6550
6555
|
const outputPath = tempOutputPath;
|
|
6551
6556
|
await fs.promises.writeFile(outputPath, outputBuffer);
|