@sogni-ai/sogni-client 4.0.0-alpha.5 → 4.0.0-alpha.51

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 (109) hide show
  1. package/CHANGELOG.md +357 -0
  2. package/README.md +295 -58
  3. package/dist/Account/index.d.ts +18 -16
  4. package/dist/Account/index.js +42 -21
  5. package/dist/Account/index.js.map +1 -1
  6. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.d.ts +66 -0
  7. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js +332 -0
  8. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js.map +1 -0
  9. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.d.ts +28 -0
  10. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +203 -0
  11. package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -0
  12. package/dist/ApiClient/WebSocketClient/events.d.ts +12 -0
  13. package/dist/ApiClient/WebSocketClient/index.d.ts +2 -2
  14. package/dist/ApiClient/WebSocketClient/index.js +13 -3
  15. package/dist/ApiClient/WebSocketClient/index.js.map +1 -1
  16. package/dist/ApiClient/WebSocketClient/types.d.ts +13 -0
  17. package/dist/ApiClient/index.d.ts +4 -4
  18. package/dist/ApiClient/index.js +23 -4
  19. package/dist/ApiClient/index.js.map +1 -1
  20. package/dist/Projects/Job.d.ts +44 -4
  21. package/dist/Projects/Job.js +83 -16
  22. package/dist/Projects/Job.js.map +1 -1
  23. package/dist/Projects/Project.d.ts +18 -0
  24. package/dist/Projects/Project.js +38 -10
  25. package/dist/Projects/Project.js.map +1 -1
  26. package/dist/Projects/createJobRequestMessage.d.ts +2 -1
  27. package/dist/Projects/createJobRequestMessage.js +173 -14
  28. package/dist/Projects/createJobRequestMessage.js.map +1 -1
  29. package/dist/Projects/index.d.ts +114 -11
  30. package/dist/Projects/index.js +504 -47
  31. package/dist/Projects/index.js.map +1 -1
  32. package/dist/Projects/types/ComfySamplerParams.d.ts +0 -0
  33. package/dist/Projects/types/ComfySamplerParams.js +2 -0
  34. package/dist/Projects/types/ComfySamplerParams.js.map +1 -0
  35. package/dist/Projects/types/EstimationResponse.d.ts +2 -0
  36. package/dist/Projects/types/ModelOptions.d.ts +31 -0
  37. package/dist/Projects/types/ModelOptions.js +56 -0
  38. package/dist/Projects/types/ModelOptions.js.map +1 -0
  39. package/dist/Projects/types/ModelTiersRaw.d.ts +67 -0
  40. package/dist/Projects/types/ModelTiersRaw.js +15 -0
  41. package/dist/Projects/types/ModelTiersRaw.js.map +1 -0
  42. package/dist/Projects/types/events.d.ts +5 -1
  43. package/dist/Projects/types/index.d.ts +219 -42
  44. package/dist/Projects/types/index.js +8 -0
  45. package/dist/Projects/types/index.js.map +1 -1
  46. package/dist/Projects/utils/index.d.ts +20 -0
  47. package/dist/Projects/utils/index.js +91 -0
  48. package/dist/Projects/utils/index.js.map +1 -0
  49. package/dist/Projects/utils/samplers.d.ts +6 -0
  50. package/dist/Projects/utils/samplers.js +39 -0
  51. package/dist/Projects/utils/samplers.js.map +1 -0
  52. package/dist/Projects/utils/scheduler.d.ts +6 -0
  53. package/dist/Projects/utils/scheduler.js +30 -0
  54. package/dist/Projects/utils/scheduler.js.map +1 -0
  55. package/dist/index.d.ts +11 -3
  56. package/dist/index.js +8 -3
  57. package/dist/index.js.map +1 -1
  58. package/dist/lib/AuthManager/TokenAuthManager.js +0 -2
  59. package/dist/lib/AuthManager/TokenAuthManager.js.map +1 -1
  60. package/dist/lib/DataEntity.js +4 -2
  61. package/dist/lib/DataEntity.js.map +1 -1
  62. package/dist/lib/RestClient.js +15 -2
  63. package/dist/lib/RestClient.js.map +1 -1
  64. package/dist/lib/{utils.js → utils/index.js} +1 -1
  65. package/dist/lib/utils/index.js.map +1 -0
  66. package/dist/lib/validation.d.ts +31 -2
  67. package/dist/lib/validation.js +80 -13
  68. package/dist/lib/validation.js.map +1 -1
  69. package/package.json +4 -4
  70. package/src/Account/index.ts +39 -20
  71. package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.ts +426 -0
  72. package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/index.ts +237 -0
  73. package/src/ApiClient/WebSocketClient/events.ts +14 -0
  74. package/src/ApiClient/WebSocketClient/index.ts +15 -5
  75. package/src/ApiClient/WebSocketClient/types.ts +16 -0
  76. package/src/ApiClient/index.ts +30 -8
  77. package/src/Projects/Job.ts +97 -16
  78. package/src/Projects/Project.ts +46 -13
  79. package/src/Projects/createJobRequestMessage.ts +239 -34
  80. package/src/Projects/index.ts +533 -51
  81. package/src/Projects/types/ComfySamplerParams.ts +0 -0
  82. package/src/Projects/types/EstimationResponse.ts +2 -0
  83. package/src/Projects/types/ModelOptions.ts +92 -0
  84. package/src/Projects/types/ModelTiersRaw.ts +86 -0
  85. package/src/Projects/types/events.ts +6 -0
  86. package/src/Projects/types/index.ts +253 -45
  87. package/src/Projects/utils/index.ts +90 -0
  88. package/src/Projects/utils/samplers.ts +36 -0
  89. package/src/Projects/utils/scheduler.ts +27 -0
  90. package/src/index.ts +36 -9
  91. package/src/lib/AuthManager/TokenAuthManager.ts +0 -2
  92. package/src/lib/DataEntity.ts +4 -2
  93. package/src/lib/RestClient.ts +16 -2
  94. package/src/lib/validation.ts +90 -17
  95. package/dist/Projects/types/SamplerParams.d.ts +0 -15
  96. package/dist/Projects/types/SamplerParams.js +0 -21
  97. package/dist/Projects/types/SamplerParams.js.map +0 -1
  98. package/dist/Projects/types/SchedulerParams.d.ts +0 -13
  99. package/dist/Projects/types/SchedulerParams.js +0 -19
  100. package/dist/Projects/types/SchedulerParams.js.map +0 -1
  101. package/dist/Projects/utils.d.ts +0 -2
  102. package/dist/Projects/utils.js +0 -14
  103. package/dist/Projects/utils.js.map +0 -1
  104. package/dist/lib/utils.js.map +0 -1
  105. package/src/Projects/types/SamplerParams.ts +0 -19
  106. package/src/Projects/types/SchedulerParams.ts +0 -17
  107. package/src/Projects/utils.ts +0 -12
  108. /package/dist/lib/{utils.d.ts → utils/index.d.ts} +0 -0
  109. /package/src/lib/{utils.ts → utils/index.ts} +0 -0
@@ -1,17 +1,24 @@
1
1
  import { SupernetType } from '../../ApiClient/WebSocketClient/types';
2
2
  import { ControlNetParams } from './ControlNetParams';
3
3
  import { TokenType } from '../../types/token';
4
- import { Sampler } from './SamplerParams';
5
- import { Scheduler } from './SchedulerParams';
6
4
  export interface SupportedModel {
7
5
  id: string;
8
6
  name: string;
9
7
  SID: number;
8
+ tier: string;
9
+ /**
10
+ * Media type produced by this model: 'image' or 'video'
11
+ */
12
+ media: 'image' | 'video';
10
13
  }
11
14
  export interface AvailableModel {
12
15
  id: string;
13
16
  name: string;
14
17
  workerCount: number;
18
+ /**
19
+ * Media type produced by this model: 'image' or 'video'
20
+ */
21
+ media: 'image' | 'video';
15
22
  }
16
23
  export interface SizePreset {
17
24
  label: string;
@@ -21,14 +28,17 @@ export interface SizePreset {
21
28
  ratio: string;
22
29
  aspect: string;
23
30
  }
24
- export type { Sampler, Scheduler };
25
- export type OutputFormat = 'png' | 'jpg';
26
- export type InputImage = File | Buffer | Blob | boolean;
27
- export interface ProjectParams {
31
+ export type ImageOutputFormat = 'png' | 'jpg';
32
+ export type VideoOutputFormat = 'mp4';
33
+ export interface BaseProjectParams {
28
34
  /**
29
35
  * ID of the model to use, available models are available in the `availableModels` property of the `ProjectsApi` instance.
30
36
  */
31
37
  modelId: string;
38
+ /**
39
+ * Number of media files to generate. Depending on project type, this can be number of images or number of videos.
40
+ */
41
+ numberOfMedia: number;
32
42
  /**
33
43
  * Prompt for what to be created
34
44
  */
@@ -42,15 +52,17 @@ export interface ProjectParams {
42
52
  */
43
53
  stylePrompt: string;
44
54
  /**
45
- * Number of steps. For most Stable Diffusion models, optimal value is 20
55
+ * Number of steps. For most Stable Diffusion models, optimal value is 20.
46
56
  */
47
- steps: number;
57
+ steps?: number;
48
58
  /**
49
- * Guidance scale. For most Stable Diffusion models, optimal value is 7.5
59
+ * Guidance scale. For most Stable Diffusion models, optimal value is 7.5.
60
+ * For video models: Regular models range 0.7-8.0, LoRA version (lightx2v) range 0.7-1.6, step 0.01.
61
+ * This maps to `guidanceScale` in the keyFrame for both image and video models.
50
62
  */
51
- guidance: number;
63
+ guidance?: number;
52
64
  /**
53
- * Override current network type. Default value can be read from `client.account.currentAccount.network`
65
+ * Override current network type. Default value can be read from `sogni.account.currentAccount.network`
54
66
  */
55
67
  network?: SupernetType;
56
68
  /**
@@ -63,46 +75,161 @@ export interface ProjectParams {
63
75
  */
64
76
  seed?: number;
65
77
  /**
66
- * Number of images to generate
78
+ * Select which tokens to use for the project.
79
+ * If not specified, the Sogni token will be used.
67
80
  */
68
- numberOfImages: number;
81
+ tokenType?: TokenType;
69
82
  /**
70
- * Generate images based on the starting image.
71
- * Supported types:
72
- * `File` - file object from input[type=file]
73
- * `Buffer` - Node.js buffer object with image data
74
- * `Blob` - blob object with image data
75
- * `true` - indicates that the image is already uploaded to the server
83
+ * LoRA ID to use for generation.
84
+ * Available LoRAs are model-specific. The worker will download the LoRA
85
+ * if not already present on the persistent volume.
76
86
  */
77
- startingImage?: InputImage;
87
+ loraId?: string;
78
88
  /**
79
- * How strong effect of starting image should be. From 0 to 1, default 0.5
89
+ * Array of LoRA filenames to apply (for Qwen Image Edit workflows).
90
+ * Filenames should end with .safetensors.
91
+ * Example: ['qwen-image-edit-2511-multiple-angles-lora.safetensors']
80
92
  */
81
- startingImageStrength?: number;
93
+ loras?: string[];
94
+ /**
95
+ * Array of LoRA strengths corresponding to each LoRA in the loras array.
96
+ * Values should be between 0.0 and 2.0. Defaults to 1.0 if not specified.
97
+ * Example: [0.9]
98
+ */
99
+ loraStrengths?: number[];
100
+ }
101
+ export type InputMedia = File | Buffer | Blob | boolean;
102
+ /**
103
+ * Video-specific parameters for video workflows (t2v, i2v, s2v, animate).
104
+ * Only applicable when using video models like wan_v2.2-14b-fp8_t2v.
105
+ * Includes frame count, fps, shift, and reference assets (image, audio, video).
106
+ */
107
+ export interface VideoProjectParams extends BaseProjectParams {
108
+ type: 'video';
109
+ /**
110
+ * Number of frames to generate
111
+ * @deprecated Use duration instead
112
+ */
113
+ frames?: number;
114
+ /**
115
+ * Duration of the video in seconds. Supported range 1 to 10
116
+ */
117
+ duration?: number;
118
+ /**
119
+ * Frames per second for output video
120
+ */
121
+ fps?: number;
122
+ /**
123
+ * Shift parameter for video diffusion models.
124
+ * Controls motion intensity. Range: 1.0-8.0, step 0.1.
125
+ * Default: 8.0 for regular models, 5.0 for speed lora (lightx2v) except s2v and animate which use 8.0
126
+ */
127
+ shift?: number;
128
+ /**
129
+ * TeaCache optimization threshold for T2V and I2V models.
130
+ * Range: 0.0-1.0. 0.0 = disabled.
131
+ * Recommended: 0.15 for T2V (~1.5x speedup), 0.2 for I2V (conservative quality-focused)
132
+ */
133
+ teacacheThreshold?: number;
134
+ /**
135
+ * Reference image for WAN video workflows.
136
+ * Maps to: startImage (i2v), characterImage (animate), referenceImage (s2v)
137
+ */
138
+ referenceImage?: InputMedia;
139
+ /**
140
+ * Optional end image for i2v interpolation workflows.
141
+ * When provided with referenceImage, the video will interpolate between the two images.
142
+ */
143
+ referenceImageEnd?: InputMedia;
144
+ /**
145
+ * Reference audio for s2v (sound-to-video) workflows.
146
+ */
147
+ referenceAudio?: InputMedia;
148
+ /**
149
+ * Audio start position in seconds for s2v workflows.
150
+ * Specifies where to begin reading from the audio file.
151
+ * Default: 0
152
+ */
153
+ audioStart?: number;
154
+ /**
155
+ * Audio duration in seconds for s2v workflows.
156
+ * Specifies how many seconds of audio to use.
157
+ * If not provided, defaults to 30 seconds on the server.
158
+ */
159
+ audioDuration?: number;
160
+ /**
161
+ * Reference video for animate workflows.
162
+ * Maps to: drivingVideo (animate-move), sourceVideo (animate-replace)
163
+ */
164
+ referenceVideo?: InputMedia;
165
+ /**
166
+ * Video start position in seconds for animate workflows (animate-move, animate-replace).
167
+ * Specifies where to begin reading from the reference video file.
168
+ * Default: 0
169
+ */
170
+ videoStart?: number;
171
+ /**
172
+ * Output video width. Only used if `sizePreset` is "custom"
173
+ */
174
+ width?: number;
175
+ /**
176
+ * Output video height. Only used if `sizePreset` is "custom"
177
+ */
178
+ height?: number;
179
+ /**
180
+ * Sampler, available options depend on the model. Use `sogni.projects.getModelOptions(modelId)`
181
+ * to get the list of available samplers.
182
+ */
183
+ sampler?: string;
184
+ /**
185
+ * Scheduler, available options depend on the model. Use `sogni.projects.getModelOptions(modelId)`
186
+ * to get the list of available schedulers.
187
+ */
188
+ scheduler?: string;
189
+ /**
190
+ * Output video format. For now only 'mp4' is supported, defaults to 'mp4'.
191
+ */
192
+ outputFormat?: VideoOutputFormat;
193
+ }
194
+ export interface ImageProjectParams extends BaseProjectParams {
195
+ type: 'image';
196
+ /**
197
+ * Number of previews to generate. Note that previews affect project cost
198
+ */
199
+ numberOfPreviews?: number;
82
200
  /**
83
- * Context images for Flux Kontext model. Flux Kontext support up to 2 context images.
201
+ * Starting image for img2img workflows.
84
202
  * Supported types:
85
203
  * `File` - file object from input[type=file]
86
204
  * `Buffer` - Node.js buffer object with image data
87
205
  * `Blob` - blob object with image data
88
206
  * `true` - indicates that the image is already uploaded to the server
89
207
  */
90
- contextImages?: InputImage[];
208
+ startingImage?: InputMedia;
91
209
  /**
92
- * Number of previews to generate. Note that previews affect project cost\
210
+ * How strong effect of starting image should be. From 0 to 1, default 0.5
93
211
  */
94
- numberOfPreviews?: number;
212
+ startingImageStrength?: number;
213
+ /**
214
+ * Context images for multi-reference image generation.
215
+ * Flux.2 Dev supports up to 6 context images.
216
+ * Qwen Image Edit Plus supports up to 3 context images.
217
+ * Flux Kontext supports up to 2 context images.
218
+ */
219
+ contextImages?: InputMedia[];
95
220
  /**
96
- * Scheduler to use
221
+ * Sampler, available options depend on the model. Use `sogni.projects.getModelOptions(modelId)`
222
+ * to get the list of available samplers.
97
223
  */
98
- sampler?: Sampler;
224
+ sampler?: string;
99
225
  /**
100
- * Time step spacing method
226
+ * Scheduler, available options depend on the model. Use `sogni.projects.getModelOptions(modelId)`
227
+ * to get the list of available schedulers.
101
228
  */
102
- scheduler?: Scheduler;
229
+ scheduler?: string;
103
230
  /**
104
231
  * Size preset ID to use. You can query available size presets
105
- * from `client.projects.sizePresets(network, modelId)`
232
+ * from `sogni.projects.sizePresets(network, modelId)`
106
233
  */
107
234
  sizePreset?: 'custom' | string;
108
235
  /**
@@ -118,22 +245,38 @@ export interface ProjectParams {
118
245
  */
119
246
  controlNet?: ControlNetParams;
120
247
  /**
121
- * Select which tokens to use for the project.
122
- * If not specified, the Sogni token will be used.
123
- */
124
- tokenType?: TokenType;
125
- /**
126
- * Output image format. Can be 'png' or 'jpg'.
127
- * If not specified, 'png' will be used.
248
+ * Output format. Can be 'png' or 'jpg'. Defaults to 'png'.
128
249
  */
129
- outputFormat?: OutputFormat;
250
+ outputFormat?: ImageOutputFormat;
130
251
  }
252
+ export type ProjectParams = ImageProjectParams | VideoProjectParams;
253
+ export declare function isVideoParams(params: ProjectParams): params is VideoProjectParams;
254
+ export declare function isImageParams(params: ProjectParams): params is ImageProjectParams;
255
+ /**
256
+ * Supported audio formats
257
+ */
258
+ export type AudioFormat = 'm4a' | 'mp3' | 'wav';
259
+ /**
260
+ * Supported video formats
261
+ */
262
+ export type VideoFormat = 'mp4' | 'mov';
263
+ /**
264
+ * Parameters for image asset URL requests (upload/download)
265
+ */
131
266
  export type ImageUrlParams = {
132
267
  imageId: string;
133
268
  jobId: string;
134
- type: 'preview' | 'complete' | 'startingImage' | 'cnImage' | 'contextImage1' | 'contextImage2';
269
+ type: 'preview' | 'complete' | 'startingImage' | 'cnImage' | 'contextImage1' | 'contextImage2' | 'contextImage3' | 'contextImage4' | 'contextImage5' | 'contextImage6' | 'referenceImage' | 'referenceImageEnd';
135
270
  startContentType?: string;
136
271
  };
272
+ /**
273
+ * Parameters for media asset URL requests (video/audio upload/download)
274
+ */
275
+ export type MediaUrlParams = {
276
+ id?: string;
277
+ jobId: string;
278
+ type: 'complete' | 'preview' | 'referenceAudio' | 'referenceVideo';
279
+ };
137
280
  export interface EstimateRequest {
138
281
  /**
139
282
  * Network to use. Can be 'fast' or 'relaxed'
@@ -186,13 +329,47 @@ export interface EstimateRequest {
186
329
  */
187
330
  guidance?: number;
188
331
  /**
189
- * Scheduler
332
+ * Sampler
190
333
  */
191
- scheduler?: Sampler;
334
+ sampler?: string;
192
335
  /**
193
336
  * Number of context images to use (for Flux Kontext).
194
337
  * Note that this parameter is ignored if `scheduler` is not provided
195
338
  */
196
339
  contextImages?: number;
197
340
  }
341
+ export interface VideoEstimateRequest {
342
+ tokenType: TokenType;
343
+ model: string;
344
+ width: number;
345
+ height: number;
346
+ duration: number;
347
+ /**
348
+ * Number of frames to generate.
349
+ * @deprecated Use duration instead
350
+ */
351
+ frames?: number;
352
+ fps: number;
353
+ steps: number;
354
+ numberOfMedia: number;
355
+ }
356
+ /**
357
+ * Represents estimation of project cost in different currency formats
358
+ */
359
+ export interface CostEstimation {
360
+ /** Cost in selected token type */
361
+ token: string;
362
+ /** Cost in USD */
363
+ usd: string;
364
+ /** Cost in Spark Points */
365
+ spark: string;
366
+ /** Cost in Sogni tokens */
367
+ sogni: string;
368
+ }
198
369
  export type EnhancementStrength = 'light' | 'medium' | 'heavy';
370
+ /**
371
+ * Video workflow types for WAN models
372
+ */
373
+ export type VideoWorkflowType = 't2v' | 'i2v' | 's2v' | 'animate-move' | 'animate-replace' | null;
374
+ export type AssetRequirement = 'required' | 'optional' | 'forbidden';
375
+ export type VideoAssetKey = 'referenceImage' | 'referenceImageEnd' | 'referenceAudio' | 'referenceVideo';
@@ -1,3 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isVideoParams = isVideoParams;
4
+ exports.isImageParams = isImageParams;
5
+ function isVideoParams(params) {
6
+ return params.type === 'video';
7
+ }
8
+ function isImageParams(params) {
9
+ return params.type === 'image';
10
+ }
3
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Projects/types/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Projects/types/index.ts"],"names":[],"mappings":";;AAsQA,sCAEC;AAED,sCAEC;AAND,SAAgB,aAAa,CAAC,MAAqB;IACjD,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;AACjC,CAAC;AAED,SAAgB,aAAa,CAAC,MAAqB;IACjD,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;AACjC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { AssetRequirement, EnhancementStrength, VideoAssetKey, VideoWorkflowType } from '../types';
2
+ export declare function getEnhacementStrength(strength: EnhancementStrength): number;
3
+ /**
4
+ * Check if a model ID is for a video workflow.
5
+ * This is consistent with the `media` property returned by the models list API.
6
+ * Video models produce MP4 output; image models produce PNG/JPG output.
7
+ */
8
+ export declare function isVideoModel(modelId: string): boolean;
9
+ /**
10
+ * Get the video workflow type from a model ID.
11
+ * Returns null for non-video models.
12
+ */
13
+ export declare function getVideoWorkflowType(modelId: string): VideoWorkflowType;
14
+ /**
15
+ * Asset requirements for each video workflow type.
16
+ * - required: Must be provided
17
+ * - optional: Can be provided
18
+ * - forbidden: Must NOT be provided
19
+ */
20
+ export declare const VIDEO_WORKFLOW_ASSETS: Record<NonNullable<VideoWorkflowType>, Record<VideoAssetKey, AssetRequirement>>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VIDEO_WORKFLOW_ASSETS = void 0;
4
+ exports.getEnhacementStrength = getEnhacementStrength;
5
+ exports.isVideoModel = isVideoModel;
6
+ exports.getVideoWorkflowType = getVideoWorkflowType;
7
+ function getEnhacementStrength(strength) {
8
+ switch (strength) {
9
+ case 'light':
10
+ return 0.15;
11
+ case 'heavy':
12
+ return 0.49;
13
+ default:
14
+ return 0.35;
15
+ }
16
+ }
17
+ /**
18
+ * Check if a model ID is for a video workflow.
19
+ * This is consistent with the `media` property returned by the models list API.
20
+ * Video models produce MP4 output; image models produce PNG/JPG output.
21
+ */
22
+ function isVideoModel(modelId) {
23
+ return modelId.startsWith('wan_') || modelId.startsWith('ltx2-');
24
+ }
25
+ /**
26
+ * Get the video workflow type from a model ID.
27
+ * Returns null for non-video models.
28
+ */
29
+ function getVideoWorkflowType(modelId) {
30
+ if (!modelId)
31
+ return null;
32
+ // Check for supported video model prefixes
33
+ const isWan = modelId.startsWith('wan_');
34
+ const isLtx2 = modelId.startsWith('ltx2-');
35
+ if (!isWan && !isLtx2)
36
+ return null;
37
+ // WAN and LTX-2 models share similar workflow type suffixes
38
+ if (modelId.includes('_i2v'))
39
+ return 'i2v';
40
+ if (modelId.includes('_t2v'))
41
+ return 't2v';
42
+ // WAN-specific workflow types
43
+ if (isWan) {
44
+ if (modelId.includes('_s2v'))
45
+ return 's2v';
46
+ if (modelId.includes('_animate-move'))
47
+ return 'animate-move';
48
+ if (modelId.includes('_animate-replace'))
49
+ return 'animate-replace';
50
+ }
51
+ return null;
52
+ }
53
+ /**
54
+ * Asset requirements for each video workflow type.
55
+ * - required: Must be provided
56
+ * - optional: Can be provided
57
+ * - forbidden: Must NOT be provided
58
+ */
59
+ exports.VIDEO_WORKFLOW_ASSETS = {
60
+ t2v: {
61
+ referenceImage: 'forbidden',
62
+ referenceImageEnd: 'forbidden',
63
+ referenceAudio: 'forbidden',
64
+ referenceVideo: 'forbidden'
65
+ },
66
+ i2v: {
67
+ referenceImage: 'optional',
68
+ referenceImageEnd: 'optional',
69
+ referenceAudio: 'forbidden',
70
+ referenceVideo: 'forbidden'
71
+ },
72
+ s2v: {
73
+ referenceImage: 'required',
74
+ referenceAudio: 'required',
75
+ referenceImageEnd: 'forbidden',
76
+ referenceVideo: 'forbidden'
77
+ },
78
+ 'animate-move': {
79
+ referenceImage: 'required',
80
+ referenceVideo: 'required',
81
+ referenceImageEnd: 'forbidden',
82
+ referenceAudio: 'forbidden'
83
+ },
84
+ 'animate-replace': {
85
+ referenceImage: 'required',
86
+ referenceVideo: 'required',
87
+ referenceImageEnd: 'forbidden',
88
+ referenceAudio: 'forbidden'
89
+ }
90
+ };
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Projects/utils/index.ts"],"names":[],"mappings":";;;AAEA,sDASC;AAOD,oCAEC;AAMD,oDAqBC;AA7CD,SAAgB,qBAAqB,CAAC,QAA6B;IACjE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QACd,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QACd;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,2CAA2C;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAE3C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEnC,4DAA4D;IAC5D,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3C,8BAA8B;IAC9B,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;YAAE,OAAO,cAAc,CAAC;QAC7D,IAAI,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAAE,OAAO,iBAAiB,CAAC;IACrE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACU,QAAA,qBAAqB,GAG9B;IACF,GAAG,EAAE;QACH,cAAc,EAAE,WAAW;QAC3B,iBAAiB,EAAE,WAAW;QAC9B,cAAc,EAAE,WAAW;QAC3B,cAAc,EAAE,WAAW;KAC5B;IACD,GAAG,EAAE;QACH,cAAc,EAAE,UAAU;QAC1B,iBAAiB,EAAE,UAAU;QAC7B,cAAc,EAAE,WAAW;QAC3B,cAAc,EAAE,WAAW;KAC5B;IACD,GAAG,EAAE;QACH,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;QAC1B,iBAAiB,EAAE,WAAW;QAC9B,cAAc,EAAE,WAAW;KAC5B;IACD,cAAc,EAAE;QACd,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;QAC1B,iBAAiB,EAAE,WAAW;QAC9B,cAAc,EAAE,WAAW;KAC5B;IACD,iBAAiB,EAAE;QACjB,cAAc,EAAE,UAAU;QAC1B,cAAc,EAAE,UAAU;QAC1B,iBAAiB,EAAE,WAAW;QAC9B,cAAc,EAAE,WAAW;KAC5B;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert a sampler display name to its alias.
3
+ * If already an alias or unknown, returns unchanged.
4
+ * Used to normalize API tier data for consistent validation.
5
+ */
6
+ export declare function samplerValueToAlias(value: string): string;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.samplerValueToAlias = samplerValueToAlias;
4
+ /**
5
+ * Maps display name formats (from API) to lowercase aliases.
6
+ * Used to normalize the allowed sampler list so users can use consistent aliases.
7
+ */
8
+ const SamplerDisplayToAlias = {
9
+ Euler: 'euler',
10
+ 'Euler a': 'euler_a',
11
+ 'Euler Ancestral': 'euler_ancestral',
12
+ Heun: 'heun',
13
+ 'DPM++ 2M': 'dpmpp_2m',
14
+ 'DPM++ 2M SDE': 'dpmpp_2m_sde',
15
+ 'DPM++ SDE': 'dpmpp_sde',
16
+ 'DPM++ 3M SDE': 'dpmpp_3m_sde',
17
+ UniPC: 'uni_pc',
18
+ 'LCM (Latent Consistency Model)': 'lcm',
19
+ LMS: 'lms',
20
+ 'DPM 2': 'dpm_2',
21
+ 'DPM 2 Ancestral': 'dpm_2_ancestral',
22
+ 'DPM Fast': 'dpm_fast',
23
+ 'DPM Adaptive': 'dpm_adaptive',
24
+ 'DPM++ 2S Ancestral': 'dpmpp_2s_ancestral',
25
+ DDPM: 'ddpm',
26
+ 'Discrete Flow Sampler (SD3)': 'dfs_sd3',
27
+ 'Discrete Flow Scheduler (SD3)': 'dfs_sd3',
28
+ 'DPM Solver Multistep (DPM-Solver++)': 'dpm_pp',
29
+ 'PNDM (Pseudo-linear multi-step)': 'pndm_plms'
30
+ };
31
+ /**
32
+ * Convert a sampler display name to its alias.
33
+ * If already an alias or unknown, returns unchanged.
34
+ * Used to normalize API tier data for consistent validation.
35
+ */
36
+ function samplerValueToAlias(value) {
37
+ return SamplerDisplayToAlias[value] || value;
38
+ }
39
+ //# sourceMappingURL=samplers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"samplers.js","sourceRoot":"","sources":["../../../src/Projects/utils/samplers.ts"],"names":[],"mappings":";;AAiCA,kDAEC;AAnCD;;;GAGG;AACH,MAAM,qBAAqB,GAA2B;IACpD,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,SAAS;IACpB,iBAAiB,EAAE,iBAAiB;IACpC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,cAAc;IAC9B,WAAW,EAAE,WAAW;IACxB,cAAc,EAAE,cAAc;IAC9B,KAAK,EAAE,QAAQ;IACf,gCAAgC,EAAE,KAAK;IACvC,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,OAAO;IAChB,iBAAiB,EAAE,iBAAiB;IACpC,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,cAAc;IAC9B,oBAAoB,EAAE,oBAAoB;IAC1C,IAAI,EAAE,MAAM;IACZ,6BAA6B,EAAE,SAAS;IACxC,+BAA+B,EAAE,SAAS;IAC1C,qCAAqC,EAAE,QAAQ;IAC/C,iCAAiC,EAAE,WAAW;CAC/C,CAAC;AAEF;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,qBAAqB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert a scheduler display name to its alias.
3
+ * If already an alias or unknown, returns unchanged.
4
+ * Used to normalize API tier data for consistent validation.
5
+ */
6
+ export declare function schedulerValueToAlias(value: string): string;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schedulerValueToAlias = schedulerValueToAlias;
4
+ /**
5
+ * Maps display name formats (from API) to lowercase aliases.
6
+ * Used to normalize the allowed scheduler list so users can use consistent aliases.
7
+ */
8
+ const SchedulerDisplayToAlias = {
9
+ Simple: 'simple',
10
+ Normal: 'normal',
11
+ Karras: 'karras',
12
+ Exponential: 'exponential',
13
+ 'SGM Uniform': 'sgm_uniform',
14
+ 'DDIM Uniform': 'ddim_uniform',
15
+ Beta: 'beta',
16
+ 'Linear Quadratic': 'linear_quadratic',
17
+ 'KL Optimal': 'kl_optimal',
18
+ DDIM: 'ddim',
19
+ Leading: 'leading',
20
+ Linear: 'linear'
21
+ };
22
+ /**
23
+ * Convert a scheduler display name to its alias.
24
+ * If already an alias or unknown, returns unchanged.
25
+ * Used to normalize API tier data for consistent validation.
26
+ */
27
+ function schedulerValueToAlias(value) {
28
+ return SchedulerDisplayToAlias[value] || value;
29
+ }
30
+ //# sourceMappingURL=scheduler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../../src/Projects/utils/scheduler.ts"],"names":[],"mappings":";;AAwBA,sDAEC;AA1BD;;;GAGG;AACH,MAAM,uBAAuB,GAA2B;IACtD,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,aAAa;IAC5B,cAAc,EAAE,cAAc;IAC9B,IAAI,EAAE,MAAM;IACZ,kBAAkB,EAAE,kBAAkB;IACtC,YAAY,EAAE,YAAY;IAC1B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,uBAAuB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AACjD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,12 +6,12 @@ import { Logger, LogLevel } from './lib/DefaultLogger';
6
6
  import ProjectsApi from './Projects';
7
7
  import Job, { JobStatus } from './Projects/Job';
8
8
  import Project, { ProjectStatus } from './Projects/Project';
9
- import { AvailableModel, OutputFormat, ProjectParams, Sampler, Scheduler } from './Projects/types';
9
+ import { AvailableModel, ImageProjectParams, ImageOutputFormat, ProjectParams, VideoProjectParams, AudioFormat, VideoFormat, VideoOutputFormat, VideoWorkflowType } from './Projects/types';
10
10
  import StatsApi from './Stats';
11
11
  import ErrorData from './types/ErrorData';
12
12
  import { TokenType } from './types/token';
13
13
  import { TokenAuthData } from './lib/AuthManager';
14
- export type { AvailableModel, ErrorData, JobStatus, Logger, LogLevel, OutputFormat, ProjectParams, ProjectStatus, Sampler, SupernetType, Scheduler, TokenType };
14
+ export type { AudioFormat, AvailableModel, ErrorData, ImageProjectParams, ImageOutputFormat, JobStatus, Logger, LogLevel, ProjectParams, ProjectStatus, SupernetType, TokenType, VideoFormat, VideoOutputFormat, VideoProjectParams, VideoWorkflowType };
15
15
  export { ApiError, CurrentAccount, Job, Project };
16
16
  export interface SogniClientConfig {
17
17
  /**
@@ -30,7 +30,7 @@ export interface SogniClientConfig {
30
30
  socketEndpoint?: string;
31
31
  /**
32
32
  * Disable WebSocket connection. Useful for testing or when WebSocket is not needed.
33
- * Note that many may not work without WebSocket connection.
33
+ * Note that many APIs may not work without WebSocket connection.
34
34
  * @experimental
35
35
  * @internal
36
36
  */
@@ -62,6 +62,14 @@ export interface SogniClientConfig {
62
62
  * @experimental
63
63
  */
64
64
  authType?: 'token' | 'cookies';
65
+ /**
66
+ * Browser only. If true, the client will use a single WebSocket connection shared across multiple
67
+ * tabs. This is useful for browser apps that need to process multiple projects at the same time.
68
+ * Only works in browser environment and with cookie authentication.
69
+ * @default false
70
+ * @experimental
71
+ */
72
+ multiInstance?: boolean;
65
73
  }
66
74
  export declare class SogniClient {
67
75
  account: AccountApi;
package/dist/index.js CHANGED
@@ -92,9 +92,13 @@ class SogniClient {
92
92
  throw Error('This method should only be called when using cookie auth');
93
93
  }
94
94
  try {
95
- yield this.apiClient.rest.get('/v1/account/me');
95
+ const res = yield this.apiClient.rest.get('/v1/account/me');
96
96
  yield auth.authenticate();
97
- yield this.account.me();
97
+ this.currentAccount._update({
98
+ username: res.data.username,
99
+ email: res.data.currentEmail,
100
+ walletAddress: res.data.walletAddress
101
+ });
98
102
  return true;
99
103
  }
100
104
  catch (e) {
@@ -121,7 +125,8 @@ class SogniClient {
121
125
  networkType: network,
122
126
  logger,
123
127
  authType: config.authType || 'token',
124
- disableSocket: config.disableSocket
128
+ disableSocket: config.disableSocket,
129
+ multiInstance: config.multiInstance
125
130
  });
126
131
  const eip712 = new EIP712Helper_1.default({
127
132
  name: isTestnet ? 'Sogni-testnet' : 'Sogni AI',
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3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