feat(ui): enhance IAICustomSelect

Now accepts an array of strings or array of `IAICustomSelectOption`s. This supports custom labels and tooltips within the select component.
This commit is contained in:
psychedelicious
2023-06-09 15:56:43 +10:00
parent 6ad7cc4f2a
commit a33327c651
7 changed files with 215 additions and 116 deletions

View File

@ -14,9 +14,11 @@ const selector = createSelector(
(ui, generation) => {
// TODO: DPMSolverSinglestepScheduler is fixed in https://github.com/huggingface/diffusers/pull/3413
// but we need to wait for the next release before removing this special handling.
const allSchedulers = ui.schedulers.filter((scheduler) => {
return !['dpmpp_2s'].includes(scheduler);
});
const allSchedulers = ui.schedulers
.filter((scheduler) => {
return !['dpmpp_2s'].includes(scheduler);
})
.sort((a, b) => a.localeCompare(b));
return {
scheduler: generation.scheduler,
@ -45,9 +47,9 @@ const ParamScheduler = () => {
return (
<IAICustomSelect
label={t('parameters.scheduler')}
selectedItem={scheduler}
setSelectedItem={handleChange}
items={allSchedulers}
value={scheduler}
data={allSchedulers}
onChange={handleChange}
withCheckIcon
/>
);