-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathtypes.ts
More file actions
142 lines (124 loc) · 3.3 KB
/
Copy pathtypes.ts
File metadata and controls
142 lines (124 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
export interface GeneratedImage {
id: string;
url: string;
prompt: string;
aspectRatio: string;
timestamp: number;
model: string;
seed?: number;
steps?: number;
guidanceScale?: number;
duration?: number;
isBlurred?: boolean;
isUpscaled?: boolean;
width?: number;
height?: number;
provider?: ProviderOption;
fileName?: string; // Local filename in OPFS tmp for the image
// Video Generation Properties
videoUrl?: string;
videoTaskId?: string;
videoStatus?: 'generating' | 'success' | 'failed';
videoError?: string;
videoProvider?: ProviderOption;
videoTimestamp?: number; // Timestamp when video generation started
videoNextPollTime?: number; // Timestamp for next poll attempt
videoFileName?: string; // Local filename in OPFS tmp for the video
}
export interface CloudImage {
id: string;
url: string; // Cloud URL
thumbnailUrl?: string;
prompt: string;
timestamp: number;
fileName: string;
}
export interface CloudFile {
key: string;
lastModified: Date;
size: number;
url: string;
type: 'image' | 'video' | 'unknown';
}
export type StorageType = 'off' | 's3' | 'webdav' | 'opfs';
export interface S3Config {
accessKeyId: string;
secretAccessKey: string;
bucket?: string; // Optional
region?: string; // Optional
endpoint?: string; // Optional custom endpoint
publicDomain?: string; // Optional CDN/Public domain
prefix?: string; // Optional prefix, default 'peinture/'
}
export interface WebDAVConfig {
url: string;
username: string;
password: string;
directory: string;
}
export type AspectRatioOption = "1:1" | "3:2" | "2:3" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9";
export type ModelOption =
| "z-image-turbo"
| "z-image"
| "qwen-image"
| "ovis-image"
| "flux-2"
| "flux-1-schnell"
| "flux-1-krea"
| "flux-1"
| "imagen-4"
| string; // Allow custom model strings
export type ProviderOption = "huggingface" | "gitee" | "modelscope" | "a4f" | "openai" | "google" | "agnes" | string;
export type ProviderId = 'huggingface' | 'gitee' | 'modelscope' | 'a4f' | 'openai' | 'google' | 'agnes';
export interface TokenStatus {
date: string;
exhausted: Record<string, boolean>;
}
export interface GenerationParams {
model: ModelOption;
prompt: string;
aspectRatio: AspectRatioOption;
seed?: number;
steps?: number;
guidanceScale?: number;
}
export interface RemoteModel {
id: string;
name: string;
type: string[];
steps?: {
range: [number, number];
default: number;
};
guidance?: {
range: [number, number];
default: number;
};
}
export interface RemoteModelList {
generate?: RemoteModel[];
edit?: RemoteModel[];
video?: RemoteModel[];
text?: RemoteModel[];
upscaler?: RemoteModel[];
}
export interface CustomProvider {
id: string;
name: string;
apiUrl: string;
token?: string;
models: RemoteModelList;
enabled: boolean;
}
export type ServiceMode = 'local' | 'server' | 'hydration';
export interface VideoSettings {
prompt: string;
duration: number; // in seconds
steps: number;
guidance: number;
}
export interface UnifiedModelOption {
label: string;
value: string; // provider:modelId
provider: ProviderOption;
}