@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
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Maps display name formats (from API) to lowercase aliases.
3
+ * Used to normalize the allowed sampler list so users can use consistent aliases.
4
+ */
5
+ const SamplerDisplayToAlias: Record<string, string> = {
6
+ Euler: 'euler',
7
+ 'Euler a': 'euler_a',
8
+ 'Euler Ancestral': 'euler_ancestral',
9
+ Heun: 'heun',
10
+ 'DPM++ 2M': 'dpmpp_2m',
11
+ 'DPM++ 2M SDE': 'dpmpp_2m_sde',
12
+ 'DPM++ SDE': 'dpmpp_sde',
13
+ 'DPM++ 3M SDE': 'dpmpp_3m_sde',
14
+ UniPC: 'uni_pc',
15
+ 'LCM (Latent Consistency Model)': 'lcm',
16
+ LMS: 'lms',
17
+ 'DPM 2': 'dpm_2',
18
+ 'DPM 2 Ancestral': 'dpm_2_ancestral',
19
+ 'DPM Fast': 'dpm_fast',
20
+ 'DPM Adaptive': 'dpm_adaptive',
21
+ 'DPM++ 2S Ancestral': 'dpmpp_2s_ancestral',
22
+ DDPM: 'ddpm',
23
+ 'Discrete Flow Sampler (SD3)': 'dfs_sd3',
24
+ 'Discrete Flow Scheduler (SD3)': 'dfs_sd3',
25
+ 'DPM Solver Multistep (DPM-Solver++)': 'dpm_pp',
26
+ 'PNDM (Pseudo-linear multi-step)': 'pndm_plms'
27
+ };
28
+
29
+ /**
30
+ * Convert a sampler display name to its alias.
31
+ * If already an alias or unknown, returns unchanged.
32
+ * Used to normalize API tier data for consistent validation.
33
+ */
34
+ export function samplerValueToAlias(value: string): string {
35
+ return SamplerDisplayToAlias[value] || value;
36
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Maps display name formats (from API) to lowercase aliases.
3
+ * Used to normalize the allowed scheduler list so users can use consistent aliases.
4
+ */
5
+ const SchedulerDisplayToAlias: Record<string, string> = {
6
+ Simple: 'simple',
7
+ Normal: 'normal',
8
+ Karras: 'karras',
9
+ Exponential: 'exponential',
10
+ 'SGM Uniform': 'sgm_uniform',
11
+ 'DDIM Uniform': 'ddim_uniform',
12
+ Beta: 'beta',
13
+ 'Linear Quadratic': 'linear_quadratic',
14
+ 'KL Optimal': 'kl_optimal',
15
+ DDIM: 'ddim',
16
+ Leading: 'leading',
17
+ Linear: 'linear'
18
+ };
19
+
20
+ /**
21
+ * Convert a scheduler display name to its alias.
22
+ * If already an alias or unknown, returns unchanged.
23
+ * Used to normalize API tier data for consistent validation.
24
+ */
25
+ export function schedulerValueToAlias(value: string): string {
26
+ return SchedulerDisplayToAlias[value] || value;
27
+ }
package/src/index.ts CHANGED
@@ -12,7 +12,17 @@ import EIP712Helper from './lib/EIP712Helper';
12
12
  import ProjectsApi from './Projects';
13
13
  import Job, { JobStatus } from './Projects/Job';
14
14
  import Project, { ProjectStatus } from './Projects/Project';
15
- import { AvailableModel, OutputFormat, ProjectParams, Sampler, Scheduler } from './Projects/types';
15
+ import {
16
+ AvailableModel,
17
+ ImageProjectParams,
18
+ ImageOutputFormat,
19
+ ProjectParams,
20
+ VideoProjectParams,
21
+ AudioFormat,
22
+ VideoFormat,
23
+ VideoOutputFormat,
24
+ VideoWorkflowType
25
+ } from './Projects/types';
16
26
  // Stats API
17
27
  import StatsApi from './Stats';
18
28
  // Base Types
@@ -22,18 +32,22 @@ import { CookieAuthManager, TokenAuthData, TokenAuthManager } from './lib/AuthMa
22
32
  import { MeData } from './Account/types';
23
33
 
24
34
  export type {
35
+ AudioFormat,
25
36
  AvailableModel,
26
37
  ErrorData,
38
+ ImageProjectParams,
39
+ ImageOutputFormat,
27
40
  JobStatus,
28
41
  Logger,
29
42
  LogLevel,
30
- OutputFormat,
31
43
  ProjectParams,
32
44
  ProjectStatus,
33
- Sampler,
34
45
  SupernetType,
35
- Scheduler,
36
- TokenType
46
+ TokenType,
47
+ VideoFormat,
48
+ VideoOutputFormat,
49
+ VideoProjectParams,
50
+ VideoWorkflowType
37
51
  };
38
52
 
39
53
  export { ApiError, CurrentAccount, Job, Project };
@@ -55,7 +69,7 @@ export interface SogniClientConfig {
55
69
  socketEndpoint?: string;
56
70
  /**
57
71
  * Disable WebSocket connection. Useful for testing or when WebSocket is not needed.
58
- * Note that many may not work without WebSocket connection.
72
+ * Note that many APIs may not work without WebSocket connection.
59
73
  * @experimental
60
74
  * @internal
61
75
  */
@@ -87,6 +101,14 @@ export interface SogniClientConfig {
87
101
  * @experimental
88
102
  */
89
103
  authType?: 'token' | 'cookies';
104
+ /**
105
+ * Browser only. If true, the client will use a single WebSocket connection shared across multiple
106
+ * tabs. This is useful for browser apps that need to process multiple projects at the same time.
107
+ * Only works in browser environment and with cookie authentication.
108
+ * @default false
109
+ * @experimental
110
+ */
111
+ multiInstance?: boolean;
90
112
  }
91
113
 
92
114
  export class SogniClient {
@@ -133,9 +155,13 @@ export class SogniClient {
133
155
  throw Error('This method should only be called when using cookie auth');
134
156
  }
135
157
  try {
136
- await this.apiClient.rest.get<ApiResponse<MeData>>('/v1/account/me');
158
+ const res = await this.apiClient.rest.get<ApiResponse<MeData>>('/v1/account/me');
137
159
  await auth.authenticate();
138
- await this.account.me();
160
+ this.currentAccount._update({
161
+ username: res.data.username,
162
+ email: res.data.currentEmail,
163
+ walletAddress: res.data.walletAddress
164
+ });
139
165
  return true;
140
166
  } catch (e) {
141
167
  this.apiClient.logger.info('Client is not authenticated');
@@ -161,7 +187,8 @@ export class SogniClient {
161
187
  networkType: network,
162
188
  logger,
163
189
  authType: config.authType || 'token',
164
- disableSocket: config.disableSocket
190
+ disableSocket: config.disableSocket,
191
+ multiInstance: config.multiInstance
165
192
  });
166
193
  const eip712 = new EIP712Helper({
167
194
  name: isTestnet ? 'Sogni-testnet' : 'Sogni AI',
@@ -46,7 +46,6 @@ class TokenAuthManager extends AuthManagerBase<TokenAuthData | null> {
46
46
  const { expiresAt } = decodeToken(token);
47
47
  if (expiresAt > new Date()) {
48
48
  this._updateTokens({ token, refreshToken });
49
- this.emit('updated', true);
50
49
  return;
51
50
  }
52
51
  }
@@ -55,7 +54,6 @@ class TokenAuthManager extends AuthManagerBase<TokenAuthData | null> {
55
54
  const { expiresAt: refreshExpiresAt } = decodeRefreshToken(refreshToken);
56
55
  this._refreshTokenExpiresAt = refreshExpiresAt;
57
56
  await this._renewTokenSafe();
58
- this.emit('updated', true);
59
57
  }
60
58
 
61
59
  clear() {
@@ -25,9 +25,11 @@ abstract class DataEntity<D, E extends EntityEvents = EntityEvents> extends Type
25
25
  _update(delta: Partial<D>) {
26
26
  //@ts-ignore
27
27
  const changedKeys = Object.keys(delta).filter((key) => this.data[key] !== delta[key]);
28
- this.data = { ...this.data, ...delta };
29
28
  this.lastUpdated = new Date();
30
- this.emit('updated', changedKeys);
29
+ if (changedKeys.length > 0) {
30
+ this.data = { ...this.data, ...delta };
31
+ this.emit('updated', changedKeys);
32
+ }
31
33
  }
32
34
 
33
35
  /**
@@ -30,7 +30,21 @@ class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
30
30
 
31
31
  private async request<T = JSONValue>(url: string, options: RequestInit = {}): Promise<T> {
32
32
  const init = await this.auth.authenticateRequest(options);
33
- return fetch(url, init).then((r) => this.processResponse(r) as T);
33
+
34
+ // Add a timeout to detect hanging requests
35
+ const controller = new AbortController();
36
+ const timeoutId = setTimeout(() => {
37
+ controller.abort();
38
+ }, 30000);
39
+
40
+ try {
41
+ const response = await fetch(url, { ...init, signal: controller.signal });
42
+ clearTimeout(timeoutId);
43
+ return this.processResponse(response) as T;
44
+ } catch (fetchError: any) {
45
+ clearTimeout(timeoutId);
46
+ throw fetchError;
47
+ }
34
48
  }
35
49
 
36
50
  private async processResponse(response: Response): Promise<JSONValue> {
@@ -52,7 +66,7 @@ class RestClient<E extends EventMap = never> extends TypedEventEmitter<E> {
52
66
  }
53
67
 
54
68
  get<T = JSONValue>(path: string, query: Record<string, any> = {}): Promise<T> {
55
- return this.request<T>(this.formatUrl(path, query), query);
69
+ return this.request<T>(this.formatUrl(path, query));
56
70
  }
57
71
 
58
72
  post<T = JSONValue>(path: string, body: Record<string, unknown> = {}): Promise<T> {
@@ -1,10 +1,22 @@
1
- import { isSampler, SamplerMap } from '../Projects/types/SamplerParams';
2
- import { isScheduler, SchedulerMap } from '../Projects/types/SchedulerParams';
1
+ import { ApiError } from '../ApiClient';
2
+ import { ModelOptions } from '../Projects/types/ModelOptions';
3
3
 
4
4
  export function validateCustomImageSize(value: any): number {
5
5
  return validateNumber(value, { min: 256, max: 2048, propertyName: 'Width and height' });
6
6
  }
7
7
 
8
+ /**
9
+ * Validate video dimensions for Wan 2.2 models.
10
+ * Minimum dimension is 480px for both width and height.
11
+ */
12
+ export function validateVideoSize(value: any, propertyName: 'width' | 'height'): number {
13
+ return validateNumber(value, { min: 480, propertyName: `Video ${propertyName}` });
14
+ }
15
+
16
+ export function validateVideoDuration(value: any): number {
17
+ return validateNumber(value, { min: 1, max: 10, propertyName: 'Video duration' });
18
+ }
19
+
8
20
  interface NumberValidationOptions {
9
21
  min?: number;
10
22
  max?: number;
@@ -42,26 +54,87 @@ export function validateNumber(
42
54
  return number;
43
55
  }
44
56
 
45
- export function validateSampler(value?: string) {
46
- if (!value) {
47
- return null;
57
+ /**
58
+ * Validate teacacheThreshold for T2V and I2V models.
59
+ * Range: 0.0-1.0. 0.0 = disabled.
60
+ */
61
+ export function validateTeacacheThreshold(value?: number): number | undefined {
62
+ if (value === undefined || value === null) {
63
+ return undefined;
48
64
  }
49
- if (!isSampler(value)) {
50
- throw new Error(
51
- `Invalid sampler: ${value}. Supported options: ${Object.keys(SamplerMap).join(', ')}`
52
- );
65
+ const num = Number(value);
66
+ if (isNaN(num)) {
67
+ throw new Error(`teacacheThreshold must be a number, got ${value}`);
53
68
  }
54
- return SamplerMap[value];
69
+ if (num < 0.0 || num > 1.0) {
70
+ throw new Error(`teacacheThreshold must be between 0.0 and 1.0 (got ${num})`);
71
+ }
72
+ return num;
73
+ }
74
+
75
+ export function isComfyModel(modelId: string): boolean {
76
+ const COMFY_PREFIXES = ['z_image_', 'qwen_image_', 'flux2_', 'wan_'];
77
+ return COMFY_PREFIXES.some((prefix) => modelId.startsWith(prefix));
55
78
  }
56
79
 
57
- export function validateScheduler(value?: string) {
58
- if (!value) {
80
+ /**
81
+ * Get the maximum number of context images supported by a model.
82
+ * - Flux.2 Dev: 6 images
83
+ * - Qwen Image Edit: 3 images
84
+ * - Flux Kontext: 2 images
85
+ * - Default: 3 images
86
+ */
87
+ export function getMaxContextImages(modelId: string): number {
88
+ if (modelId.startsWith('flux2_')) {
89
+ return 6;
90
+ }
91
+ if (modelId.startsWith('qwen_image_')) {
92
+ return 3;
93
+ }
94
+ if (modelId.includes('kontext')) {
95
+ return 2;
96
+ }
97
+ // Default fallback for other models that might support context images
98
+ return 3;
99
+ }
100
+
101
+ function validateOption<T = unknown>(value: T, options: T[], errorMessage: string): T {
102
+ if (!options.includes(value)) {
103
+ throw new ApiError(400, {
104
+ status: 'error',
105
+ errorCode: 0,
106
+ message: errorMessage
107
+ });
108
+ }
109
+ return value;
110
+ }
111
+
112
+ /**
113
+ * Validate sampler value against allowed options.
114
+ * Returns the validated value unchanged - sogni-socket handles normalization.
115
+ */
116
+ export function validateSampler(value: string | undefined, options: ModelOptions) {
117
+ if (!options.sampler.allowed.length || !value) {
59
118
  return null;
60
119
  }
61
- if (!isScheduler(value)) {
62
- throw new Error(
63
- `Invalid scheduler: ${value}. Supported options: ${Object.keys(SchedulerMap).join(', ')}`
64
- );
120
+ return validateOption(
121
+ value,
122
+ options.sampler.allowed,
123
+ `Invalid sampler ${value}. Must be one of "${options.sampler.allowed.join('", "')}".`
124
+ );
125
+ }
126
+
127
+ /**
128
+ * Validate scheduler value against allowed options.
129
+ * Returns the validated value unchanged - sogni-socket handles normalization.
130
+ */
131
+ export function validateScheduler(value: string | undefined, options: ModelOptions) {
132
+ if (!options.scheduler.allowed.length || !value) {
133
+ return null;
65
134
  }
66
- return SchedulerMap[value];
135
+ return validateOption(
136
+ value,
137
+ options.scheduler.allowed,
138
+ `Invalid scheduler ${value}. Must be one of "${options.scheduler.allowed.join('", "')}".`
139
+ );
67
140
  }
@@ -1,15 +0,0 @@
1
- export declare const SamplerMap: {
2
- dfs_sd3: string;
3
- dpm_pp: string;
4
- dpm_pp_sde: string;
5
- dpm_pp_2m: string;
6
- dpm_pp_2m_sde: string;
7
- euler: string;
8
- euler_a: string;
9
- heun: string;
10
- lcm: string;
11
- pndm_plms: string;
12
- uni_pc: string;
13
- };
14
- export declare function isSampler(sampler: string): sampler is Sampler;
15
- export type Sampler = keyof typeof SamplerMap;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SamplerMap = void 0;
4
- exports.isSampler = isSampler;
5
- exports.SamplerMap = {
6
- dfs_sd3: 'Discrete Flow Scheduler (SD3)',
7
- dpm_pp: 'DPM Solver Multistep (DPM-Solver++)',
8
- dpm_pp_sde: 'DPM++ SDE',
9
- dpm_pp_2m: 'DPM++ 2M',
10
- dpm_pp_2m_sde: 'DPM++ 2M SDE',
11
- euler: 'Euler',
12
- euler_a: 'Euler a',
13
- heun: 'Heun',
14
- lcm: 'LCM (Latent Consistency Model)',
15
- pndm_plms: 'PNDM (Pseudo-linear multi-step)',
16
- uni_pc: 'UniPC'
17
- };
18
- function isSampler(sampler) {
19
- return sampler in exports.SamplerMap;
20
- }
21
- //# sourceMappingURL=SamplerParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SamplerParams.js","sourceRoot":"","sources":["../../../src/Projects/types/SamplerParams.ts"],"names":[],"mappings":";;;AAcA,8BAEC;AAhBY,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE,+BAA+B;IACxC,MAAM,EAAE,qCAAqC;IAC7C,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,cAAc;IAC7B,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,gCAAgC;IACrC,SAAS,EAAE,iCAAiC;IAC5C,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,OAAO,IAAI,kBAAU,CAAC;AAC/B,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const SchedulerMap: {
2
- beta: string;
3
- ddim: string;
4
- karras: string;
5
- kl_optimal: string;
6
- leading: string;
7
- linear: string;
8
- normal: string;
9
- sgm_uniform: string;
10
- simple: string;
11
- };
12
- export declare function isScheduler(scheduler: string): scheduler is Scheduler;
13
- export type Scheduler = keyof typeof SchedulerMap;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchedulerMap = void 0;
4
- exports.isScheduler = isScheduler;
5
- exports.SchedulerMap = {
6
- beta: 'Beta',
7
- ddim: 'DDIM',
8
- karras: 'Karras',
9
- kl_optimal: 'KL Optimal',
10
- leading: 'Automatic',
11
- linear: 'Automatic',
12
- normal: 'Normal',
13
- sgm_uniform: 'SGM Uniform',
14
- simple: 'Simple'
15
- };
16
- function isScheduler(scheduler) {
17
- return scheduler in exports.SchedulerMap;
18
- }
19
- //# sourceMappingURL=SchedulerParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchedulerParams.js","sourceRoot":"","sources":["../../../src/Projects/types/SchedulerParams.ts"],"names":[],"mappings":";;;AAYA,kCAEC;AAdY,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,SAAgB,WAAW,CAAC,SAAiB;IAC3C,OAAO,SAAS,IAAI,oBAAY,CAAC;AACnC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { EnhancementStrength } from './types';
2
- export declare function getEnhacementStrength(strength: EnhancementStrength): number;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEnhacementStrength = getEnhacementStrength;
4
- function getEnhacementStrength(strength) {
5
- switch (strength) {
6
- case 'light':
7
- return 0.15;
8
- case 'heavy':
9
- return 0.49;
10
- default:
11
- return 0.35;
12
- }
13
- }
14
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/Projects/utils.ts"],"names":[],"mappings":";;AAEA,sDASC;AATD,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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,kCAMC;AAED,gDAMC;AAED,sBAEC;AApBD,2CAAuC;AAEvC,SAAgB,WAAW,CAAC,KAAa;IACvC,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,MAAM,IAAI,GAAG,IAAA,sBAAS,EAA0D,KAAK,CAAC,CAAC;IACvF,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED,SAAsB,KAAK,CAAC,EAAU;;QACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CAAA"}
@@ -1,19 +0,0 @@
1
- export const SamplerMap = {
2
- dfs_sd3: 'Discrete Flow Scheduler (SD3)',
3
- dpm_pp: 'DPM Solver Multistep (DPM-Solver++)',
4
- dpm_pp_sde: 'DPM++ SDE',
5
- dpm_pp_2m: 'DPM++ 2M',
6
- dpm_pp_2m_sde: 'DPM++ 2M SDE',
7
- euler: 'Euler',
8
- euler_a: 'Euler a',
9
- heun: 'Heun',
10
- lcm: 'LCM (Latent Consistency Model)',
11
- pndm_plms: 'PNDM (Pseudo-linear multi-step)',
12
- uni_pc: 'UniPC'
13
- };
14
-
15
- export function isSampler(sampler: string): sampler is Sampler {
16
- return sampler in SamplerMap;
17
- }
18
-
19
- export type Sampler = keyof typeof SamplerMap;
@@ -1,17 +0,0 @@
1
- export const SchedulerMap = {
2
- beta: 'Beta',
3
- ddim: 'DDIM',
4
- karras: 'Karras',
5
- kl_optimal: 'KL Optimal',
6
- leading: 'Automatic',
7
- linear: 'Automatic',
8
- normal: 'Normal',
9
- sgm_uniform: 'SGM Uniform',
10
- simple: 'Simple'
11
- };
12
-
13
- export function isScheduler(scheduler: string): scheduler is Scheduler {
14
- return scheduler in SchedulerMap;
15
- }
16
-
17
- export type Scheduler = keyof typeof SchedulerMap;
@@ -1,12 +0,0 @@
1
- import { EnhancementStrength } from './types';
2
-
3
- export function getEnhacementStrength(strength: EnhancementStrength): number {
4
- switch (strength) {
5
- case 'light':
6
- return 0.15;
7
- case 'heavy':
8
- return 0.49;
9
- default:
10
- return 0.35;
11
- }
12
- }
File without changes
File without changes