File size: 1,669 Bytes
c8be32d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Any, Callable, Literal, ParamSpec, Sequence, TypedDict, TypeVar

from os import PathLike

P = ParamSpec("P")
T = TypeVar("T")

StrOrBytesPath = str | bytes | PathLike[str] | PathLike[bytes]

DropdownChoices = Sequence[str | int | float | tuple[str, str | int | float]] | None

DropdownValue = (
    str | int | float | Sequence[str | int | float] | Callable[..., Any] | None
)

InputType = Literal["yt", "local"]

F0Method = Literal["rmvpe", "mangio-crepe"]

InputAudioExt = Literal["mp3", "wav", "flac", "aac", "m4a", "ogg"]

OutputAudioExt = Literal["mp3", "wav", "flac", "adts", "ipod", "ogg"]


ModelsTable = list[list[str]]

ModelsTablePredicate = Callable[[dict[str, str | list[str]]], bool]


class ComponentVisibilityKwArgs(TypedDict):
    visible: bool
    value: Any


class UpdateDropdownArgs(TypedDict, total=False):
    choices: DropdownChoices | None
    value: DropdownValue | None


class TextBoxArgs(TypedDict, total=False):
    value: str | None
    placeholder: str | None


class TransferUpdateArgs(TypedDict, total=False):
    value: str | None


RunPipelineHarnessArgs = tuple[
    str,  # song_input
    str,  # voice_model
    int,  # pitch_change_vocals
    int,  # pitch_change_all
    float,  # index_rate
    int,  # filter_radius
    float,  # rms_mix_rate
    float,  # protect
    F0Method,  # f0_method
    int,  # crepe_hop_length
    float,  # reverb_rm_size
    float,  # reverb_wet
    float,  # reverb_dry
    float,  # reverb_damping
    int,  # main_gain
    int,  # inst_gain
    int,  # backup_gain
    int,  # output_sr
    InputAudioExt,  # output_format
    str,  # output_name
    bool,  # return_files
]