diff --git a/README.md b/README.md index 697b792..fa660c6 100644 --- a/README.md +++ b/README.md @@ -414,3 +414,12 @@ To learn more about LoKr, read more about it at [KohakuBlueleaf/LyCORIS](https:/ Everything else should work the same including layer targeting. + +## Updates + +### June 10, 2024 +- Decided to keep track up updates in the readme +- Added support for SDXL in the UI +- Added support for SD 1.5 in the UI +- Fixed UI Wan 2.1 14b name bug +- Added support for for conv training in the UI for models that support it \ No newline at end of file diff --git a/ui/src/app/jobs/new/SimpleJob.tsx b/ui/src/app/jobs/new/SimpleJob.tsx index e8ad1f3..ca58756 100644 --- a/ui/src/app/jobs/new/SimpleJob.tsx +++ b/ui/src/app/jobs/new/SimpleJob.tsx @@ -33,7 +33,6 @@ export default function SimpleJob({ gpuList, datasetOptions, }: Props) { - const modelArch = useMemo(() => { return modelArchs.find(a => a.name === jobConfig.config.process[0].model.arch) as ModelArch; }, [jobConfig.config.process[0].model.arch]); @@ -104,8 +103,7 @@ export default function SimpleJob({ const newDataset = objectCopy(dataset); newDataset.controls = controls; return newDataset; - } - ); + }); setJobConfig(datasets, 'config.process[0].datasets'); }} options={ @@ -131,20 +129,22 @@ export default function SimpleJob({ placeholder="" required /> - -
- setJobConfig(value, 'config.process[0].model.quantize')} - /> - setJobConfig(value, 'config.process[0].model.quantize_te')} - /> -
-
+ {modelArch?.disableSections?.includes('model.quantize') ? null : ( + +
+ setJobConfig(value, 'config.process[0].model.quantize')} + /> + setJobConfig(value, 'config.process[0].model.quantize_te')} + /> +
+
+ )} )} {jobConfig.config.process[0].network?.type == 'lora' && ( - { - console.log('onChange', value); - setJobConfig(value, 'config.process[0].network.linear'); - setJobConfig(value, 'config.process[0].network.linear_alpha'); - }} - placeholder="eg. 16" - min={0} - max={1024} - required - /> + <> + { + console.log('onChange', value); + setJobConfig(value, 'config.process[0].network.linear'); + setJobConfig(value, 'config.process[0].network.linear_alpha'); + }} + placeholder="eg. 16" + min={0} + max={1024} + required + /> + { + modelArch?.disableSections?.includes('network.conv') ? null : ( + { + console.log('onChange', value); + setJobConfig(value, 'config.process[0].network.conv'); + setJobConfig(value, 'config.process[0].network.conv_alpha'); + }} + placeholder="eg. 16" + min={0} + max={1024} + /> + ) + } + )} @@ -276,16 +294,19 @@ export default function SimpleJob({ />
- setJobConfig(value, 'config.process[0].train.timestep_type')} - options={[ - { value: 'sigmoid', label: 'Sigmoid' }, - { value: 'linear', label: 'Linear' }, - { value: 'shift', label: 'Shift' }, - ]} - /> + {modelArch?.disableSections?.includes('train.timestep_type') ? null : ( + setJobConfig(value, 'config.process[0].train.timestep_type')} + options={[ + { value: 'sigmoid', label: 'Sigmoid' }, + { value: 'linear', label: 'Linear' }, + { value: 'shift', label: 'Shift' }, + ]} + /> + )} diff --git a/ui/src/app/jobs/new/jobConfig.ts b/ui/src/app/jobs/new/jobConfig.ts index 5926801..dd28461 100644 --- a/ui/src/app/jobs/new/jobConfig.ts +++ b/ui/src/app/jobs/new/jobConfig.ts @@ -30,6 +30,8 @@ export const defaultJobConfig: JobConfig = { type: 'lora', linear: 32, linear_alpha: 32, + conv: 16, + conv_alpha: 16, lokr_full_rank: true, lokr_factor: -1, network_kwargs: { diff --git a/ui/src/app/jobs/new/options.ts b/ui/src/app/jobs/new/options.ts index 53d63af..e84bc4a 100644 --- a/ui/src/app/jobs/new/options.ts +++ b/ui/src/app/jobs/new/options.ts @@ -1,4 +1,3 @@ - type Control = 'depth' | 'line' | 'pose' | 'inpaint'; export interface ModelArch { @@ -6,11 +5,14 @@ export interface ModelArch { label: string; controls?: Control[]; isVideoModel?: boolean; - defaults?: { [key: string]: [any, any] }; + defaults?: { [key: string]: any }; + disableSections?: DisableableSections[]; } const defaultNameOrPath = ''; +type DisableableSections = 'model.quantize' | 'train.timestep_type' | 'network.conv'; + export const modelArchs: ModelArch[] = [ { name: 'flux', @@ -23,6 +25,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.sampler': ['flowmatch', 'flowmatch'], 'config.process[0].train.noise_scheduler': ['flowmatch', 'flowmatch'], }, + disableSections: ['network.conv'], }, { name: 'flex1', @@ -36,6 +39,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.sampler': ['flowmatch', 'flowmatch'], 'config.process[0].train.noise_scheduler': ['flowmatch', 'flowmatch'], }, + disableSections: ['network.conv'], }, { name: 'flex2', @@ -62,6 +66,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.sampler': ['flowmatch', 'flowmatch'], 'config.process[0].train.noise_scheduler': ['flowmatch', 'flowmatch'], }, + disableSections: ['network.conv'], }, { name: 'chroma', @@ -74,6 +79,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.sampler': ['flowmatch', 'flowmatch'], 'config.process[0].train.noise_scheduler': ['flowmatch', 'flowmatch'], }, + disableSections: ['network.conv'], }, { name: 'wan21:1b', @@ -89,6 +95,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.num_frames': [40, 1], 'config.process[0].sample.fps': [15, 1], }, + disableSections: ['network.conv'], }, { name: 'wan21:14b', @@ -104,6 +111,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.num_frames': [40, 1], 'config.process[0].sample.fps': [15, 1], }, + disableSections: ['network.conv'], }, { name: 'lumina2', @@ -116,6 +124,7 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].sample.sampler': ['flowmatch', 'flowmatch'], 'config.process[0].train.noise_scheduler': ['flowmatch', 'flowmatch'], }, + disableSections: ['network.conv'], }, { name: 'hidream', @@ -131,5 +140,37 @@ export const modelArchs: ModelArch[] = [ 'config.process[0].train.timestep_type': ['shift', 'sigmoid'], 'config.process[0].network.network_kwargs.ignore_if_contains': [['ff_i.experts', 'ff_i.gate'], []], }, + disableSections: ['network.conv'], }, -]; + { + name: 'sdxl', + label: 'SDXL', + defaults: { + // default updates when [selected, unselected] in the UI + 'config.process[0].model.name_or_path': ['stabilityai/stable-diffusion-xl-base-1.0', defaultNameOrPath], + 'config.process[0].model.quantize': [false, false], + 'config.process[0].model.quantize_te': [false, false], + 'config.process[0].sample.sampler': ['ddpm', 'flowmatch'], + 'config.process[0].train.noise_scheduler': ['ddpm', 'flowmatch'], + 'config.process[0].sample.guidance_scale': [6, 4], + }, + disableSections: ['model.quantize', 'train.timestep_type'], + }, + { + name: 'sd15', + label: 'SD 1.5', + defaults: { + // default updates when [selected, unselected] in the UI + 'config.process[0].model.name_or_path': ['stable-diffusion-v1-5/stable-diffusion-v1-5', defaultNameOrPath], + 'config.process[0].sample.sampler': ['ddpm', 'flowmatch'], + 'config.process[0].train.noise_scheduler': ['ddpm', 'flowmatch'], + 'config.process[0].sample.width': [512, 1024], + 'config.process[0].sample.height': [512, 1024], + 'config.process[0].sample.guidance_scale': [6, 4], + }, + disableSections: ['model.quantize', 'train.timestep_type'], + }, +].sort((a, b) => { + // Sort by label, case-insensitive + return a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }) +}) as any; diff --git a/ui/src/components/formInputs.tsx b/ui/src/components/formInputs.tsx index 7f53e68..a9908bd 100644 --- a/ui/src/components/formInputs.tsx +++ b/ui/src/components/formInputs.tsx @@ -2,8 +2,8 @@ import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import dynamic from "next/dynamic"; -const Select = dynamic(() => import("react-select"), { ssr: false }); +import dynamic from 'next/dynamic'; +const Select = dynamic(() => import('react-select'), { ssr: false }); const labelClasses = 'block text-xs mb-1 mt-2 text-gray-300'; const inputClasses = @@ -42,7 +42,7 @@ export const TextInput = forwardRef( />
); - } + }, ); // 👇 Helpful for debugging @@ -114,6 +114,7 @@ export const NumberInput = (props: NumberInputProps) => { export interface SelectInputProps extends InputProps { value: string; + disabled?: boolean; onChange: (value: string) => void; options: { value: string; label: string }[]; } @@ -122,11 +123,16 @@ export const SelectInput = (props: SelectInputProps) => { const { label, value, onChange, options } = props; const selectedOption = options.find(option => option.value === value); return ( -
+
{label && } -