Config ui section is coming along
This commit is contained in:
149
ui/src/types.ts
Normal file
149
ui/src/types.ts
Normal file
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* GPU API response
|
||||
*/
|
||||
|
||||
export interface GpuUtilization {
|
||||
gpu: number;
|
||||
memory: number;
|
||||
}
|
||||
|
||||
export interface GpuMemory {
|
||||
total: number;
|
||||
free: number;
|
||||
used: number;
|
||||
}
|
||||
|
||||
export interface GpuPower {
|
||||
draw: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface GpuClocks {
|
||||
graphics: number;
|
||||
memory: number;
|
||||
}
|
||||
|
||||
export interface GpuInfo {
|
||||
index: number;
|
||||
name: string;
|
||||
driverVersion: string;
|
||||
temperature: number;
|
||||
utilization: GpuUtilization;
|
||||
memory: GpuMemory;
|
||||
power: GpuPower;
|
||||
clocks: GpuClocks;
|
||||
}
|
||||
|
||||
export interface GPUApiResponse {
|
||||
hasNvidiaSmi: boolean;
|
||||
gpus: GpuInfo[];
|
||||
error?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Training configuration
|
||||
*/
|
||||
|
||||
export interface NetworkConfig {
|
||||
type: 'lora';
|
||||
linear: number;
|
||||
linear_alpha: number;
|
||||
}
|
||||
|
||||
export interface SaveConfig {
|
||||
dtype: string;
|
||||
save_every: number;
|
||||
max_step_saves_to_keep: number;
|
||||
push_to_hub: boolean;
|
||||
}
|
||||
|
||||
export interface DatasetConfig {
|
||||
folder_path: string;
|
||||
mask_path: string | null;
|
||||
mask_min_value: number;
|
||||
default_caption: string;
|
||||
caption_ext: string;
|
||||
caption_dropout_rate: number;
|
||||
shuffle_tokens?: boolean;
|
||||
is_reg: boolean;
|
||||
network_weight: number;
|
||||
cache_latents_to_disk?: boolean;
|
||||
resolution: number[];
|
||||
}
|
||||
|
||||
export interface EMAConfig {
|
||||
use_ema: boolean;
|
||||
ema_decay: number;
|
||||
}
|
||||
|
||||
export interface TrainConfig {
|
||||
batch_size: number;
|
||||
bypass_guidance_embedding?: boolean;
|
||||
steps: number;
|
||||
gradient_accumulation: number;
|
||||
train_unet: boolean;
|
||||
train_text_encoder: boolean;
|
||||
gradient_checkpointing: boolean;
|
||||
noise_scheduler: string;
|
||||
optimizer: string;
|
||||
lr: number;
|
||||
ema_config?: EMAConfig;
|
||||
dtype: string;
|
||||
optimizer_params: {
|
||||
weight_decay: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface QuantizeKwargsConfig {
|
||||
exclude: string[];
|
||||
}
|
||||
|
||||
export interface ModelConfig {
|
||||
name_or_path: string;
|
||||
is_flux?: boolean;
|
||||
is_lumina2?: boolean;
|
||||
quantize: boolean;
|
||||
quantize_te: boolean;
|
||||
quantize_kwargs?: QuantizeKwargsConfig;
|
||||
}
|
||||
|
||||
export interface SampleConfig {
|
||||
sampler: string;
|
||||
sample_every: number;
|
||||
width: number;
|
||||
height: number;
|
||||
prompts: string[];
|
||||
neg: string;
|
||||
seed: number;
|
||||
walk_seed: boolean;
|
||||
guidance_scale: number;
|
||||
sample_steps: number;
|
||||
}
|
||||
|
||||
export interface ProcessConfig {
|
||||
type: 'sd_trainer';
|
||||
training_folder: string;
|
||||
device: string;
|
||||
network?: NetworkConfig;
|
||||
save: SaveConfig;
|
||||
datasets: DatasetConfig[];
|
||||
train: TrainConfig;
|
||||
model: ModelConfig;
|
||||
sample: SampleConfig;
|
||||
}
|
||||
|
||||
export interface ConfigObject {
|
||||
name: string;
|
||||
process: ProcessConfig[];
|
||||
}
|
||||
|
||||
export interface MetaConfig {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export interface JobConfig {
|
||||
job: string;
|
||||
config: ConfigObject;
|
||||
meta: MetaConfig;
|
||||
}
|
||||
Reference in New Issue
Block a user