ugly-app 0.1.437 → 0.1.438
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/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/shared/ImageGen.d.ts +20 -50
- package/dist/shared/ImageGen.d.ts.map +1 -1
- package/dist/shared/ImageGen.js +30 -351
- package/dist/shared/ImageGen.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/version.ts +1 -1
- package/src/server/index.ts +0 -26
- package/src/shared/ImageGen.ts +42 -437
package/dist/cli/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.
|
|
1
|
+
export declare const CLI_VERSION = "0.1.438";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cli/version.js
CHANGED
package/dist/server/index.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export { RouterAuthError, RouterNotFoundError, createRouter, } from './Router.js
|
|
|
49
49
|
export type { AppRouter, AuthHandlerFn, PublicHandlerFn, RequestHandlers, } from './Router.js';
|
|
50
50
|
export { createStorageClient, setStoragePrefix } from './DataProxyClient.js';
|
|
51
51
|
export { createTextGen } from './TextGen.js';
|
|
52
|
-
export {
|
|
53
|
-
export type {
|
|
52
|
+
export { imageGenModelData, imageGenModels, imageGenModelsSet, imageGenSizes, imageGenSizesSet, } from '../shared/ImageGen.js';
|
|
53
|
+
export type { ImageGenModel, ImageGenModelData, ImageGenParams, ImageGenSize, } from '../shared/ImageGen.js';
|
|
54
54
|
export { textGenModelData, textGenModels, textGenModelsSet, } from '../shared/TextGen.js';
|
|
55
55
|
export type { RequiredFeatures, TextGenModel, TextGenModelData, TextGenModelDataDeprecated, TextGenParams, } from '../shared/TextGen.js';
|
|
56
56
|
export { BaseTextGen, Tokenizers } from './ai/TextGenBase.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAW,EACX,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EACV,OAAO,IAAI,SAAS,EACpB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,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EACV,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,EAC5B,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,aAAa,GACd,MAAM,aAAa,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { RouterAuthError, RouterNotFoundError, createRouter, } from './Router.js
|
|
|
28
28
|
export { createStorageClient, setStoragePrefix } from './DataProxyClient.js';
|
|
29
29
|
export { createTextGen } from './TextGen.js';
|
|
30
30
|
// ─── TextGen & ImageGen: shared model data ──────────────────────────────────
|
|
31
|
-
export {
|
|
31
|
+
export { imageGenModelData, imageGenModels, imageGenModelsSet, imageGenSizes, imageGenSizesSet, } from '../shared/ImageGen.js';
|
|
32
32
|
export { textGenModelData, textGenModels, textGenModelsSet, } from '../shared/TextGen.js';
|
|
33
33
|
// ─── TextGen base interface ─────────────────────────────────────────────────
|
|
34
34
|
export { BaseTextGen, Tokenizers } from './ai/TextGenBase.js';
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAgCzB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAS9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAa3E,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO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EAAE,MAAM,sBAAsB,CAAC;AACxE,8EAA8E;AAC9E,mEAAmE;AACnE,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,EAC5B,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,aAAa,CAAC"}
|
|
@@ -3,63 +3,41 @@ export type ImageGenSize = 'square' | 'portrait_4_3' | 'portrait_16_9' | 'portra
|
|
|
3
3
|
export declare const imageGenSizes: ImageGenSize[];
|
|
4
4
|
export declare const imageGenSizesSet: Set<ImageGenSize>;
|
|
5
5
|
export interface ImageGenModelData {
|
|
6
|
+
/** ugly.bot's caller-facing price per image (or per pixel when
|
|
7
|
+
* `priceResolutionMultiplier` is non-zero). Nanodollars. */
|
|
6
8
|
price: number;
|
|
9
|
+
/**
|
|
10
|
+
* If non-zero, the price is per pixel and gets multiplied by `width *
|
|
11
|
+
* height * priceResolutionMultiplier`. Use `1 / (1024 * 1024)` for
|
|
12
|
+
* per-megapixel pricing. Set to 0 for flat-rate per-image pricing.
|
|
13
|
+
*/
|
|
7
14
|
priceResolutionMultiplier: number;
|
|
15
|
+
/**
|
|
16
|
+
* If non-zero, the price scales with `steps` and gets multiplied by
|
|
17
|
+
* `steps * priceStepMultiplier`. Set to 0 for step-independent pricing.
|
|
18
|
+
*/
|
|
8
19
|
priceStepMultiplier: number;
|
|
9
20
|
}
|
|
10
|
-
export declare const imageGenFalModelValues: readonly ["fal_flux_dev", "fal_flux_pro", "fal_flux_2_dev", "fal_flux_2_pro", "fal_flux_2_max", "fal_seedream_v4_5"];
|
|
11
|
-
export type ImageGenFalModel = (typeof imageGenFalModelValues)[number];
|
|
12
|
-
export declare const imageGenFalModels: ImageGenFalModel[];
|
|
13
|
-
export declare const imageGenGoogleModelValues: readonly ["google_nano", "google_nano_pro"];
|
|
14
|
-
export type ImageGenGoogleModel = (typeof imageGenGoogleModelValues)[number];
|
|
15
|
-
export declare const imageGenGoogleModels: ImageGenGoogleModel[];
|
|
16
|
-
export declare const imageGenKieModelValues: readonly ["kie_nano_banana", "kie_nano_banana_pro"];
|
|
17
|
-
export type ImageGenKieModel = (typeof imageGenKieModelValues)[number];
|
|
18
|
-
export declare const imageGenKieModels: ImageGenKieModel[];
|
|
19
|
-
export declare const imageGenTogetherModelValues: readonly ["together_flux_pro", "together_flux_2_dev", "together_flux_2_pro", "together_flux_2_max", "together_flux_kontext_dev", "together_flux_kontext_pro", "together_flux_kontext_max"];
|
|
20
|
-
export type ImageGenTogetherModel = (typeof imageGenTogetherModelValues)[number];
|
|
21
|
-
export declare const imageGenTogetherModels: ImageGenTogetherModel[];
|
|
22
|
-
export declare const imageGenWavespeedModelValues: readonly ["wavespeed_seedream_v4_5", "wavespeed_flux_dev", "wavespeed_flux_schnell", "wavespeed_flux_2_dev", "wavespeed_flux_2_pro", "wavespeed_flux_2_max"];
|
|
23
|
-
export type ImageGenWavespeedModel = (typeof imageGenWavespeedModelValues)[number];
|
|
24
|
-
export declare const imageGenWavespeedModels: ImageGenWavespeedModel[];
|
|
25
|
-
export declare const imageGenFireworksModelValues: readonly ["fireworks_flux_pro"];
|
|
26
|
-
export type ImageGenFireworksModel = (typeof imageGenFireworksModelValues)[number];
|
|
27
|
-
export declare const imageGenFireworksModels: ImageGenFireworksModel[];
|
|
28
|
-
declare const imageGenProviderModelValues: readonly ["fal_flux_dev", "fal_flux_pro", "fal_flux_2_dev", "fal_flux_2_pro", "fal_flux_2_max", "fal_seedream_v4_5", "google_nano", "google_nano_pro", "together_flux_pro", "together_flux_2_dev", "together_flux_2_pro", "together_flux_2_max", "together_flux_kontext_dev", "together_flux_kontext_pro", "together_flux_kontext_max", "fireworks_flux_pro", "kie_nano_banana", "kie_nano_banana_pro", "wavespeed_seedream_v4_5", "wavespeed_flux_dev", "wavespeed_flux_schnell", "wavespeed_flux_2_dev", "wavespeed_flux_2_pro", "wavespeed_flux_2_max"];
|
|
29
|
-
/** Provider-specific image model identifier (e.g. 'fal_flux_dev'). Internal use only — callers use ImageGenModel. */
|
|
30
|
-
export type ImageGenModelProvider = (typeof imageGenProviderModelValues)[number];
|
|
31
|
-
export declare const imageGenProviderModels: ImageGenModelProvider[];
|
|
32
|
-
export declare const imageGenProviderModelsSet: Set<"fal_flux_dev" | "fal_flux_pro" | "fal_flux_2_dev" | "fal_flux_2_pro" | "fal_flux_2_max" | "fal_seedream_v4_5" | "google_nano" | "google_nano_pro" | "kie_nano_banana" | "kie_nano_banana_pro" | "together_flux_pro" | "together_flux_2_dev" | "together_flux_2_pro" | "together_flux_2_max" | "together_flux_kontext_dev" | "together_flux_kontext_pro" | "together_flux_kontext_max" | "wavespeed_seedream_v4_5" | "wavespeed_flux_dev" | "wavespeed_flux_schnell" | "wavespeed_flux_2_dev" | "wavespeed_flux_2_pro" | "wavespeed_flux_2_max" | "fireworks_flux_pro">;
|
|
33
21
|
declare const imageGenModelValues: readonly ["flux_2_pro", "flux_2_max", "flux_2_dev", "flux_1_pro", "flux_1_dev", "flux_1_schnell", "nano_banana", "nano_banana_pro", "seedream"];
|
|
34
22
|
/** Clean image model identifier without provider prefix (e.g. 'flux_1_dev'). Use this in all API calls. */
|
|
35
23
|
export type ImageGenModel = (typeof imageGenModelValues)[number];
|
|
36
24
|
export declare const imageGenModels: ImageGenModel[];
|
|
37
25
|
export declare const imageGenModelsSet: Set<"flux_2_pro" | "flux_2_max" | "flux_2_dev" | "flux_1_pro" | "flux_1_dev" | "flux_1_schnell" | "nano_banana" | "nano_banana_pro" | "seedream">;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export declare const
|
|
47
|
-
/** Model data keyed by provider-specific model name. Used internally by routing. */
|
|
48
|
-
export declare const imageGenModelData: Record<ImageGenModelProvider, ImageGenModelData>;
|
|
26
|
+
/**
|
|
27
|
+
* Clean-model image metadata keyed by `ImageGenModel`. Used for billing
|
|
28
|
+
* display. Each entry holds ugly.bot's caller-facing rate for that model
|
|
29
|
+
* regardless of which provider actually serves the request.
|
|
30
|
+
*
|
|
31
|
+
* Provider-specific data (per-provider per-image costs, the multi-provider
|
|
32
|
+
* routing registry) lives in ugly.bot's own server/ai/providerCatalog.ts.
|
|
33
|
+
*/
|
|
34
|
+
export declare const imageGenModelData: Record<ImageGenModel, ImageGenModelData>;
|
|
49
35
|
export interface ImageGenParams {
|
|
50
36
|
steps?: number;
|
|
51
37
|
guidanceScale?: number;
|
|
52
38
|
useRefiner?: boolean;
|
|
53
39
|
highNoiseFrac?: number;
|
|
54
40
|
}
|
|
55
|
-
export declare const imageGenProviders: readonly ["together", "fireworks", "fal", "google", "kie", "wavespeed"];
|
|
56
|
-
export type ImageGenProvider = (typeof imageGenProviders)[number];
|
|
57
|
-
export interface ImageGenProviderOffering {
|
|
58
|
-
provider: ImageGenProvider;
|
|
59
|
-
providerModel: ImageGenModelProvider;
|
|
60
|
-
available: boolean;
|
|
61
|
-
}
|
|
62
|
-
export declare const imageGenMultiProviderModels: Record<ImageGenModel, ImageGenProviderOffering[]>;
|
|
63
41
|
declare const imageGenCallOptionsSchema: z.ZodObject<{
|
|
64
42
|
aspectRatio: z.ZodOptional<z.ZodEnum<{
|
|
65
43
|
square: "square";
|
|
@@ -74,10 +52,6 @@ declare const imageGenCallOptionsSchema: z.ZodObject<{
|
|
|
74
52
|
guidanceScale: z.ZodOptional<z.ZodNumber>;
|
|
75
53
|
negativePrompt: z.ZodOptional<z.ZodString>;
|
|
76
54
|
captureDebugInfo: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
-
priority: z.ZodOptional<z.ZodEnum<{
|
|
78
|
-
fast: "fast";
|
|
79
|
-
cheap: "cheap";
|
|
80
|
-
}>>;
|
|
81
55
|
}, z.core.$strip>;
|
|
82
56
|
export declare const imageGenInputSchema: z.ZodObject<{
|
|
83
57
|
model: z.ZodEnum<{
|
|
@@ -106,10 +80,6 @@ export declare const imageGenInputSchema: z.ZodObject<{
|
|
|
106
80
|
guidanceScale: z.ZodOptional<z.ZodNumber>;
|
|
107
81
|
negativePrompt: z.ZodOptional<z.ZodString>;
|
|
108
82
|
captureDebugInfo: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
-
priority: z.ZodOptional<z.ZodEnum<{
|
|
110
|
-
fast: "fast";
|
|
111
|
-
cheap: "cheap";
|
|
112
|
-
}>>;
|
|
113
83
|
}, z.core.$strip>>;
|
|
114
84
|
}, z.core.$strip>;
|
|
115
85
|
export type ImageGenCallOptions = z.infer<typeof imageGenCallOptionsSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageGen.d.ts","sourceRoot":"","sources":["../../src/shared/ImageGen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageGen.d.ts","sourceRoot":"","sources":["../../src/shared/ImageGen.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,cAAc,GACd,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,eAAO,MAAM,aAAa,EAAE,YAAY,EAQvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBAAyB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC;iEAC6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,yBAAyB,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAOD,QAAA,MAAM,mBAAmB,iJAUf,CAAC;AAEX,2GAA2G;AAC3G,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,cAAc,EAAqC,aAAa,EAAE,CAAC;AAEhF,eAAO,MAAM,iBAAiB,mJAA0B,CAAC;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,aAAa,EAAE,iBAAiB,CA8CtE,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;iBAQ7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAIhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;kBAepB,CAAC;AAEd,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/shared/ImageGen.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// ImageGen public surface — clean model names + caller-facing model metadata.
|
|
2
|
+
// Provider-specific data (per-provider tables, routing registry, helpers)
|
|
3
|
+
// lives in ugly.bot's server/ai/providerCatalog.ts — NOT here.
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export const imageGenSizes = [
|
|
5
6
|
'square',
|
|
@@ -12,93 +13,6 @@ export const imageGenSizes = [
|
|
|
12
13
|
];
|
|
13
14
|
export const imageGenSizesSet = new Set(imageGenSizes);
|
|
14
15
|
// ============================================================================
|
|
15
|
-
// Provider-specific model names (ImageGenModelProvider)
|
|
16
|
-
// These are the concrete provider-prefixed model identifiers used internally.
|
|
17
|
-
// Callers use ImageGenModel (clean names) instead.
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const imageGenFalModelValues = [
|
|
20
|
-
'fal_flux_dev',
|
|
21
|
-
'fal_flux_pro',
|
|
22
|
-
'fal_flux_2_dev',
|
|
23
|
-
'fal_flux_2_pro',
|
|
24
|
-
'fal_flux_2_max',
|
|
25
|
-
'fal_seedream_v4_5',
|
|
26
|
-
];
|
|
27
|
-
export const imageGenFalModels = imageGenFalModelValues;
|
|
28
|
-
export const imageGenGoogleModelValues = [
|
|
29
|
-
'google_nano',
|
|
30
|
-
'google_nano_pro',
|
|
31
|
-
];
|
|
32
|
-
export const imageGenGoogleModels = imageGenGoogleModelValues;
|
|
33
|
-
// Kie.ai Nano Banana models (cheaper than Google direct)
|
|
34
|
-
export const imageGenKieModelValues = [
|
|
35
|
-
'kie_nano_banana',
|
|
36
|
-
'kie_nano_banana_pro',
|
|
37
|
-
];
|
|
38
|
-
export const imageGenKieModels = imageGenKieModelValues;
|
|
39
|
-
// Together.ai FLUX models
|
|
40
|
-
export const imageGenTogetherModelValues = [
|
|
41
|
-
'together_flux_pro', // Premium FLUX 1.1 - $0.04/MP
|
|
42
|
-
// FLUX 2.x text-to-image models
|
|
43
|
-
'together_flux_2_dev', // $0.015/image
|
|
44
|
-
'together_flux_2_pro', // $0.03/image
|
|
45
|
-
'together_flux_2_max', // $0.07/MP
|
|
46
|
-
// FLUX 2.x models (Kontext) - these require reference image for image-to-image
|
|
47
|
-
'together_flux_kontext_dev', // Kontext dev - $0.025/MP
|
|
48
|
-
'together_flux_kontext_pro', // Kontext pro - $0.04/MP
|
|
49
|
-
'together_flux_kontext_max', // Kontext max - $0.08/MP
|
|
50
|
-
];
|
|
51
|
-
export const imageGenTogetherModels = imageGenTogetherModelValues;
|
|
52
|
-
// WaveSpeed AI models
|
|
53
|
-
export const imageGenWavespeedModelValues = [
|
|
54
|
-
'wavespeed_seedream_v4_5', // $0.04/image flat
|
|
55
|
-
'wavespeed_flux_dev', // ~$0.025/MP
|
|
56
|
-
'wavespeed_flux_schnell', // ~$0.01/MP
|
|
57
|
-
'wavespeed_flux_2_dev', // $0.012/image
|
|
58
|
-
'wavespeed_flux_2_pro', // $0.03/image
|
|
59
|
-
'wavespeed_flux_2_max', // $0.07/image
|
|
60
|
-
];
|
|
61
|
-
export const imageGenWavespeedModels = imageGenWavespeedModelValues;
|
|
62
|
-
// Fireworks AI FLUX models
|
|
63
|
-
export const imageGenFireworksModelValues = [
|
|
64
|
-
'fireworks_flux_pro', // FLUX.1 pro - $0.05/MP
|
|
65
|
-
];
|
|
66
|
-
export const imageGenFireworksModels = imageGenFireworksModelValues;
|
|
67
|
-
const imageGenProviderModelValues = [
|
|
68
|
-
// FAL
|
|
69
|
-
'fal_flux_dev',
|
|
70
|
-
'fal_flux_pro',
|
|
71
|
-
'fal_flux_2_dev',
|
|
72
|
-
'fal_flux_2_pro',
|
|
73
|
-
'fal_flux_2_max',
|
|
74
|
-
'fal_seedream_v4_5',
|
|
75
|
-
// Google
|
|
76
|
-
'google_nano',
|
|
77
|
-
'google_nano_pro',
|
|
78
|
-
// Together.ai FLUX
|
|
79
|
-
'together_flux_pro',
|
|
80
|
-
'together_flux_2_dev',
|
|
81
|
-
'together_flux_2_pro',
|
|
82
|
-
'together_flux_2_max',
|
|
83
|
-
'together_flux_kontext_dev',
|
|
84
|
-
'together_flux_kontext_pro',
|
|
85
|
-
'together_flux_kontext_max',
|
|
86
|
-
// Fireworks AI FLUX
|
|
87
|
-
'fireworks_flux_pro',
|
|
88
|
-
// Kie.ai Nano Banana
|
|
89
|
-
'kie_nano_banana',
|
|
90
|
-
'kie_nano_banana_pro',
|
|
91
|
-
// WaveSpeed AI
|
|
92
|
-
'wavespeed_seedream_v4_5',
|
|
93
|
-
'wavespeed_flux_dev',
|
|
94
|
-
'wavespeed_flux_schnell',
|
|
95
|
-
'wavespeed_flux_2_dev',
|
|
96
|
-
'wavespeed_flux_2_pro',
|
|
97
|
-
'wavespeed_flux_2_max',
|
|
98
|
-
];
|
|
99
|
-
export const imageGenProviderModels = imageGenProviderModelValues;
|
|
100
|
-
export const imageGenProviderModelsSet = new Set(imageGenProviderModels);
|
|
101
|
-
// ============================================================================
|
|
102
16
|
// Clean model names (ImageGenModel)
|
|
103
17
|
// One entry per model concept, no provider prefix.
|
|
104
18
|
// ============================================================================
|
|
@@ -115,295 +29,61 @@ const imageGenModelValues = [
|
|
|
115
29
|
];
|
|
116
30
|
export const imageGenModels = imageGenModelValues;
|
|
117
31
|
export const imageGenModelsSet = new Set(imageGenModels);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
fal_flux_2_dev: {
|
|
130
|
-
price: 12_000_000, // $0.012/MP
|
|
131
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
132
|
-
priceStepMultiplier: 0,
|
|
133
|
-
},
|
|
134
|
-
fal_flux_2_pro: {
|
|
135
|
-
price: 30_000_000, // $0.03/MP
|
|
136
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
137
|
-
priceStepMultiplier: 0,
|
|
138
|
-
},
|
|
139
|
-
fal_flux_2_max: {
|
|
140
|
-
price: 70_000_000, // $0.07/MP
|
|
141
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
142
|
-
priceStepMultiplier: 0,
|
|
143
|
-
},
|
|
144
|
-
fal_seedream_v4_5: {
|
|
145
|
-
price: 40_000_000, // $0.04/image flat
|
|
146
|
-
priceResolutionMultiplier: 0,
|
|
147
|
-
priceStepMultiplier: 0,
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
export const ImageGenGoogleModelData = {
|
|
151
|
-
google_nano: {
|
|
152
|
-
model: 'gemini-2.5-flash-image',
|
|
153
|
-
price: 39_000_000,
|
|
154
|
-
priceResolutionMultiplier: 0,
|
|
155
|
-
priceStepMultiplier: 0,
|
|
156
|
-
},
|
|
157
|
-
google_nano_pro: {
|
|
158
|
-
model: 'gemini-3-pro-image-preview',
|
|
159
|
-
price: 134_000_000,
|
|
160
|
-
priceResolutionMultiplier: 0,
|
|
161
|
-
priceStepMultiplier: 0,
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
export const ImageGenTogetherModelData = {
|
|
165
|
-
together_flux_pro: {
|
|
166
|
-
price: 40_000_000, // $0.04/MP
|
|
167
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
168
|
-
priceStepMultiplier: 0,
|
|
169
|
-
},
|
|
170
|
-
together_flux_2_dev: {
|
|
171
|
-
price: 15_000_000, // $0.015/image
|
|
172
|
-
priceResolutionMultiplier: 0,
|
|
173
|
-
priceStepMultiplier: 0,
|
|
174
|
-
},
|
|
175
|
-
together_flux_2_pro: {
|
|
176
|
-
price: 30_000_000, // $0.03/image
|
|
177
|
-
priceResolutionMultiplier: 0,
|
|
178
|
-
priceStepMultiplier: 0,
|
|
179
|
-
},
|
|
180
|
-
together_flux_2_max: {
|
|
181
|
-
price: 70_000_000, // $0.07/MP
|
|
182
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
183
|
-
priceStepMultiplier: 0,
|
|
184
|
-
},
|
|
185
|
-
together_flux_kontext_dev: {
|
|
186
|
-
price: 25_000_000, // $0.025/MP
|
|
187
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
188
|
-
priceStepMultiplier: 0,
|
|
189
|
-
},
|
|
190
|
-
together_flux_kontext_pro: {
|
|
191
|
-
price: 40_000_000, // $0.04/MP
|
|
32
|
+
/**
|
|
33
|
+
* Clean-model image metadata keyed by `ImageGenModel`. Used for billing
|
|
34
|
+
* display. Each entry holds ugly.bot's caller-facing rate for that model
|
|
35
|
+
* regardless of which provider actually serves the request.
|
|
36
|
+
*
|
|
37
|
+
* Provider-specific data (per-provider per-image costs, the multi-provider
|
|
38
|
+
* routing registry) lives in ugly.bot's own server/ai/providerCatalog.ts.
|
|
39
|
+
*/
|
|
40
|
+
export const imageGenModelData = {
|
|
41
|
+
flux_1_schnell: {
|
|
42
|
+
price: 10_000_000, // $0.01 per MP
|
|
192
43
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
193
44
|
priceStepMultiplier: 0,
|
|
194
45
|
},
|
|
195
|
-
|
|
196
|
-
price:
|
|
46
|
+
flux_1_dev: {
|
|
47
|
+
price: 25_000_000, // $0.025 per MP
|
|
197
48
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
198
49
|
priceStepMultiplier: 0,
|
|
199
50
|
},
|
|
200
|
-
|
|
201
|
-
//
|
|
202
|
-
export const ImageGenFireworksModelData = {
|
|
203
|
-
fireworks_flux_pro: {
|
|
204
|
-
price: 50_000_000, // $0.05/MP
|
|
51
|
+
flux_1_pro: {
|
|
52
|
+
price: 40_000_000, // $0.04 per MP
|
|
205
53
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
206
54
|
priceStepMultiplier: 0,
|
|
207
55
|
},
|
|
208
|
-
|
|
209
|
-
//
|
|
210
|
-
export const ImageGenKieModelData = {
|
|
211
|
-
kie_nano_banana: {
|
|
212
|
-
price: 39_000_000, // $0.039/image
|
|
213
|
-
priceResolutionMultiplier: 0,
|
|
214
|
-
priceStepMultiplier: 0,
|
|
215
|
-
},
|
|
216
|
-
kie_nano_banana_pro: {
|
|
217
|
-
price: 90_000_000, // $0.09/image (33% cheaper than Google $0.134)
|
|
56
|
+
flux_2_dev: {
|
|
57
|
+
price: 12_000_000, // $0.012 per image
|
|
218
58
|
priceResolutionMultiplier: 0,
|
|
219
59
|
priceStepMultiplier: 0,
|
|
220
60
|
},
|
|
221
|
-
|
|
222
|
-
//
|
|
223
|
-
export const ImageGenWavespeedModelData = {
|
|
224
|
-
wavespeed_seedream_v4_5: {
|
|
225
|
-
price: 40_000_000, // $0.04/image flat
|
|
61
|
+
flux_2_pro: {
|
|
62
|
+
price: 30_000_000, // $0.03 per image
|
|
226
63
|
priceResolutionMultiplier: 0,
|
|
227
64
|
priceStepMultiplier: 0,
|
|
228
65
|
},
|
|
229
|
-
|
|
230
|
-
price:
|
|
231
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
232
|
-
priceStepMultiplier: 0,
|
|
233
|
-
},
|
|
234
|
-
wavespeed_flux_schnell: {
|
|
235
|
-
price: 10_000_000, // ~$0.01/MP
|
|
66
|
+
flux_2_max: {
|
|
67
|
+
price: 70_000_000, // $0.07 per MP
|
|
236
68
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
237
69
|
priceStepMultiplier: 0,
|
|
238
70
|
},
|
|
239
|
-
|
|
240
|
-
price:
|
|
71
|
+
nano_banana: {
|
|
72
|
+
price: 39_000_000, // $0.039 per image
|
|
241
73
|
priceResolutionMultiplier: 0,
|
|
242
74
|
priceStepMultiplier: 0,
|
|
243
75
|
},
|
|
244
|
-
|
|
245
|
-
price:
|
|
76
|
+
nano_banana_pro: {
|
|
77
|
+
price: 90_000_000, // $0.09 per image
|
|
246
78
|
priceResolutionMultiplier: 0,
|
|
247
79
|
priceStepMultiplier: 0,
|
|
248
80
|
},
|
|
249
|
-
|
|
250
|
-
price:
|
|
81
|
+
seedream: {
|
|
82
|
+
price: 40_000_000, // $0.04 per image
|
|
251
83
|
priceResolutionMultiplier: 0,
|
|
252
84
|
priceStepMultiplier: 0,
|
|
253
85
|
},
|
|
254
86
|
};
|
|
255
|
-
/** Model data keyed by provider-specific model name. Used internally by routing. */
|
|
256
|
-
export const imageGenModelData = {
|
|
257
|
-
...ImageGenFalModelData,
|
|
258
|
-
...ImageGenGoogleModelData,
|
|
259
|
-
...ImageGenTogetherModelData,
|
|
260
|
-
...ImageGenFireworksModelData,
|
|
261
|
-
...ImageGenKieModelData,
|
|
262
|
-
...ImageGenWavespeedModelData,
|
|
263
|
-
};
|
|
264
|
-
// ============================================================================
|
|
265
|
-
// Multi-Provider Image Gen Routing System
|
|
266
|
-
// ============================================================================
|
|
267
|
-
// Provider identifiers for image gen
|
|
268
|
-
export const imageGenProviders = [
|
|
269
|
-
'together',
|
|
270
|
-
'fireworks',
|
|
271
|
-
'fal',
|
|
272
|
-
'google',
|
|
273
|
-
'kie',
|
|
274
|
-
'wavespeed',
|
|
275
|
-
];
|
|
276
|
-
// Registry mapping clean model names to provider offerings
|
|
277
|
-
// Ordered by price (cheapest first)
|
|
278
|
-
// Note: FLUX Kontext models not included as they require reference images
|
|
279
|
-
export const imageGenMultiProviderModels = {
|
|
280
|
-
flux_1_schnell: [
|
|
281
|
-
{
|
|
282
|
-
provider: 'wavespeed',
|
|
283
|
-
providerModel: 'wavespeed_flux_schnell',
|
|
284
|
-
available: true,
|
|
285
|
-
},
|
|
286
|
-
],
|
|
287
|
-
flux_1_dev: [
|
|
288
|
-
{
|
|
289
|
-
provider: 'fal',
|
|
290
|
-
providerModel: 'fal_flux_dev',
|
|
291
|
-
available: true,
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
provider: 'wavespeed',
|
|
295
|
-
providerModel: 'wavespeed_flux_dev',
|
|
296
|
-
available: true,
|
|
297
|
-
},
|
|
298
|
-
],
|
|
299
|
-
flux_1_pro: [
|
|
300
|
-
{
|
|
301
|
-
provider: 'together',
|
|
302
|
-
providerModel: 'together_flux_pro',
|
|
303
|
-
available: true,
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
provider: 'fireworks',
|
|
307
|
-
providerModel: 'fireworks_flux_pro',
|
|
308
|
-
available: true,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
provider: 'fal',
|
|
312
|
-
providerModel: 'fal_flux_pro',
|
|
313
|
-
available: true,
|
|
314
|
-
},
|
|
315
|
-
],
|
|
316
|
-
flux_2_dev: [
|
|
317
|
-
{
|
|
318
|
-
provider: 'fal',
|
|
319
|
-
providerModel: 'fal_flux_2_dev',
|
|
320
|
-
available: true,
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
provider: 'wavespeed',
|
|
324
|
-
providerModel: 'wavespeed_flux_2_dev',
|
|
325
|
-
available: true,
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
provider: 'together',
|
|
329
|
-
providerModel: 'together_flux_2_dev',
|
|
330
|
-
available: true,
|
|
331
|
-
},
|
|
332
|
-
],
|
|
333
|
-
flux_2_pro: [
|
|
334
|
-
{
|
|
335
|
-
provider: 'together',
|
|
336
|
-
providerModel: 'together_flux_2_pro',
|
|
337
|
-
available: true,
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
provider: 'fal',
|
|
341
|
-
providerModel: 'fal_flux_2_pro',
|
|
342
|
-
available: true,
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
provider: 'wavespeed',
|
|
346
|
-
providerModel: 'wavespeed_flux_2_pro',
|
|
347
|
-
available: true,
|
|
348
|
-
},
|
|
349
|
-
],
|
|
350
|
-
flux_2_max: [
|
|
351
|
-
{
|
|
352
|
-
provider: 'together',
|
|
353
|
-
providerModel: 'together_flux_2_max',
|
|
354
|
-
available: true,
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
provider: 'wavespeed',
|
|
358
|
-
providerModel: 'wavespeed_flux_2_max',
|
|
359
|
-
available: true,
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
provider: 'fal',
|
|
363
|
-
providerModel: 'fal_flux_2_max',
|
|
364
|
-
available: true,
|
|
365
|
-
},
|
|
366
|
-
],
|
|
367
|
-
nano_banana: [
|
|
368
|
-
// Kie.ai same price as Google, but routes through multi-provider for fallback
|
|
369
|
-
{
|
|
370
|
-
provider: 'kie',
|
|
371
|
-
providerModel: 'kie_nano_banana',
|
|
372
|
-
available: true,
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
provider: 'google',
|
|
376
|
-
providerModel: 'google_nano',
|
|
377
|
-
available: true,
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
nano_banana_pro: [
|
|
381
|
-
// Kie.ai is 33% cheaper: $0.09 vs Google $0.134
|
|
382
|
-
{
|
|
383
|
-
provider: 'kie',
|
|
384
|
-
providerModel: 'kie_nano_banana_pro',
|
|
385
|
-
available: true,
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
provider: 'google',
|
|
389
|
-
providerModel: 'google_nano_pro',
|
|
390
|
-
available: true,
|
|
391
|
-
},
|
|
392
|
-
],
|
|
393
|
-
seedream: [
|
|
394
|
-
// Both $0.04/image, FAL first as existing provider
|
|
395
|
-
{
|
|
396
|
-
provider: 'fal',
|
|
397
|
-
providerModel: 'fal_seedream_v4_5',
|
|
398
|
-
available: true,
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
provider: 'wavespeed',
|
|
402
|
-
providerModel: 'wavespeed_seedream_v4_5',
|
|
403
|
-
available: true,
|
|
404
|
-
},
|
|
405
|
-
],
|
|
406
|
-
};
|
|
407
87
|
// ── Public AI API wire types ────────────────────────────────────────────────
|
|
408
88
|
const imageGenCallOptionsSchema = z.object({
|
|
409
89
|
aspectRatio: z
|
|
@@ -413,7 +93,6 @@ const imageGenCallOptionsSchema = z.object({
|
|
|
413
93
|
guidanceScale: z.number().optional(),
|
|
414
94
|
negativePrompt: z.string().optional(),
|
|
415
95
|
captureDebugInfo: z.boolean().optional(),
|
|
416
|
-
priority: z.enum(['fast', 'cheap']).optional(),
|
|
417
96
|
});
|
|
418
97
|
export const imageGenInputSchema = z.object({
|
|
419
98
|
model: z.enum(imageGenModelValues),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageGen.js","sourceRoot":"","sources":["../../src/shared/ImageGen.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ImageGen.js","sourceRoot":"","sources":["../../src/shared/ImageGen.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,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G,CAAC;KAClC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;QAC5B,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE;KAC9B,CAAC;SACD,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/cli/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated by prebuild — do not edit manually
|
|
2
|
-
export const CLI_VERSION = "0.1.
|
|
2
|
+
export const CLI_VERSION = "0.1.438";
|
package/src/server/index.ts
CHANGED
|
@@ -210,43 +210,17 @@ export { createStorageClient, setStoragePrefix } from './DataProxyClient.js';
|
|
|
210
210
|
export { createTextGen } from './TextGen.js';
|
|
211
211
|
// ─── TextGen & ImageGen: shared model data ──────────────────────────────────
|
|
212
212
|
export {
|
|
213
|
-
ImageGenFalModelData,
|
|
214
|
-
ImageGenFireworksModelData,
|
|
215
|
-
ImageGenGoogleModelData,
|
|
216
|
-
ImageGenKieModelData,
|
|
217
|
-
ImageGenTogetherModelData,
|
|
218
|
-
ImageGenWavespeedModelData,
|
|
219
|
-
imageGenFalModels,
|
|
220
|
-
imageGenFireworksModels,
|
|
221
|
-
imageGenGoogleModels,
|
|
222
|
-
imageGenKieModels,
|
|
223
213
|
imageGenModelData,
|
|
224
214
|
imageGenModels,
|
|
225
215
|
imageGenModelsSet,
|
|
226
|
-
imageGenMultiProviderModels,
|
|
227
|
-
imageGenProviderModels,
|
|
228
|
-
imageGenProviderModelsSet,
|
|
229
|
-
imageGenProviders,
|
|
230
216
|
imageGenSizes,
|
|
231
217
|
imageGenSizesSet,
|
|
232
|
-
imageGenTogetherModels,
|
|
233
|
-
imageGenWavespeedModels,
|
|
234
218
|
} from '../shared/ImageGen.js';
|
|
235
219
|
export type {
|
|
236
|
-
ImageGenFalModel,
|
|
237
|
-
ImageGenFireworksModel,
|
|
238
|
-
ImageGenGoogleModel,
|
|
239
|
-
ImageGenKieModel,
|
|
240
|
-
// Note: ImageGenProvider (string union) not exported here to avoid conflict with
|
|
241
|
-
// ImageGenProvider interface from ./ai/types.js.
|
|
242
220
|
ImageGenModel,
|
|
243
221
|
ImageGenModelData,
|
|
244
|
-
ImageGenModelProvider,
|
|
245
222
|
ImageGenParams,
|
|
246
|
-
ImageGenProviderOffering,
|
|
247
223
|
ImageGenSize,
|
|
248
|
-
ImageGenTogetherModel,
|
|
249
|
-
ImageGenWavespeedModel,
|
|
250
224
|
} from '../shared/ImageGen.js';
|
|
251
225
|
export {
|
|
252
226
|
textGenModelData,
|
package/src/shared/ImageGen.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// ImageGen public surface — clean model names + caller-facing model metadata.
|
|
2
|
+
// Provider-specific data (per-provider tables, routing registry, helpers)
|
|
3
|
+
// lives in ugly.bot's server/ai/providerCatalog.ts — NOT here.
|
|
3
4
|
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
|
|
@@ -25,140 +26,22 @@ export const imageGenSizes: ImageGenSize[] = [
|
|
|
25
26
|
export const imageGenSizesSet = new Set(imageGenSizes);
|
|
26
27
|
|
|
27
28
|
export interface ImageGenModelData {
|
|
29
|
+
/** ugly.bot's caller-facing price per image (or per pixel when
|
|
30
|
+
* `priceResolutionMultiplier` is non-zero). Nanodollars. */
|
|
28
31
|
price: number;
|
|
32
|
+
/**
|
|
33
|
+
* If non-zero, the price is per pixel and gets multiplied by `width *
|
|
34
|
+
* height * priceResolutionMultiplier`. Use `1 / (1024 * 1024)` for
|
|
35
|
+
* per-megapixel pricing. Set to 0 for flat-rate per-image pricing.
|
|
36
|
+
*/
|
|
29
37
|
priceResolutionMultiplier: number;
|
|
38
|
+
/**
|
|
39
|
+
* If non-zero, the price scales with `steps` and gets multiplied by
|
|
40
|
+
* `steps * priceStepMultiplier`. Set to 0 for step-independent pricing.
|
|
41
|
+
*/
|
|
30
42
|
priceStepMultiplier: number;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
// ============================================================================
|
|
34
|
-
// Provider-specific model names (ImageGenModelProvider)
|
|
35
|
-
// These are the concrete provider-prefixed model identifiers used internally.
|
|
36
|
-
// Callers use ImageGenModel (clean names) instead.
|
|
37
|
-
// ============================================================================
|
|
38
|
-
|
|
39
|
-
export const imageGenFalModelValues = [
|
|
40
|
-
'fal_flux_dev',
|
|
41
|
-
'fal_flux_pro',
|
|
42
|
-
'fal_flux_2_dev',
|
|
43
|
-
'fal_flux_2_pro',
|
|
44
|
-
'fal_flux_2_max',
|
|
45
|
-
'fal_seedream_v4_5',
|
|
46
|
-
] as const;
|
|
47
|
-
|
|
48
|
-
export type ImageGenFalModel = (typeof imageGenFalModelValues)[number];
|
|
49
|
-
|
|
50
|
-
export const imageGenFalModels =
|
|
51
|
-
imageGenFalModelValues as unknown as ImageGenFalModel[];
|
|
52
|
-
|
|
53
|
-
export const imageGenGoogleModelValues = [
|
|
54
|
-
'google_nano',
|
|
55
|
-
'google_nano_pro',
|
|
56
|
-
] as const;
|
|
57
|
-
|
|
58
|
-
export type ImageGenGoogleModel = (typeof imageGenGoogleModelValues)[number];
|
|
59
|
-
|
|
60
|
-
export const imageGenGoogleModels =
|
|
61
|
-
imageGenGoogleModelValues as unknown as ImageGenGoogleModel[];
|
|
62
|
-
|
|
63
|
-
// Kie.ai Nano Banana models (cheaper than Google direct)
|
|
64
|
-
export const imageGenKieModelValues = [
|
|
65
|
-
'kie_nano_banana',
|
|
66
|
-
'kie_nano_banana_pro',
|
|
67
|
-
] as const;
|
|
68
|
-
|
|
69
|
-
export type ImageGenKieModel = (typeof imageGenKieModelValues)[number];
|
|
70
|
-
|
|
71
|
-
export const imageGenKieModels =
|
|
72
|
-
imageGenKieModelValues as unknown as ImageGenKieModel[];
|
|
73
|
-
|
|
74
|
-
// Together.ai FLUX models
|
|
75
|
-
export const imageGenTogetherModelValues = [
|
|
76
|
-
'together_flux_pro', // Premium FLUX 1.1 - $0.04/MP
|
|
77
|
-
// FLUX 2.x text-to-image models
|
|
78
|
-
'together_flux_2_dev', // $0.015/image
|
|
79
|
-
'together_flux_2_pro', // $0.03/image
|
|
80
|
-
'together_flux_2_max', // $0.07/MP
|
|
81
|
-
// FLUX 2.x models (Kontext) - these require reference image for image-to-image
|
|
82
|
-
'together_flux_kontext_dev', // Kontext dev - $0.025/MP
|
|
83
|
-
'together_flux_kontext_pro', // Kontext pro - $0.04/MP
|
|
84
|
-
'together_flux_kontext_max', // Kontext max - $0.08/MP
|
|
85
|
-
] as const;
|
|
86
|
-
|
|
87
|
-
export type ImageGenTogetherModel =
|
|
88
|
-
(typeof imageGenTogetherModelValues)[number];
|
|
89
|
-
|
|
90
|
-
export const imageGenTogetherModels =
|
|
91
|
-
imageGenTogetherModelValues as unknown as ImageGenTogetherModel[];
|
|
92
|
-
|
|
93
|
-
// WaveSpeed AI models
|
|
94
|
-
export const imageGenWavespeedModelValues = [
|
|
95
|
-
'wavespeed_seedream_v4_5', // $0.04/image flat
|
|
96
|
-
'wavespeed_flux_dev', // ~$0.025/MP
|
|
97
|
-
'wavespeed_flux_schnell', // ~$0.01/MP
|
|
98
|
-
'wavespeed_flux_2_dev', // $0.012/image
|
|
99
|
-
'wavespeed_flux_2_pro', // $0.03/image
|
|
100
|
-
'wavespeed_flux_2_max', // $0.07/image
|
|
101
|
-
] as const;
|
|
102
|
-
|
|
103
|
-
export type ImageGenWavespeedModel =
|
|
104
|
-
(typeof imageGenWavespeedModelValues)[number];
|
|
105
|
-
|
|
106
|
-
export const imageGenWavespeedModels =
|
|
107
|
-
imageGenWavespeedModelValues as unknown as ImageGenWavespeedModel[];
|
|
108
|
-
|
|
109
|
-
// Fireworks AI FLUX models
|
|
110
|
-
export const imageGenFireworksModelValues = [
|
|
111
|
-
'fireworks_flux_pro', // FLUX.1 pro - $0.05/MP
|
|
112
|
-
] as const;
|
|
113
|
-
|
|
114
|
-
export type ImageGenFireworksModel =
|
|
115
|
-
(typeof imageGenFireworksModelValues)[number];
|
|
116
|
-
|
|
117
|
-
export const imageGenFireworksModels =
|
|
118
|
-
imageGenFireworksModelValues as unknown as ImageGenFireworksModel[];
|
|
119
|
-
|
|
120
|
-
const imageGenProviderModelValues = [
|
|
121
|
-
// FAL
|
|
122
|
-
'fal_flux_dev',
|
|
123
|
-
'fal_flux_pro',
|
|
124
|
-
'fal_flux_2_dev',
|
|
125
|
-
'fal_flux_2_pro',
|
|
126
|
-
'fal_flux_2_max',
|
|
127
|
-
'fal_seedream_v4_5',
|
|
128
|
-
// Google
|
|
129
|
-
'google_nano',
|
|
130
|
-
'google_nano_pro',
|
|
131
|
-
// Together.ai FLUX
|
|
132
|
-
'together_flux_pro',
|
|
133
|
-
'together_flux_2_dev',
|
|
134
|
-
'together_flux_2_pro',
|
|
135
|
-
'together_flux_2_max',
|
|
136
|
-
'together_flux_kontext_dev',
|
|
137
|
-
'together_flux_kontext_pro',
|
|
138
|
-
'together_flux_kontext_max',
|
|
139
|
-
// Fireworks AI FLUX
|
|
140
|
-
'fireworks_flux_pro',
|
|
141
|
-
// Kie.ai Nano Banana
|
|
142
|
-
'kie_nano_banana',
|
|
143
|
-
'kie_nano_banana_pro',
|
|
144
|
-
// WaveSpeed AI
|
|
145
|
-
'wavespeed_seedream_v4_5',
|
|
146
|
-
'wavespeed_flux_dev',
|
|
147
|
-
'wavespeed_flux_schnell',
|
|
148
|
-
'wavespeed_flux_2_dev',
|
|
149
|
-
'wavespeed_flux_2_pro',
|
|
150
|
-
'wavespeed_flux_2_max',
|
|
151
|
-
] as const;
|
|
152
|
-
|
|
153
|
-
/** Provider-specific image model identifier (e.g. 'fal_flux_dev'). Internal use only — callers use ImageGenModel. */
|
|
154
|
-
export type ImageGenModelProvider =
|
|
155
|
-
(typeof imageGenProviderModelValues)[number];
|
|
156
|
-
|
|
157
|
-
export const imageGenProviderModels =
|
|
158
|
-
imageGenProviderModelValues as unknown as ImageGenModelProvider[];
|
|
159
|
-
|
|
160
|
-
export const imageGenProviderModelsSet = new Set(imageGenProviderModels);
|
|
161
|
-
|
|
162
45
|
// ============================================================================
|
|
163
46
|
// Clean model names (ImageGenModel)
|
|
164
47
|
// One entry per model concept, no provider prefix.
|
|
@@ -183,180 +66,62 @@ export const imageGenModels = imageGenModelValues as unknown as ImageGenModel[];
|
|
|
183
66
|
|
|
184
67
|
export const imageGenModelsSet = new Set(imageGenModels);
|
|
185
68
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
fal_flux_2_dev: {
|
|
199
|
-
price: 12_000_000, // $0.012/MP
|
|
200
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
201
|
-
priceStepMultiplier: 0,
|
|
202
|
-
},
|
|
203
|
-
fal_flux_2_pro: {
|
|
204
|
-
price: 30_000_000, // $0.03/MP
|
|
205
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
206
|
-
priceStepMultiplier: 0,
|
|
207
|
-
},
|
|
208
|
-
fal_flux_2_max: {
|
|
209
|
-
price: 70_000_000, // $0.07/MP
|
|
210
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
211
|
-
priceStepMultiplier: 0,
|
|
212
|
-
},
|
|
213
|
-
fal_seedream_v4_5: {
|
|
214
|
-
price: 40_000_000, // $0.04/image flat
|
|
215
|
-
priceResolutionMultiplier: 0,
|
|
216
|
-
priceStepMultiplier: 0,
|
|
217
|
-
},
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
export interface ImageGenGoogleModelDataType extends ImageGenModelData {
|
|
221
|
-
model: string;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export const ImageGenGoogleModelData: Record<
|
|
225
|
-
ImageGenGoogleModel,
|
|
226
|
-
ImageGenGoogleModelDataType
|
|
227
|
-
> = {
|
|
228
|
-
google_nano: {
|
|
229
|
-
model: 'gemini-2.5-flash-image',
|
|
230
|
-
price: 39_000_000,
|
|
231
|
-
priceResolutionMultiplier: 0,
|
|
232
|
-
priceStepMultiplier: 0,
|
|
233
|
-
},
|
|
234
|
-
google_nano_pro: {
|
|
235
|
-
model: 'gemini-3-pro-image-preview',
|
|
236
|
-
price: 134_000_000,
|
|
237
|
-
priceResolutionMultiplier: 0,
|
|
238
|
-
priceStepMultiplier: 0,
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
export const ImageGenTogetherModelData: Record<
|
|
243
|
-
ImageGenTogetherModel,
|
|
244
|
-
ImageGenModelData
|
|
245
|
-
> = {
|
|
246
|
-
together_flux_pro: {
|
|
247
|
-
price: 40_000_000, // $0.04/MP
|
|
248
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
249
|
-
priceStepMultiplier: 0,
|
|
250
|
-
},
|
|
251
|
-
together_flux_2_dev: {
|
|
252
|
-
price: 15_000_000, // $0.015/image
|
|
253
|
-
priceResolutionMultiplier: 0,
|
|
254
|
-
priceStepMultiplier: 0,
|
|
255
|
-
},
|
|
256
|
-
together_flux_2_pro: {
|
|
257
|
-
price: 30_000_000, // $0.03/image
|
|
258
|
-
priceResolutionMultiplier: 0,
|
|
259
|
-
priceStepMultiplier: 0,
|
|
260
|
-
},
|
|
261
|
-
together_flux_2_max: {
|
|
262
|
-
price: 70_000_000, // $0.07/MP
|
|
263
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
264
|
-
priceStepMultiplier: 0,
|
|
265
|
-
},
|
|
266
|
-
together_flux_kontext_dev: {
|
|
267
|
-
price: 25_000_000, // $0.025/MP
|
|
69
|
+
/**
|
|
70
|
+
* Clean-model image metadata keyed by `ImageGenModel`. Used for billing
|
|
71
|
+
* display. Each entry holds ugly.bot's caller-facing rate for that model
|
|
72
|
+
* regardless of which provider actually serves the request.
|
|
73
|
+
*
|
|
74
|
+
* Provider-specific data (per-provider per-image costs, the multi-provider
|
|
75
|
+
* routing registry) lives in ugly.bot's own server/ai/providerCatalog.ts.
|
|
76
|
+
*/
|
|
77
|
+
export const imageGenModelData: Record<ImageGenModel, ImageGenModelData> = {
|
|
78
|
+
flux_1_schnell: {
|
|
79
|
+
price: 10_000_000, // $0.01 per MP
|
|
268
80
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
269
81
|
priceStepMultiplier: 0,
|
|
270
82
|
},
|
|
271
|
-
|
|
272
|
-
price:
|
|
83
|
+
flux_1_dev: {
|
|
84
|
+
price: 25_000_000, // $0.025 per MP
|
|
273
85
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
274
86
|
priceStepMultiplier: 0,
|
|
275
87
|
},
|
|
276
|
-
|
|
277
|
-
price:
|
|
88
|
+
flux_1_pro: {
|
|
89
|
+
price: 40_000_000, // $0.04 per MP
|
|
278
90
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
279
91
|
priceStepMultiplier: 0,
|
|
280
92
|
},
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
// Fireworks AI FLUX models
|
|
284
|
-
export const ImageGenFireworksModelData: Record<
|
|
285
|
-
ImageGenFireworksModel,
|
|
286
|
-
ImageGenModelData
|
|
287
|
-
> = {
|
|
288
|
-
fireworks_flux_pro: {
|
|
289
|
-
price: 50_000_000, // $0.05/MP
|
|
290
|
-
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
291
|
-
priceStepMultiplier: 0,
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// Kie.ai Nano Banana models
|
|
296
|
-
export const ImageGenKieModelData: Record<ImageGenKieModel, ImageGenModelData> =
|
|
297
|
-
{
|
|
298
|
-
kie_nano_banana: {
|
|
299
|
-
price: 39_000_000, // $0.039/image
|
|
300
|
-
priceResolutionMultiplier: 0,
|
|
301
|
-
priceStepMultiplier: 0,
|
|
302
|
-
},
|
|
303
|
-
kie_nano_banana_pro: {
|
|
304
|
-
price: 90_000_000, // $0.09/image (33% cheaper than Google $0.134)
|
|
305
|
-
priceResolutionMultiplier: 0,
|
|
306
|
-
priceStepMultiplier: 0,
|
|
307
|
-
},
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
// WaveSpeed AI models
|
|
311
|
-
export const ImageGenWavespeedModelData: Record<
|
|
312
|
-
ImageGenWavespeedModel,
|
|
313
|
-
ImageGenModelData
|
|
314
|
-
> = {
|
|
315
|
-
wavespeed_seedream_v4_5: {
|
|
316
|
-
price: 40_000_000, // $0.04/image flat
|
|
93
|
+
flux_2_dev: {
|
|
94
|
+
price: 12_000_000, // $0.012 per image
|
|
317
95
|
priceResolutionMultiplier: 0,
|
|
318
96
|
priceStepMultiplier: 0,
|
|
319
97
|
},
|
|
320
|
-
|
|
321
|
-
price:
|
|
322
|
-
priceResolutionMultiplier:
|
|
98
|
+
flux_2_pro: {
|
|
99
|
+
price: 30_000_000, // $0.03 per image
|
|
100
|
+
priceResolutionMultiplier: 0,
|
|
323
101
|
priceStepMultiplier: 0,
|
|
324
102
|
},
|
|
325
|
-
|
|
326
|
-
price:
|
|
103
|
+
flux_2_max: {
|
|
104
|
+
price: 70_000_000, // $0.07 per MP
|
|
327
105
|
priceResolutionMultiplier: 1 / (1024 * 1024),
|
|
328
106
|
priceStepMultiplier: 0,
|
|
329
107
|
},
|
|
330
|
-
|
|
331
|
-
price:
|
|
108
|
+
nano_banana: {
|
|
109
|
+
price: 39_000_000, // $0.039 per image
|
|
332
110
|
priceResolutionMultiplier: 0,
|
|
333
111
|
priceStepMultiplier: 0,
|
|
334
112
|
},
|
|
335
|
-
|
|
336
|
-
price:
|
|
113
|
+
nano_banana_pro: {
|
|
114
|
+
price: 90_000_000, // $0.09 per image
|
|
337
115
|
priceResolutionMultiplier: 0,
|
|
338
116
|
priceStepMultiplier: 0,
|
|
339
117
|
},
|
|
340
|
-
|
|
341
|
-
price:
|
|
118
|
+
seedream: {
|
|
119
|
+
price: 40_000_000, // $0.04 per image
|
|
342
120
|
priceResolutionMultiplier: 0,
|
|
343
121
|
priceStepMultiplier: 0,
|
|
344
122
|
},
|
|
345
123
|
};
|
|
346
124
|
|
|
347
|
-
/** Model data keyed by provider-specific model name. Used internally by routing. */
|
|
348
|
-
export const imageGenModelData: Record<
|
|
349
|
-
ImageGenModelProvider,
|
|
350
|
-
ImageGenModelData
|
|
351
|
-
> = {
|
|
352
|
-
...ImageGenFalModelData,
|
|
353
|
-
...ImageGenGoogleModelData,
|
|
354
|
-
...ImageGenTogetherModelData,
|
|
355
|
-
...ImageGenFireworksModelData,
|
|
356
|
-
...ImageGenKieModelData,
|
|
357
|
-
...ImageGenWavespeedModelData,
|
|
358
|
-
};
|
|
359
|
-
|
|
360
125
|
export interface ImageGenParams {
|
|
361
126
|
steps?: number;
|
|
362
127
|
guidanceScale?: number;
|
|
@@ -364,165 +129,6 @@ export interface ImageGenParams {
|
|
|
364
129
|
highNoiseFrac?: number;
|
|
365
130
|
}
|
|
366
131
|
|
|
367
|
-
// ============================================================================
|
|
368
|
-
// Multi-Provider Image Gen Routing System
|
|
369
|
-
// ============================================================================
|
|
370
|
-
|
|
371
|
-
// Provider identifiers for image gen
|
|
372
|
-
export const imageGenProviders = [
|
|
373
|
-
'together',
|
|
374
|
-
'fireworks',
|
|
375
|
-
'fal',
|
|
376
|
-
'google',
|
|
377
|
-
'kie',
|
|
378
|
-
'wavespeed',
|
|
379
|
-
] as const;
|
|
380
|
-
|
|
381
|
-
export type ImageGenProvider = (typeof imageGenProviders)[number];
|
|
382
|
-
|
|
383
|
-
// Provider offering for an image model
|
|
384
|
-
export interface ImageGenProviderOffering {
|
|
385
|
-
provider: ImageGenProvider;
|
|
386
|
-
providerModel: ImageGenModelProvider;
|
|
387
|
-
available: boolean;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// Registry mapping clean model names to provider offerings
|
|
391
|
-
// Ordered by price (cheapest first)
|
|
392
|
-
// Note: FLUX Kontext models not included as they require reference images
|
|
393
|
-
|
|
394
|
-
export const imageGenMultiProviderModels: Record<
|
|
395
|
-
ImageGenModel,
|
|
396
|
-
ImageGenProviderOffering[]
|
|
397
|
-
> = {
|
|
398
|
-
flux_1_schnell: [
|
|
399
|
-
{
|
|
400
|
-
provider: 'wavespeed',
|
|
401
|
-
providerModel: 'wavespeed_flux_schnell',
|
|
402
|
-
available: true,
|
|
403
|
-
},
|
|
404
|
-
],
|
|
405
|
-
flux_1_dev: [
|
|
406
|
-
{
|
|
407
|
-
provider: 'fal',
|
|
408
|
-
providerModel: 'fal_flux_dev',
|
|
409
|
-
available: true,
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
provider: 'wavespeed',
|
|
413
|
-
providerModel: 'wavespeed_flux_dev',
|
|
414
|
-
available: true,
|
|
415
|
-
},
|
|
416
|
-
],
|
|
417
|
-
flux_1_pro: [
|
|
418
|
-
{
|
|
419
|
-
provider: 'together',
|
|
420
|
-
providerModel: 'together_flux_pro',
|
|
421
|
-
available: true,
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
provider: 'fireworks',
|
|
425
|
-
providerModel: 'fireworks_flux_pro',
|
|
426
|
-
available: true,
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
provider: 'fal',
|
|
430
|
-
providerModel: 'fal_flux_pro',
|
|
431
|
-
available: true,
|
|
432
|
-
},
|
|
433
|
-
],
|
|
434
|
-
flux_2_dev: [
|
|
435
|
-
{
|
|
436
|
-
provider: 'fal',
|
|
437
|
-
providerModel: 'fal_flux_2_dev',
|
|
438
|
-
available: true,
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
provider: 'wavespeed',
|
|
442
|
-
providerModel: 'wavespeed_flux_2_dev',
|
|
443
|
-
available: true,
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
provider: 'together',
|
|
447
|
-
providerModel: 'together_flux_2_dev',
|
|
448
|
-
available: true,
|
|
449
|
-
},
|
|
450
|
-
],
|
|
451
|
-
flux_2_pro: [
|
|
452
|
-
{
|
|
453
|
-
provider: 'together',
|
|
454
|
-
providerModel: 'together_flux_2_pro',
|
|
455
|
-
available: true,
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
provider: 'fal',
|
|
459
|
-
providerModel: 'fal_flux_2_pro',
|
|
460
|
-
available: true,
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
provider: 'wavespeed',
|
|
464
|
-
providerModel: 'wavespeed_flux_2_pro',
|
|
465
|
-
available: true,
|
|
466
|
-
},
|
|
467
|
-
],
|
|
468
|
-
flux_2_max: [
|
|
469
|
-
{
|
|
470
|
-
provider: 'together',
|
|
471
|
-
providerModel: 'together_flux_2_max',
|
|
472
|
-
available: true,
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
provider: 'wavespeed',
|
|
476
|
-
providerModel: 'wavespeed_flux_2_max',
|
|
477
|
-
available: true,
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
provider: 'fal',
|
|
481
|
-
providerModel: 'fal_flux_2_max',
|
|
482
|
-
available: true,
|
|
483
|
-
},
|
|
484
|
-
],
|
|
485
|
-
nano_banana: [
|
|
486
|
-
// Kie.ai same price as Google, but routes through multi-provider for fallback
|
|
487
|
-
{
|
|
488
|
-
provider: 'kie',
|
|
489
|
-
providerModel: 'kie_nano_banana',
|
|
490
|
-
available: true,
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
provider: 'google',
|
|
494
|
-
providerModel: 'google_nano',
|
|
495
|
-
available: true,
|
|
496
|
-
},
|
|
497
|
-
],
|
|
498
|
-
nano_banana_pro: [
|
|
499
|
-
// Kie.ai is 33% cheaper: $0.09 vs Google $0.134
|
|
500
|
-
{
|
|
501
|
-
provider: 'kie',
|
|
502
|
-
providerModel: 'kie_nano_banana_pro',
|
|
503
|
-
available: true,
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
provider: 'google',
|
|
507
|
-
providerModel: 'google_nano_pro',
|
|
508
|
-
available: true,
|
|
509
|
-
},
|
|
510
|
-
],
|
|
511
|
-
seedream: [
|
|
512
|
-
// Both $0.04/image, FAL first as existing provider
|
|
513
|
-
{
|
|
514
|
-
provider: 'fal',
|
|
515
|
-
providerModel: 'fal_seedream_v4_5',
|
|
516
|
-
available: true,
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
provider: 'wavespeed',
|
|
520
|
-
providerModel: 'wavespeed_seedream_v4_5',
|
|
521
|
-
available: true,
|
|
522
|
-
},
|
|
523
|
-
],
|
|
524
|
-
};
|
|
525
|
-
|
|
526
132
|
// ── Public AI API wire types ────────────────────────────────────────────────
|
|
527
133
|
|
|
528
134
|
const imageGenCallOptionsSchema = z.object({
|
|
@@ -533,7 +139,6 @@ const imageGenCallOptionsSchema = z.object({
|
|
|
533
139
|
guidanceScale: z.number().optional(),
|
|
534
140
|
negativePrompt: z.string().optional(),
|
|
535
141
|
captureDebugInfo: z.boolean().optional(),
|
|
536
|
-
priority: z.enum(['fast', 'cheap']).optional(),
|
|
537
142
|
});
|
|
538
143
|
|
|
539
144
|
export const imageGenInputSchema = z.object({
|