utilitas 2001.1.85 → 2001.1.86
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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/alan.mjs +18 -1
- package/lib/manifest.mjs +1 -1
- package/package.json +1 -1
package/lib/alan.mjs
CHANGED
|
@@ -152,6 +152,10 @@ const MODELS = {
|
|
|
152
152
|
source: GOOGLE, maxInputTokens: 480,
|
|
153
153
|
image: true, defaultProvider: GOOGLE,
|
|
154
154
|
},
|
|
155
|
+
// [IMAGEN_4_UPSCALE]: {
|
|
156
|
+
// source: GOOGLE, maxInputTokens: 0, image: true,
|
|
157
|
+
// supportedMimeTypes: [MIME_PNG, MIME_JPEG], defaultProvider: GOOGLE,
|
|
158
|
+
// },
|
|
155
159
|
[VEO_31]: {
|
|
156
160
|
source: GOOGLE, maxInputTokens: 1024, attachmentTokenCost: 0,
|
|
157
161
|
video: true, vision: true,
|
|
@@ -997,11 +1001,23 @@ const promptGoogle = async (aiId, prompt, options = {}) => {
|
|
|
997
1001
|
const target_model = options?.model || model.name;
|
|
998
1002
|
const M = MODELS[target_model];
|
|
999
1003
|
prompt = ensureString(prompt, { trim: true });
|
|
1004
|
+
// M.name === IMAGEN_4_ULTRA ||
|
|
1000
1005
|
assertPrompt(prompt);
|
|
1001
1006
|
M.tts && (prompt = `${options?.prompt || TTS_PROMPT}: ${prompt}`);
|
|
1002
1007
|
prompt = trimText(prompt, { limit: M.maxInputTokens });
|
|
1003
1008
|
if (M?.image) {
|
|
1004
|
-
var resp
|
|
1009
|
+
var resp;
|
|
1010
|
+
// if (M.name === IMAGEN_4_ULTRA) {
|
|
1011
|
+
// resp = await client.models.upscaleImage({
|
|
1012
|
+
// model: M.name, prompt, config: mergeAtoB(options?.config, {
|
|
1013
|
+
// numberOfImages: options?.n || 4, sampleImageSize: '2K',
|
|
1014
|
+
// includeRaiReason: true,
|
|
1015
|
+
// // "1:1" (default), "3:4", "4:3", "9:16", and "16:9"
|
|
1016
|
+
// aspectRatio: '16:9', personGeneration: 'allow_adult',
|
|
1017
|
+
// }),
|
|
1018
|
+
// });
|
|
1019
|
+
// } else {
|
|
1020
|
+
resp = await client.models.generateImages({
|
|
1005
1021
|
model: M.name, prompt, config: mergeAtoB(options?.config, {
|
|
1006
1022
|
numberOfImages: options?.n || 4, sampleImageSize: '2K',
|
|
1007
1023
|
includeRaiReason: true,
|
|
@@ -1009,6 +1025,7 @@ const promptGoogle = async (aiId, prompt, options = {}) => {
|
|
|
1009
1025
|
aspectRatio: '16:9', personGeneration: 'allow_adult',
|
|
1010
1026
|
}),
|
|
1011
1027
|
});
|
|
1028
|
+
// }
|
|
1012
1029
|
var generated = resp?.generatedImages;
|
|
1013
1030
|
assert(!resp?.error && generated?.filter(
|
|
1014
1031
|
x => !x.raiFilteredReason
|
package/lib/manifest.mjs
CHANGED