forked from riffusion/riffusion-app-hobby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
51 lines (40 loc) · 1.12 KB
/
types.ts
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
export interface PromptInput {
prompt: string;
seed?: number;
denoising?: number;
guidance?: number;
// promptsInput is assigned a transitionCounter equal to the result.counter upon first being played
transitionCounter?: number;
}
export interface InferenceInput {
alpha: number;
num_inference_steps?: number;
seed_image_id?: string;
mask_image_id?: string;
start: PromptInput;
end: PromptInput;
}
export interface InferenceResult {
input: InferenceInput;
counter: number;
// Binary played status (true = played or playing, false = not played)
played: boolean;
// URL of the image
image: string;
// URL of the audio
audio: string;
// Duration of the audio in seconds
duration_s: number;
}
// High-level state of the app's inference call
export enum AppState {
UNINITIALIZED = "UNINITIALIZED",
SAME_PROMPT = "SAME_PROMPT",
TRANSITION = "TRANSITION",
}
// High-level state of the actively playing audio
export enum PlayingState {
UNINITIALIZED = "UNINITIALIZED",
SAME_PROMPT = "SAME_PROMPT",
TRANSITION = "TRANSITION",
}