@sogni-ai/sogni-intelligence-client 3.10.0 → 3.11.0

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 (34) hide show
  1. package/dist/contracts/data/promptContracts.d.ts.map +1 -1
  2. package/dist/contracts/data/promptContracts.js +19 -8
  3. package/dist/contracts/data/promptContracts.js.map +1 -1
  4. package/dist/media/imageEditRouting.d.ts +22 -0
  5. package/dist/media/imageEditRouting.d.ts.map +1 -0
  6. package/dist/media/imageEditRouting.js +62 -0
  7. package/dist/media/imageEditRouting.js.map +1 -0
  8. package/dist/media/index.d.ts +1 -0
  9. package/dist/media/index.d.ts.map +1 -1
  10. package/dist/media/index.js +1 -0
  11. package/dist/media/index.js.map +1 -1
  12. package/dist/openai-tools/_manifests.generated.d.ts.map +1 -1
  13. package/dist/openai-tools/_manifests.generated.js +16 -10
  14. package/dist/openai-tools/_manifests.generated.js.map +1 -1
  15. package/dist/openai-tools/generation-tools.json +16 -10
  16. package/dist/schemas/tools/edit_image.schema.json +9 -7
  17. package/dist/schemas/tools/generate_image.schema.json +11 -7
  18. package/dist/tools/definitions/edit-image/definition.d.ts.map +1 -1
  19. package/dist/tools/definitions/edit-image/definition.js +5 -3
  20. package/dist/tools/definitions/edit-image/definition.js.map +1 -1
  21. package/dist-esm/contracts/data/promptContracts.js +19 -8
  22. package/dist-esm/contracts/data/promptContracts.js.map +1 -1
  23. package/dist-esm/media/imageEditRouting.js +55 -0
  24. package/dist-esm/media/imageEditRouting.js.map +1 -0
  25. package/dist-esm/media/index.js +1 -0
  26. package/dist-esm/media/index.js.map +1 -1
  27. package/dist-esm/openai-tools/_manifests.generated.js +16 -10
  28. package/dist-esm/openai-tools/_manifests.generated.js.map +1 -1
  29. package/dist-esm/openai-tools/generation-tools.json +16 -10
  30. package/dist-esm/schemas/tools/edit_image.schema.json +9 -7
  31. package/dist-esm/schemas/tools/generate_image.schema.json +11 -7
  32. package/dist-esm/tools/definitions/edit-image/definition.js +5 -3
  33. package/dist-esm/tools/definitions/edit-image/definition.js.map +1 -1
  34. package/package.json +3 -3
@@ -4,7 +4,7 @@ export const definition = {
4
4
  type: 'function',
5
5
  function: {
6
6
  name: 'edit_image',
7
- description: 'Generate images guided by reference photos. Supports GPT Image 2 up to 16 images, Flux.2 up to 6 images, Qwen up to 3 images, and Krea 2 Identity Edit / Dark Beast Krea 2 Identity Edit up to 2 images. Best for style-guided generation, combining elements from multiple images, ANY persona image creation, identity-preserving Krea edits, and any uploaded brand asset reuse — logos, brand marks, mascots, product shots, photos, screenshots, sketches, or character designs the user expects to appear in or guide the result. ALWAYS use this (never generate_image) when persona photos OR uploaded image assets meant for reuse are in context — even if a specific edit model is requested. Exception: explicit Z-image/Z-image Turbo/Krea 2 Turbo uploaded-image enhancement uses generate_image with sourceImageIndex and starting_image_strength because those base image-to-image models are not edit_image models. If a previous edit_image attempt did not preserve the uploaded asset well, stay on edit_image and tighten the prompt or switch model; generate_image has no access to the upload. For direct edits (remove objects, enhance), use restore_photo or refine_result unless the user explicitly requested Z-image or Krea 2 Turbo.',
7
+ description: 'Generate or edit images using reference photos. Supports GPT Image 2 up to 16 images, Flux.2 up to 6, Qwen up to 3, and Krea 2 Identity Edit with 1-2. This is the required tool for identity-sensitive edits of a referenced person or character: wardrobe, makeover, pose/repositioning, face/head/body changes, background or lighting changes, character-consistent style transfer, persona scene creation, and non-Pro single-character sheets. Use model="krea-identity-edit" for those by default unless the user explicitly names another model. Keep the primary base/scene image first and an optional person/detail reference second. Use this instead of generate_image whenever uploaded/persona assets must guide the result. Use restore_photo/refine_result/apply_style only for identity-neutral restoration or edits; a portrait follow-up that must preserve likeness stays on edit_image. Exception: explicit Z-image/Z-image Turbo/base Krea 2 Turbo img2img uses generate_image with sourceImageIndex and starting_image_strength.',
8
8
  parameters: {
9
9
  type: 'object',
10
10
  properties: {
@@ -35,7 +35,9 @@ SINGLE-IMAGE PATTERN:
35
35
  MULTI-IMAGE PATTERN:
36
36
  "Use the person from picture 1 as the final subject and preserve their exact facial likeness. [Requested edit]. Identity comes only from picture 1. Pose from picture 2. Outfit from picture 3. Do not borrow identity from pictures 2 or 3. Maintain realistic anatomy, perspective, and lighting integration. Preserve all unmentioned details."
37
37
 
38
- KREA IDENTITY EDIT: Use model="krea-identity-edit" for Krea 2 Identity Edit LoRA v1.2, identity-preserving Krea edits, and the krea2_identity_edit_v1_2 model id. Use model="dark-beast-krea2-identity-edit" for Dark Beast Krea 2 Identity Edit or the dark_beast_krea2_identity_edit_v1_2 model id. These models require one reference image, accept up to two context images, work best at 512-2048 px, default to 10 steps with guidance 1, and do not use negative prompts. Put the primary scene/base image first and the person/detail reference second for scene-plus-person edits; reference them with context_image_0 and context_image_1 when model_ref tokens are needed.
38
+ KREA IDENTITY EDIT: Use model="krea-identity-edit" whenever an edit of a referenced person or character must keep likeness or character identity while changing clothes, hair or makeup, pose or position, face/head/body, background, lighting, or visual style. Infer that semantic intent in any language; never route from keyword or regex matching. Also use it for a single-character sheet in non-Pro mode. This semantic default applies even when the user did not name Krea; an explicitly user-requested model always wins. Use model="dark-beast-krea2-identity-edit" only when the user explicitly requests Dark Beast Krea 2 Identity Edit, its community/uncensored variant, or the dark_beast_krea2_identity_edit_v1_2 model id. These models require one reference image, accept up to two context images, work best at 512-2048 px, let the model tier and worker choose their current execution defaults, and do not use negative prompts. Put the primary scene/base image first and the person/detail reference second for scene-plus-person edits; reference them with context_image_0 and context_image_1 when model_ref tokens are needed.
39
+
40
+ KREA 2 IDENTITY EDIT PROMPTING: Krea performs best with a concise, direct delta instruction rather than a generic 50-200 word expansion. For one reference, state the requested change in 1-4 concrete sentences and name only the details that must remain fixed; avoid restating the entire image or dumping a long facial-feature inventory. For two references, explicitly assign roles in a compact instruction: base scene/image first, person/detail/outfit/pose/style reference second. Use sourceImageIndex to make the base scene the first context image when uploads arrive in another order (-1 = first upload, -2 = second). End with a short preservation clause only when useful. Longer structured prompts remain appropriate for character sheets, grids, editorial layouts, or exact visible text.
39
41
 
40
42
  CREATIVE TRANSFORMATIONS — be vivid and reference-specific, name the artist, franchise, or era, but always anchor identity first:
41
43
  - "Preserve the exact facial likeness from picture 1. Transform them into a Renaissance oil painting in the style of Vermeer — rich warm tones, dramatic chiaroscuro lighting, ornate period clothing. Maintain realistic anatomy. Preserve all unmentioned details."
@@ -88,7 +90,7 @@ COMPOSITE GPT IMAGE 2 STORYBOARD SHEETS: When numberOfVariations=1 and the user
88
90
  'krea-identity-edit',
89
91
  'dark-beast-krea2-identity-edit',
90
92
  ],
91
- description: 'The app auto-selects the edit model from the Default Media Quality setting (Fast→Qwen Lightning, HQ→full Qwen, Pro→Flux.2) as a FALLBACK for ordinary edits. That default is a floor, not a cap: set this parameter to override it whenever the task needs more fidelity than the fallback gives, and do not let a Fast default downgrade a fidelity-critical edit. Set "gpt-image-2" when the user names a ChatGPT, OpenAI, GPT, GPT-2, GPT Image, or gpt-image-2 model, OR for any detail-critical render or edit — dense labels, crisp or legible typography, fine text, multi-panel composition, timing notes, foley notes, professional storyboard-sheet/contact-sheet/panel layout, or a character/mascot/model sheet with turnarounds, expressions, accessories, palette swatches, and brand notes — INCLUDING editing an uploaded image that is itself a storyboard, contact sheet, multi-panel layout, or text-dense graphic. Choose "gpt-image-2" for these even when the Default Media Quality is Fast. If "gpt-image-2" is unavailable (for example insufficient credits), fall back to "qwen" (full Qwen Image Edit), never "qwen-lightning", for such fine-detail or legible-text edits. Set "krea-identity-edit" when the user asks for Krea 2 Identity Edit LoRA v1.2, Krea identity edit, identity-preserving Krea edits, face/likeness preservation with one or two references, or the krea2_identity_edit_v1_2 model id. Set "dark-beast-krea2-identity-edit" when the user asks for Dark Beast Krea 2 Identity Edit, its community/uncensored identity edit variant, or the dark_beast_krea2_identity_edit_v1_2 model id. Krea identity edit models require at least one reference image, accept up to two context images, work best at 512-2048px, use about 8-12 steps with default steps=10 and guidance=1, and do not use negative prompts. For ordinary single-subject edits with no fine text or panels, omit this parameter and let the quality default apply. Z-image, Z-image Turbo, and Krea 2 Turbo are not edit_image models; route those explicit uploaded-image enhancement requests to generate_image with sourceImageIndex and starting_image_strength. If the user names another edit/image model, honor that requested model instead. GPT Image 2 always processes input images at high fidelity; do not set input_fidelity.',
93
+ description: 'The app auto-selects Fast→Qwen Lightning, HQ→full Qwen, and Pro→Flux.2 only for ordinary identity-neutral edits. REQUIRED IDENTITY DEFAULT: set "krea-identity-edit" (Krea 2 Identity Edit LoRA v1.2) whenever an edit of a referenced person or character must keep likeness or character identity while changing clothes, hair or makeup, pose or position, face/head/body, background, lighting, or visual style. Infer that semantic intent in any language; never route from keyword or regex matching. Also use it for a single-character sheet in non-Pro mode. This semantic default applies even when the user did not name Krea; an explicitly user-requested model always wins. Set "dark-beast-krea2-identity-edit" only when the user explicitly asks for Dark Beast Krea 2 Identity Edit, its uncensored/community variant, or dark_beast_krea2_identity_edit_v1_2. Set "gpt-image-2" when the user explicitly names GPT/OpenAI/ChatGPT Image, or when precise typography, dense labels, or a professional multi-panel layout is the primary requirement; Pro character sheets may retain GPT Image 2. If GPT Image 2 is unavailable for detail-critical layout work, fall back to full "qwen", never "qwen-lightning". Krea identity edit models require at least one reference image, accept up to two context images, and work best at 512-2048px. Let the model tier and worker choose their current steps, guidance, sampler, scheduler, grounding, and reference-boost defaults; do not send a negative prompt. Put the base scene/image first and a person/detail reference second. Z-image, Z-image Turbo, and base Krea 2 Turbo are generate_image img2img models, not edit_image selectors. If the user names another edit/image model, honor it. GPT Image 2 always processes input images at high fidelity; do not set input_fidelity.',
92
94
  },
93
95
  sourceImageIndex: {
94
96
  type: 'number',
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/tools/definitions/edit-image/definition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,E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ACpC,WAAW,EACT,uLAAuL;iBAC1L;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2jBAA2jB;iBAC9jB;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../../src/tools/definitions/edit-image/definition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,0/BAA0/B;QAC5/B,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;;EAErB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+oBAkEsnB;iBACtoB;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE;wBACJ,aAAa;wBACb,gBAAgB;wBAChB,MAAM;wBACN,OAAO;wBACP,oBAAoB;wBACpB,gCAAgC;qBACjC;oBACD,WAAW,EACT,kwDAAkwD;iBACrwD;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,kiBAAkiB;iBACriB;gBACD,kBAAkB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,wrBAAwrB;oBAC1rB,OAAO,EAAE,CAAC;oBACV,OAAO,EAAE,EAAE;iBACZ;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,y/BAAy/B;iBAC5/B;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2/BAA2/B;iBAC9/B;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,GAAG,wBAAwB,imBAAimB;iBAC/nB;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;oBAC/B,WAAW,EACT,4QAA4Q;iBAC/Q;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;oBACpC,WAAW,EACT,uLAAuL;iBAC1L;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,2jBAA2jB;iBAC9jB;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sogni-ai/sogni-intelligence-client",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "Public Sogni Intelligence client — Node.js convenience wrapper for the Sogni SDK plus the public-safe subset of @sogni/creative-agent contracts (ContractRegistry, AssetManifest, RunRecord, tool envelopes). For agent builders, third-party integrations, and downstream SDKs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -205,8 +205,8 @@
205
205
  },
206
206
  "homepage": "https://github.com/Sogni-AI/sogni-intelligence-client#readme",
207
207
  "dependencies": {
208
- "@sogni-ai/sogni-client": "5.3.0",
209
- "@sogni-ai/sogni-protocol": "1.0.0-alpha.9",
208
+ "@sogni-ai/sogni-client": "5.3.1",
209
+ "@sogni-ai/sogni-protocol": "1.0.0-alpha.10",
210
210
  "sharp": "^0.34.5"
211
211
  },
212
212
  "devDependencies": {