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", "name": "gerbil",
"productName": "Gerbil", "productName": "Gerbil",
"version": "1.6.9", "version": "1.7.0",
"description": "Run Large Language Models locally", "description": "Run Large Language Models locally",
"main": "out/main/index.js", "main": "out/main/index.js",
"homepage": "./", "homepage": "./",

View file

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

View file

@ -55,11 +55,14 @@ const UI_COVERED_ARGS = new Set([
'--sdt5xxl', '--sdt5xxl',
'--sdclipl', '--sdclipl',
'--sdclipg', '--sdclipg',
'--sdclip1',
'--sdclip2',
'--sdphotomaker', '--sdphotomaker',
'--sdvae', '--sdvae',
'--sdlora', '--sdlora',
'--sdflashattention',
'--sdconvdirect', '--sdconvdirect',
'--sdvaecpu',
'--sdclipgpu',
'--tensor_split', '--tensor_split',
] as const) as ReadonlySet<string>; ] as const) as ReadonlySet<string>;
@ -386,6 +389,14 @@ const COMMAND_LINE_ARGUMENTS = [
default: 0, default: 0,
category: 'Performance', 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', flag: '--defaultgenamt',
description: description:
@ -639,6 +650,21 @@ const COMMAND_LINE_ARGUMENTS = [
default: 768, default: 768,
category: 'Image Generation', 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', flag: '--whispermodel',
description: description:

View file

@ -1,7 +1,8 @@
import { Stack } from '@mantine/core'; import { Stack, Group } from '@mantine/core';
import { useState } from 'react'; import { useState } from 'react';
import { ModelFileField } from '@/components/screens/Launch/ModelFileField'; import { ModelFileField } from '@/components/screens/Launch/ModelFileField';
import { SelectWithTooltip } from '@/components/SelectWithTooltip'; import { SelectWithTooltip } from '@/components/SelectWithTooltip';
import { CheckboxWithTooltip } from '@/components/CheckboxWithTooltip';
import { IMAGE_MODEL_PRESETS } from '@/constants/imageModelPresets'; import { IMAGE_MODEL_PRESETS } from '@/constants/imageModelPresets';
import { useLaunchConfig } from '@/hooks/useLaunchConfig'; import { useLaunchConfig } from '@/hooks/useLaunchConfig';
@ -15,6 +16,8 @@ export const ImageGenerationTab = () => {
sdvae, sdvae,
sdlora, sdlora,
sdconvdirect, sdconvdirect,
sdvaecpu,
sdclipgpu,
handleSdmodelChange, handleSdmodelChange,
handleSdt5xxlChange, handleSdt5xxlChange,
handleSdcliplChange, handleSdcliplChange,
@ -23,6 +26,8 @@ export const ImageGenerationTab = () => {
handleSdvaeChange, handleSdvaeChange,
handleSdloraChange, handleSdloraChange,
handleSdconvdirectChange, handleSdconvdirectChange,
handleSdvaecpuChange,
handleSdclipgpuChange,
handleApplyPreset, handleApplyPreset,
handleSelectSdmodelFile, handleSelectSdmodelFile,
handleSelectSdt5xxlFile, handleSelectSdt5xxlFile,
@ -143,6 +148,22 @@ export const ImageGenerationTab = () => {
{ value: 'full', label: 'Full' }, { 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> </Stack>
); );
}; };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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