@xuda.io/ai_module 1.1.4747 → 1.1.4749
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 +48 -25
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6122,28 +6122,50 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6122
6122
|
// });
|
|
6123
6123
|
// account_module.record_ai_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { profile_picture }, account_profile_info);
|
|
6124
6124
|
// imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
6125
|
-
if (
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6125
|
+
if (is_user) {
|
|
6126
|
+
if (business_has_person) {
|
|
6127
|
+
} else {
|
|
6128
|
+
const ai_avatar_response = await client.images.edit({
|
|
6129
|
+
model,
|
|
6130
|
+
image: image_blob_ret.image_blob, //logo
|
|
6131
|
+
prompt: `
|
|
6132
|
+
Create a transparent PNG profile image for a business account featuring building branded as ${name}.
|
|
6133
|
+
Display the attached logo clearly as prominent exterior signage.
|
|
6134
|
+
|
|
6135
|
+
show ${obj?.[business_size] || 'office building'}
|
|
6136
|
+
The building’s architecture and overall atmosphere should reflect the nature of the business,
|
|
6137
|
+
aligning with ${mainCategory} and ${subCategory}.
|
|
6138
|
+
|
|
6139
|
+
Use the provided bio (${bio}) to understand the company’s focus and personality, and adapt the architectural style to match the ${country} country’s local design language. Select an appropriate building type for the specific business category, and present a contemporary, creative office environment with a strong, recognizable brand identity.
|
|
6140
|
+
The background should be fully removed, remove trees,clouds,sky or any landscape objects`,
|
|
6141
|
+
background: 'transparent',
|
|
6142
|
+
});
|
|
6143
|
+
account_module.record_ai_usage(uid, ai_avatar_response.usage.input_tokens, ai_avatar_response.usage.output_tokens, 'profile avatar', prompt, model, { profile_picture }, account_profile_info);
|
|
6144
|
+
imageBase64 = ai_avatar_response.data[0].b64_json;
|
|
6145
|
+
}
|
|
6146
|
+
} else {
|
|
6147
|
+
if (business_has_person) {
|
|
6148
|
+
imageBase64 = await create_image(
|
|
6149
|
+
uid,
|
|
6150
|
+
`
|
|
6129
6151
|
analyze the the person info : name:${name || ''}, person_nationality: ${person_nationality}
|
|
6130
6152
|
and create realistic fictional profile picture
|
|
6131
6153
|
transparent background ,
|
|
6132
6154
|
person in the center of the picture return only a centered head-and-shoulders portrait facing the camera.
|
|
6133
6155
|
include no labels or text add top margin the person should cover the whole picture
|
|
6134
6156
|
`,
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6157
|
+
model,
|
|
6158
|
+
undefined,
|
|
6159
|
+
1,
|
|
6160
|
+
undefined,
|
|
6161
|
+
undefined,
|
|
6162
|
+
{},
|
|
6163
|
+
account_profile_info,
|
|
6164
|
+
);
|
|
6165
|
+
} else {
|
|
6166
|
+
imageBase64 = await create_image(
|
|
6167
|
+
uid,
|
|
6168
|
+
`
|
|
6147
6169
|
Create a transparent PNG profile image show realistic ${obj?.[business_size]} without labels or signs.
|
|
6148
6170
|
The building’s architecture, materials, and overall atmosphere must reflect the business nature,
|
|
6149
6171
|
aligned with ${mainCategory} and ${subCategory}.
|
|
@@ -6151,16 +6173,17 @@ export const get_profile_avatar = async function (profile_picture, uid, prompt,
|
|
|
6151
6173
|
Do not include trees, clouds, sky, landscape, or any environmental elements.
|
|
6152
6174
|
Only the building should be visible on a fully transparent background.
|
|
6153
6175
|
`,
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6176
|
+
model,
|
|
6177
|
+
undefined,
|
|
6178
|
+
1,
|
|
6179
|
+
undefined,
|
|
6180
|
+
undefined,
|
|
6181
|
+
{},
|
|
6182
|
+
account_profile_info,
|
|
6183
|
+
);
|
|
6184
|
+
}
|
|
6185
|
+
avatar_source = 'fictional';
|
|
6162
6186
|
}
|
|
6163
|
-
avatar_source = 'fictional';
|
|
6164
6187
|
} else {
|
|
6165
6188
|
/// PERSONAL
|
|
6166
6189
|
const create_avatar_from_pic = async function () {
|