update stable diffusion UI to latest, new advanced flags for kcpp 1.100, 3 new optional toggles for image generation

This commit is contained in:
lone-cloud 2025-10-12 00:45:09 -07:00
parent e55dd0f42f
commit d19c9bac3c
11 changed files with 134 additions and 41 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
{
"name": "gerbil",
"productName": "Gerbil",
"version": "1.6.9",
"version": "1.7.0",
"description": "Run Large Language Models locally",
"main": "out/main/index.js",
"homepage": "./",

View file

@ -119,7 +119,7 @@ export const App = () => {
if (currentVersion) {
setTimeout(() => {
checkForUpdates();
}, 1000);
}, 5000);
}
};

View file

@ -55,11 +55,14 @@ const UI_COVERED_ARGS = new Set([
'--sdt5xxl',
'--sdclipl',
'--sdclipg',
'--sdclip1',
'--sdclip2',
'--sdphotomaker',
'--sdvae',
'--sdlora',
'--sdflashattention',
'--sdconvdirect',
'--sdvaecpu',
'--sdclipgpu',
'--tensor_split',
] as const) as ReadonlySet<string>;
@ -386,6 +389,14 @@ const COMMAND_LINE_ARGUMENTS = [
default: 0,
category: 'Performance',
},
{
flag: '--lowvram',
aliases: ['-nkvo', '--no-kv-offload'],
description:
'If supported by the backend, do not offload KV to GPU (lowvram mode). Not recommended, will be slow.',
type: 'boolean',
category: 'Performance',
},
{
flag: '--defaultgenamt',
description:
@ -639,6 +650,21 @@ const COMMAND_LINE_ARGUMENTS = [
default: 768,
category: 'Image Generation',
},
{
flag: '--sdoffloadcpu',
description:
'Offload image weights in RAM to save VRAM, swap into VRAM when needed.',
type: 'boolean',
category: 'Image Generation',
},
{
flag: '--sdgendefaults',
description:
'Sets default parameters for image generation, as a JSON string.',
metavar: '{"parameter":"value",...}',
default: '',
category: 'Image Generation',
},
{
flag: '--whispermodel',
description:

View file

@ -1,7 +1,8 @@
import { Stack } from '@mantine/core';
import { Stack, Group } from '@mantine/core';
import { useState } from 'react';
import { ModelFileField } from '@/components/screens/Launch/ModelFileField';
import { SelectWithTooltip } from '@/components/SelectWithTooltip';
import { CheckboxWithTooltip } from '@/components/CheckboxWithTooltip';
import { IMAGE_MODEL_PRESETS } from '@/constants/imageModelPresets';
import { useLaunchConfig } from '@/hooks/useLaunchConfig';
@ -15,6 +16,8 @@ export const ImageGenerationTab = () => {
sdvae,
sdlora,
sdconvdirect,
sdvaecpu,
sdclipgpu,
handleSdmodelChange,
handleSdt5xxlChange,
handleSdcliplChange,
@ -23,6 +26,8 @@ export const ImageGenerationTab = () => {
handleSdvaeChange,
handleSdloraChange,
handleSdconvdirectChange,
handleSdvaecpuChange,
handleSdclipgpuChange,
handleApplyPreset,
handleSelectSdmodelFile,
handleSelectSdt5xxlFile,
@ -143,6 +148,22 @@ export const ImageGenerationTab = () => {
{ value: 'full', label: 'Full' },
]}
/>
<Group gap="xs" grow>
<CheckboxWithTooltip
label="Force VAE to CPU"
tooltip="Forces the VAE (Variational Autoencoder) to run on CPU instead of GPU. This can save VRAM but will be slower. Useful for systems with limited GPU memory."
checked={sdvaecpu}
onChange={handleSdvaecpuChange}
/>
<CheckboxWithTooltip
label="Offload CLIP/T5"
tooltip="Offloads CLIP and T5 text encoders to the GPU for faster processing. By default they run on CPU. Only enable if you have VRAM to spare."
checked={sdclipgpu}
onChange={handleSdclipgpuChange}
/>
</Group>
</Stack>
);
};

View file

@ -57,6 +57,8 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => {
sdvae,
sdlora,
sdconvdirect,
sdvaecpu,
sdclipgpu,
moecpu,
moeexperts,
parseAndApplyConfigFile,
@ -181,6 +183,10 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => {
sdclipg,
sdphotomaker,
sdvae,
sdlora,
sdconvdirect,
sdvaecpu,
sdclipgpu,
});
const handleCreateNewConfig = async (configName: string) => {
@ -299,6 +305,8 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => {
sdvae,
sdlora,
sdconvdirect,
sdvaecpu,
sdclipgpu,
moecpu,
moeexperts,
});
@ -333,6 +341,8 @@ export const LaunchScreen = ({ onLaunch }: LaunchScreenProps) => {
sdvae,
sdlora,
sdconvdirect,
sdvaecpu,
sdclipgpu,
moecpu,
moeexperts,
]);

View file

@ -39,6 +39,8 @@ export const useLaunchConfig = () => {
sdvae: state.sdvae,
sdlora: state.sdlora,
sdconvdirect: state.sdconvdirect,
sdvaecpu: state.sdvaecpu,
sdclipgpu: state.sdclipgpu,
moecpu: state.moecpu,
moeexperts: state.moeexperts,
@ -73,6 +75,8 @@ export const useLaunchConfig = () => {
handleSdvaeChange: state.setSdvae,
handleSdloraChange: state.setSdlora,
handleSdconvdirectChange: state.setSdconvdirect,
handleSdvaecpuChange: state.setSdvaecpu,
handleSdclipgpuChange: state.setSdclipgpu,
handleMoecpuChange: state.setMoecpu,
handleMoeexpertsChange: state.setMoeexperts,

View file

@ -37,6 +37,8 @@ interface LaunchArgs {
sdvae: string;
sdlora: string;
sdconvdirect: SdConvDirectMode;
sdvaecpu: boolean;
sdclipgpu: boolean;
moecpu: number;
moeexperts: number;
}
@ -74,6 +76,14 @@ const buildModelArgs = (
args.push('--sdflashattention');
}
if (launchArgs.sdvaecpu) {
args.push('--sdvaecpu');
}
if (launchArgs.sdclipgpu) {
args.push('--sdclipgpu');
}
if (launchArgs.sdconvdirect !== 'off') {
args.push('--sdconvdirect', launchArgs.sdconvdirect);
}

View file

@ -25,7 +25,7 @@ let koboldProcess: ChildProcess | null = null;
const patchKliteEmbd = (unpackedDir: string) =>
tryExecute(async () => {
const possiblePaths = [
join(unpackedDir, '_internal', 'klite.embd'),
join(unpackedDir, '_internal', 'embd_res', 'klite.embd'),
join(unpackedDir, 'klite.embd'),
];
@ -72,7 +72,7 @@ const patchKliteEmbd = (unpackedDir: string) =>
const patchKcppSduiEmbd = (unpackedDir: string) =>
tryExecute(async () => {
const possiblePaths = [
join(unpackedDir, '_internal', 'kcpp_sdui.embd'),
join(unpackedDir, '_internal', 'embd_res', 'kcpp_sdui.embd'),
join(unpackedDir, 'kcpp_sdui.embd'),
];

View file

@ -35,6 +35,8 @@ interface LaunchConfigState {
sdvae: string;
sdlora: string;
sdconvdirect: SdConvDirectMode;
sdvaecpu: boolean;
sdclipgpu: boolean;
moecpu: number;
moeexperts: number;
isImageGenerationMode: boolean;
@ -71,6 +73,8 @@ interface LaunchConfigState {
setSdvae: (vae: string) => void;
setSdlora: (loraModel: string) => void;
setSdconvdirect: (mode: SdConvDirectMode) => void;
setSdvaecpu: (enabled: boolean) => void;
setSdclipgpu: (enabled: boolean) => void;
setMoecpu: (moecpu: number) => void;
setMoeexperts: (moeexperts: number) => void;
@ -123,6 +127,8 @@ export const useLaunchConfigStore = create<LaunchConfigState>((set, get) => ({
sdvae: '',
sdlora: '',
sdconvdirect: 'off' as const,
sdvaecpu: false,
sdclipgpu: false,
moecpu: 0,
moeexperts: -1,
@ -173,6 +179,8 @@ export const useLaunchConfigStore = create<LaunchConfigState>((set, get) => ({
setSdvae: (vae) => set({ sdvae: vae }),
setSdlora: (loraModel) => set({ sdlora: loraModel }),
setSdconvdirect: (mode) => set({ sdconvdirect: mode }),
setSdvaecpu: (enabled) => set({ sdvaecpu: enabled }),
setSdclipgpu: (enabled) => set({ sdclipgpu: enabled }),
setMoecpu: (moeCpu) => set({ moecpu: moeCpu }),
setMoeexperts: (moeExperts) => set({ moeexperts: moeExperts }),
@ -363,6 +371,18 @@ export const useLaunchConfigStore = create<LaunchConfigState>((set, get) => ({
updates.sdconvdirect = configData.sdconvdirect as SdConvDirectMode;
}
if (typeof configData.sdvaecpu === 'boolean') {
updates.sdvaecpu = configData.sdvaecpu;
} else {
updates.sdvaecpu = false;
}
if (typeof configData.sdclipgpu === 'boolean') {
updates.sdclipgpu = configData.sdclipgpu;
} else {
updates.sdclipgpu = false;
}
if (typeof configData.moecpu === 'number') {
updates.moecpu = configData.moecpu;
} else {

View file

@ -97,6 +97,8 @@ export interface KoboldConfig {
sdvae?: string;
sdlora?: string;
sdconvdirect?: string;
sdvaecpu?: boolean;
sdclipgpu?: boolean;
additionalArguments?: string;
moecpu?: number;
moeexperts?: number;