@xuda.io/ai_module 1.1.3619 → 1.1.3621

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.
Files changed (2) hide show
  1. package/index.mjs +27 -15
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5763,6 +5763,7 @@ export const create_ai_agent_image = async function (req, job_id, headers) {
5763
5763
  const ai_agent_doc = await db_module.get_app_couch_doc_native(app_id, ai_agent_id);
5764
5764
  const account_doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
5765
5765
  let url = account_doc.account_info.profile_avatar;
5766
+
5766
5767
  try {
5767
5768
  if (!url) {
5768
5769
  throw new Error('No URL provided in request');
@@ -5811,21 +5812,32 @@ export const create_ai_agent_image = async function (req, job_id, headers) {
5811
5812
  //////////////////
5812
5813
  imageBase64 = Buffer.from(await images[0].image_blob.arrayBuffer()).toString('base64');
5813
5814
 
5814
- const create_avatar_from_pic = async function () {
5815
- const { first_name, last_name, bio, country, mainCategory, subCategory } = account_obj.account_info;
5816
- const ai_avatar_response = await client.images.edit({
5817
- model: 'chatgpt-image-latest',
5818
- image: images[0].image_blob,
5819
-
5820
- prompt: `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.
5821
- 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.
5822
- Context: ${JSON.stringify({ first_name, last_name, bio, country, mainCategory, subCategory })}`,
5823
- background: 'transparent',
5824
- });
5825
- imageBase64 = ai_avatar_response.data[0].b64_json;
5826
- };
5827
-
5828
- await create_avatar_from_pic();
5815
+ const { first_name, last_name, bio, country, mainCategory, subCategory } = account_obj.account_info;
5816
+ const ai_avatar_response = await client.images.edit({
5817
+ model: 'chatgpt-image-latest',
5818
+ image: images[0].image_blob,
5819
+
5820
+ prompt: `
5821
+ Create a futuristic, profile portrait with a transparent background.
5822
+ make the character look like the person from the provided image with complete metal face hairless ,
5823
+ Center the character facing forward, with subtle top spacing, showing only the head and shoulders.
5824
+ Style the humanoid with functional, minimal attire integrated into its form (such as collars,
5825
+ layered panels, shoulder structures, or fabric-like surfaces), avoiding human fashion tropes.
5826
+ Select exactly ONE accessory category per generation (do not combine):
5827
+ - Head-mounted element (visor, band, halo ring)
5828
+ - Chest or collar element (badge, glyph, embedded tag)
5829
+ - Floating or projected element (holographic symbol, light node)
5830
+ - Structural or partially visible object that reinforces the role Accessories must directly reinforce the identity of "${db_doc.properties.menuName} - ${db_doc.studio_meta.agent_assistant_name}".
5831
+ Use a consistent, fixed color palette across all generations. Do not introduce new colors.
5832
+ All variation must come from geometry, materials, texture, and lighting.
5833
+ Vary at least two of the following:
5834
+ - Head geometry - Surface structure - Material finish
5835
+ - Light interaction Use advanced or reflective materials to convey intelligence and sophistication.
5836
+ The overall composition should symbolize the fusion of human creativity and machine intelligence.
5837
+ `,
5838
+ background: 'transparent',
5839
+ });
5840
+ imageBase64 = ai_avatar_response.data[0].b64_json;
5829
5841
 
5830
5842
  console.log('Normalizing final avatar to 1024 with transparent padding...');
5831
5843
  imageBase64 = await normalizeBase64To1024(imageBase64);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.3619",
3
+ "version": "1.1.3621",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",