@xuda.io/ai_module 1.1.3610 → 1.1.3612
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 +2 -19
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5442,7 +5442,7 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
|
|
|
5442
5442
|
if (prompt) {
|
|
5443
5443
|
const ai_avatar_response = await client.images.edit({
|
|
5444
5444
|
model: 'chatgpt-image-latest', // 'gpt-image-1',
|
|
5445
|
-
image: images[0].image_blob, //
|
|
5445
|
+
image: images[0].image_blob, //base photo
|
|
5446
5446
|
prompt,
|
|
5447
5447
|
background: 'transparent',
|
|
5448
5448
|
});
|
|
@@ -5462,7 +5462,7 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
|
|
|
5462
5462
|
// });
|
|
5463
5463
|
const ai_avatar_response = await client.images.edit({
|
|
5464
5464
|
model: 'chatgpt-image-latest',
|
|
5465
|
-
image: images[0].image_blob, //
|
|
5465
|
+
image: images[0].image_blob, //base photo
|
|
5466
5466
|
prompt: `Create a transparent PNG profile image for a business account featuring building branded as ${business_name}.
|
|
5467
5467
|
Display the attached logo clearly as prominent exterior signage.
|
|
5468
5468
|
The building’s architecture and overall atmosphere should reflect the nature of the business, aligning with ${mainCategory} and ${subCategory}.
|
|
@@ -5512,23 +5512,6 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
|
|
|
5512
5512
|
await create_fictional_avatar();
|
|
5513
5513
|
}
|
|
5514
5514
|
}
|
|
5515
|
-
//////////////
|
|
5516
|
-
// if (images[0].is_transparent && account_obj.account_info.account_type === 'personal') {
|
|
5517
|
-
// imageBase64 = Buffer.from(await images[0].image_blob.arrayBuffer()).toString('base64');
|
|
5518
|
-
// } else {
|
|
5519
|
-
// const { first_name, last_name, bio, business_name, country, mainCategory, subCategory } = account_obj.account_info;
|
|
5520
|
-
// const ai_avatar_response = await client.images.edit({
|
|
5521
|
-
// model: 'chatgpt-image-latest', // 'gpt-image-1',
|
|
5522
|
-
// image: images[0].image_blob, // only one image allowed
|
|
5523
|
-
|
|
5524
|
-
// prompt: `If a real person is detected in the image, completely remove the background, enhance and color-correct the subject, and return only a centered head-and-shoulders portrait facing the camera. Add extra top margin, include no labels or text, and export the result as a clean transparent PNG.
|
|
5525
|
-
// If no person is detected, generate a realistic fictional portrait wearing a hat. The portrait should be centered, head-and-shoulders only, on a transparent background. Place the provided logo on the hat, and ensure the subject is large enough to fill most of the frame. Use the supplied name, country, and context to guide the character’s appearance.
|
|
5526
|
-
// Context: ${JSON.stringify({ first_name, last_name, bio, business_name, country, mainCategory, subCategory })}`,
|
|
5527
|
-
// background: 'transparent',
|
|
5528
|
-
// });
|
|
5529
|
-
// imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
5530
|
-
// }
|
|
5531
|
-
///////////////
|
|
5532
5515
|
}
|
|
5533
5516
|
console.log('Normalizing final avatar to 1024 with transparent padding...');
|
|
5534
5517
|
imageBase64 = await normalizeBase64To1024(imageBase64);
|