@sogni-ai/sogni-client 4.0.0-alpha.9 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +268 -0
- package/README.md +262 -27
- package/dist/Account/index.d.ts +18 -16
- package/dist/Account/index.js +31 -20
- package/dist/Account/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.d.ts +66 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js +332 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js.map +1 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.d.ts +28 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +203 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -0
- package/dist/ApiClient/WebSocketClient/events.d.ts +12 -0
- package/dist/ApiClient/WebSocketClient/index.d.ts +2 -2
- package/dist/ApiClient/WebSocketClient/index.js +13 -3
- package/dist/ApiClient/WebSocketClient/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/types.d.ts +13 -0
- package/dist/ApiClient/index.d.ts +4 -4
- package/dist/ApiClient/index.js +23 -4
- package/dist/ApiClient/index.js.map +1 -1
- package/dist/Projects/Job.d.ts +44 -4
- package/dist/Projects/Job.js +83 -16
- package/dist/Projects/Job.js.map +1 -1
- package/dist/Projects/Project.d.ts +18 -0
- package/dist/Projects/Project.js +38 -10
- package/dist/Projects/Project.js.map +1 -1
- package/dist/Projects/createJobRequestMessage.js +170 -13
- package/dist/Projects/createJobRequestMessage.js.map +1 -1
- package/dist/Projects/index.d.ts +112 -11
- package/dist/Projects/index.js +473 -45
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/types/ComfySamplerParams.d.ts +28 -0
- package/dist/Projects/types/ComfySamplerParams.js +36 -0
- package/dist/Projects/types/ComfySamplerParams.js.map +1 -0
- package/dist/Projects/types/ComfySchedulerParams.d.ts +17 -0
- package/dist/Projects/types/ComfySchedulerParams.js +23 -0
- package/dist/Projects/types/ComfySchedulerParams.js.map +1 -0
- package/dist/Projects/types/EstimationResponse.d.ts +2 -0
- package/dist/Projects/types/ForgeSamplerParams.d.ts +27 -0
- package/dist/Projects/types/ForgeSamplerParams.js +39 -0
- package/dist/Projects/types/ForgeSamplerParams.js.map +1 -0
- package/dist/Projects/types/ForgeSchedulerParams.d.ts +17 -0
- package/dist/Projects/types/ForgeSchedulerParams.js +28 -0
- package/dist/Projects/types/ForgeSchedulerParams.js.map +1 -0
- package/dist/Projects/types/events.d.ts +5 -1
- package/dist/Projects/types/index.d.ts +205 -38
- package/dist/Projects/types/index.js +17 -0
- package/dist/Projects/types/index.js.map +1 -1
- package/dist/Projects/utils.d.ts +19 -1
- package/dist/Projects/utils.js +68 -0
- package/dist/Projects/utils.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/AuthManager/TokenAuthManager.js +0 -2
- package/dist/lib/AuthManager/TokenAuthManager.js.map +1 -1
- package/dist/lib/DataEntity.js +4 -2
- package/dist/lib/DataEntity.js.map +1 -1
- package/dist/lib/RestClient.js +15 -2
- package/dist/lib/RestClient.js.map +1 -1
- package/dist/lib/validation.d.ts +26 -2
- package/dist/lib/validation.js +95 -10
- package/dist/lib/validation.js.map +1 -1
- package/package.json +4 -4
- package/src/Account/index.ts +30 -19
- package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.ts +426 -0
- package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/index.ts +237 -0
- package/src/ApiClient/WebSocketClient/events.ts +14 -0
- package/src/ApiClient/WebSocketClient/index.ts +15 -5
- package/src/ApiClient/WebSocketClient/types.ts +16 -0
- package/src/ApiClient/index.ts +30 -8
- package/src/Projects/Job.ts +97 -16
- package/src/Projects/Project.ts +46 -13
- package/src/Projects/createJobRequestMessage.ts +222 -35
- package/src/Projects/index.ts +504 -49
- package/src/Projects/types/ComfySamplerParams.ts +34 -0
- package/src/Projects/types/ComfySchedulerParams.ts +21 -0
- package/src/Projects/types/EstimationResponse.ts +2 -0
- package/src/Projects/types/ForgeSamplerParams.ts +37 -0
- package/src/Projects/types/ForgeSchedulerParams.ts +26 -0
- package/src/Projects/types/events.ts +6 -0
- package/src/Projects/types/index.ts +243 -39
- package/src/Projects/utils.ts +66 -1
- package/src/index.ts +60 -8
- package/src/lib/AuthManager/TokenAuthManager.ts +0 -2
- package/src/lib/DataEntity.ts +4 -2
- package/src/lib/RestClient.ts +16 -2
- package/src/lib/validation.ts +111 -14
- package/dist/Projects/types/SamplerParams.d.ts +0 -12
- package/dist/Projects/types/SamplerParams.js +0 -21
- package/dist/Projects/types/SamplerParams.js.map +0 -1
- package/dist/Projects/types/SchedulerParams.d.ts +0 -13
- package/dist/Projects/types/SchedulerParams.js +0 -19
- package/dist/Projects/types/SchedulerParams.js.map +0 -1
- package/src/Projects/types/SamplerParams.ts +0 -19
- package/src/Projects/types/SchedulerParams.ts +0 -17
package/src/index.ts
CHANGED
|
@@ -12,7 +12,27 @@ 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 {
|
|
15
|
+
import {
|
|
16
|
+
AvailableModel,
|
|
17
|
+
ImageProjectParams,
|
|
18
|
+
ImageOutputFormat,
|
|
19
|
+
ProjectParams,
|
|
20
|
+
Sampler,
|
|
21
|
+
ForgeSampler,
|
|
22
|
+
ComfySampler,
|
|
23
|
+
Scheduler,
|
|
24
|
+
ForgeScheduler,
|
|
25
|
+
ComfyScheduler,
|
|
26
|
+
SupportedForgeSamplers,
|
|
27
|
+
SupportedForgeSchedulers,
|
|
28
|
+
SupportedComfySamplers,
|
|
29
|
+
SupportedComfySchedulers,
|
|
30
|
+
VideoProjectParams,
|
|
31
|
+
AudioFormat,
|
|
32
|
+
VideoFormat,
|
|
33
|
+
VideoOutputFormat,
|
|
34
|
+
VideoWorkflowType
|
|
35
|
+
} from './Projects/types';
|
|
16
36
|
// Stats API
|
|
17
37
|
import StatsApi from './Stats';
|
|
18
38
|
// Base Types
|
|
@@ -22,21 +42,40 @@ import { CookieAuthManager, TokenAuthData, TokenAuthManager } from './lib/AuthMa
|
|
|
22
42
|
import { MeData } from './Account/types';
|
|
23
43
|
|
|
24
44
|
export type {
|
|
45
|
+
AudioFormat,
|
|
25
46
|
AvailableModel,
|
|
26
47
|
ErrorData,
|
|
48
|
+
ImageProjectParams,
|
|
49
|
+
ImageOutputFormat,
|
|
27
50
|
JobStatus,
|
|
28
51
|
Logger,
|
|
29
52
|
LogLevel,
|
|
30
|
-
OutputFormat,
|
|
31
53
|
ProjectParams,
|
|
32
54
|
ProjectStatus,
|
|
33
55
|
Sampler,
|
|
56
|
+
ForgeSampler,
|
|
57
|
+
ComfySampler,
|
|
34
58
|
SupernetType,
|
|
35
59
|
Scheduler,
|
|
36
|
-
|
|
60
|
+
ForgeScheduler,
|
|
61
|
+
ComfyScheduler,
|
|
62
|
+
TokenType,
|
|
63
|
+
VideoFormat,
|
|
64
|
+
VideoOutputFormat,
|
|
65
|
+
VideoProjectParams,
|
|
66
|
+
VideoWorkflowType
|
|
37
67
|
};
|
|
38
68
|
|
|
39
|
-
export {
|
|
69
|
+
export {
|
|
70
|
+
ApiError,
|
|
71
|
+
CurrentAccount,
|
|
72
|
+
Job,
|
|
73
|
+
Project,
|
|
74
|
+
SupportedComfySchedulers,
|
|
75
|
+
SupportedComfySamplers,
|
|
76
|
+
SupportedForgeSchedulers,
|
|
77
|
+
SupportedForgeSamplers
|
|
78
|
+
};
|
|
40
79
|
|
|
41
80
|
export interface SogniClientConfig {
|
|
42
81
|
/**
|
|
@@ -55,7 +94,7 @@ export interface SogniClientConfig {
|
|
|
55
94
|
socketEndpoint?: string;
|
|
56
95
|
/**
|
|
57
96
|
* Disable WebSocket connection. Useful for testing or when WebSocket is not needed.
|
|
58
|
-
* Note that many may not work without WebSocket connection.
|
|
97
|
+
* Note that many APIs may not work without WebSocket connection.
|
|
59
98
|
* @experimental
|
|
60
99
|
* @internal
|
|
61
100
|
*/
|
|
@@ -87,6 +126,14 @@ export interface SogniClientConfig {
|
|
|
87
126
|
* @experimental
|
|
88
127
|
*/
|
|
89
128
|
authType?: 'token' | 'cookies';
|
|
129
|
+
/**
|
|
130
|
+
* Browser only. If true, the client will use a single WebSocket connection shared across multiple
|
|
131
|
+
* tabs. This is useful for browser apps that need to process multiple projects at the same time.
|
|
132
|
+
* Only works in browser environment and with cookie authentication.
|
|
133
|
+
* @default false
|
|
134
|
+
* @experimental
|
|
135
|
+
*/
|
|
136
|
+
multiInstance?: boolean;
|
|
90
137
|
}
|
|
91
138
|
|
|
92
139
|
export class SogniClient {
|
|
@@ -133,9 +180,13 @@ export class SogniClient {
|
|
|
133
180
|
throw Error('This method should only be called when using cookie auth');
|
|
134
181
|
}
|
|
135
182
|
try {
|
|
136
|
-
await this.apiClient.rest.get<ApiResponse<MeData>>('/v1/account/me');
|
|
183
|
+
const res = await this.apiClient.rest.get<ApiResponse<MeData>>('/v1/account/me');
|
|
137
184
|
await auth.authenticate();
|
|
138
|
-
|
|
185
|
+
this.currentAccount._update({
|
|
186
|
+
username: res.data.username,
|
|
187
|
+
email: res.data.currentEmail,
|
|
188
|
+
walletAddress: res.data.walletAddress
|
|
189
|
+
});
|
|
139
190
|
return true;
|
|
140
191
|
} catch (e) {
|
|
141
192
|
this.apiClient.logger.info('Client is not authenticated');
|
|
@@ -161,7 +212,8 @@ export class SogniClient {
|
|
|
161
212
|
networkType: network,
|
|
162
213
|
logger,
|
|
163
214
|
authType: config.authType || 'token',
|
|
164
|
-
disableSocket: config.disableSocket
|
|
215
|
+
disableSocket: config.disableSocket,
|
|
216
|
+
multiInstance: config.multiInstance
|
|
165
217
|
});
|
|
166
218
|
const eip712 = new EIP712Helper({
|
|
167
219
|
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() {
|
package/src/lib/DataEntity.ts
CHANGED
|
@@ -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
|
-
|
|
29
|
+
if (changedKeys.length > 0) {
|
|
30
|
+
this.data = { ...this.data, ...delta };
|
|
31
|
+
this.emit('updated', changedKeys);
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
/**
|
package/src/lib/RestClient.ts
CHANGED
|
@@ -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
|
-
|
|
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)
|
|
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> {
|
package/src/lib/validation.ts
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
isRawForgeSampler,
|
|
3
|
+
isForgeSampler,
|
|
4
|
+
SupportedForgeSamplers
|
|
5
|
+
} from '../Projects/types/ForgeSamplerParams';
|
|
6
|
+
import {
|
|
7
|
+
isForgeScheduler,
|
|
8
|
+
isRawForgeScheduler,
|
|
9
|
+
SupportedForgeSchedulers
|
|
10
|
+
} from '../Projects/types/ForgeSchedulerParams';
|
|
11
|
+
import { isComfySampler, SupportedComfySamplers } from '../Projects/types/ComfySamplerParams';
|
|
12
|
+
import { isComfyScheduler, SupportedComfySchedulers } from '../Projects/types/ComfySchedulerParams';
|
|
3
13
|
|
|
4
14
|
export function validateCustomImageSize(value: any): number {
|
|
5
15
|
return validateNumber(value, { min: 256, max: 2048, propertyName: 'Width and height' });
|
|
6
16
|
}
|
|
7
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Validate video dimensions for Wan 2.2 models.
|
|
20
|
+
* Minimum dimension is 480px for both width and height.
|
|
21
|
+
*/
|
|
22
|
+
export function validateVideoSize(value: any, propertyName: 'width' | 'height'): number {
|
|
23
|
+
return validateNumber(value, { min: 480, propertyName: `Video ${propertyName}` });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateVideoDuration(value: any): number {
|
|
27
|
+
return validateNumber(value, { min: 1, max: 10, propertyName: 'Video duration' });
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
interface NumberValidationOptions {
|
|
9
31
|
min?: number;
|
|
10
32
|
max?: number;
|
|
@@ -42,26 +64,101 @@ export function validateNumber(
|
|
|
42
64
|
return number;
|
|
43
65
|
}
|
|
44
66
|
|
|
45
|
-
export function
|
|
67
|
+
export function validateForgeSampler(value?: string) {
|
|
46
68
|
if (!value) {
|
|
47
69
|
return null;
|
|
48
70
|
}
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
`Invalid sampler: ${value}. Supported options: ${Object.keys(SamplerMap).join(', ')}`
|
|
52
|
-
);
|
|
71
|
+
if (isRawForgeSampler(value)) {
|
|
72
|
+
return value;
|
|
53
73
|
}
|
|
54
|
-
|
|
74
|
+
if (isForgeSampler(value)) {
|
|
75
|
+
return SupportedForgeSamplers[value];
|
|
76
|
+
}
|
|
77
|
+
throw new Error(
|
|
78
|
+
`Invalid sampler: ${value}. Supported options: ${Object.keys(SupportedForgeSamplers).join(', ')}`
|
|
79
|
+
);
|
|
55
80
|
}
|
|
56
81
|
|
|
57
|
-
export function
|
|
82
|
+
export function validateForgeScheduler(value?: string) {
|
|
58
83
|
if (!value) {
|
|
59
84
|
return null;
|
|
60
85
|
}
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
if (isRawForgeScheduler(value)) {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
if (isForgeScheduler(value)) {
|
|
90
|
+
return SupportedForgeSchedulers[value];
|
|
91
|
+
}
|
|
92
|
+
throw new Error(
|
|
93
|
+
`Invalid scheduler: ${value}. Supported options: ${Object.keys(SupportedForgeSchedulers).join(', ')}`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Validate teacacheThreshold for T2V and I2V models.
|
|
99
|
+
* Range: 0.0-1.0. 0.0 = disabled.
|
|
100
|
+
*/
|
|
101
|
+
export function validateTeacacheThreshold(value?: number): number | undefined {
|
|
102
|
+
if (value === undefined || value === null) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const num = Number(value);
|
|
106
|
+
if (isNaN(num)) {
|
|
107
|
+
throw new Error(`teacacheThreshold must be a number, got ${value}`);
|
|
108
|
+
}
|
|
109
|
+
if (num < 0.0 || num > 1.0) {
|
|
110
|
+
throw new Error(`teacacheThreshold must be between 0.0 and 1.0 (got ${num})`);
|
|
111
|
+
}
|
|
112
|
+
return num;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Validate ComfyUI sampler for video models.
|
|
117
|
+
* Returns the sampler string directly (no mapping needed).
|
|
118
|
+
*/
|
|
119
|
+
export function validateComfySampler(value?: string): string | undefined {
|
|
120
|
+
if (!value) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
if (isComfySampler(value)) {
|
|
124
|
+
return SupportedComfySamplers[value];
|
|
125
|
+
}
|
|
126
|
+
throw new Error(
|
|
127
|
+
`Invalid comfySampler: ${value}. Supported options: ${Object.keys(SupportedComfySamplers).join(', ')}`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Validate ComfyUI scheduler for video models.
|
|
133
|
+
* Returns the scheduler string directly (no mapping needed).
|
|
134
|
+
*/
|
|
135
|
+
export function validateComfyScheduler(value?: string): string | undefined {
|
|
136
|
+
if (!value) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
if (isComfyScheduler(value)) {
|
|
140
|
+
return SupportedComfySchedulers[value];
|
|
141
|
+
}
|
|
142
|
+
throw new Error(
|
|
143
|
+
`Invalid comfyScheduler: ${value}. Supported options: ${Object.keys(SupportedComfySchedulers).join(', ')}`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function isComfyModel(modelId: string): boolean {
|
|
148
|
+
const COMFY_PREFIXES = ['z_image_', 'qwen_image_', 'flux2_', 'wan_'];
|
|
149
|
+
return COMFY_PREFIXES.some((prefix) => modelId.startsWith(prefix));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function validateSampler(modelId: string, sampler: string) {
|
|
153
|
+
if (isComfyModel(modelId)) {
|
|
154
|
+
return validateComfySampler(sampler);
|
|
155
|
+
}
|
|
156
|
+
return validateForgeSampler(sampler);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function validateScheduler(modelId: string, scheduler: string) {
|
|
160
|
+
if (isComfyModel(modelId)) {
|
|
161
|
+
return validateComfyScheduler(scheduler);
|
|
65
162
|
}
|
|
66
|
-
return
|
|
163
|
+
return validateForgeScheduler(scheduler);
|
|
67
164
|
}
|
|
@@ -1,12 +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
|
-
euler: string;
|
|
7
|
-
euler_a: string;
|
|
8
|
-
lcm: string;
|
|
9
|
-
pndm_plms: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function isSampler(sampler: string): sampler is Sampler;
|
|
12
|
-
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,gCAAgC;IAChC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,eAAe;IACf,GAAG,EAAE,gCAAgC;IACrC,SAAS,EAAE,iCAAiC;IAC5C,iBAAiB;CAClB,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: 'Leading',
|
|
11
|
-
linear: 'Linear',
|
|
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,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,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,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: 'Leading',
|
|
7
|
-
linear: 'Linear',
|
|
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;
|