fix(ui): move lora followup fixes

This commit is contained in:
psychedelicious 2024-06-17 12:33:35 +10:00
parent ca9314e077
commit 396d0a4bc0
6 changed files with 12 additions and 13 deletions

View File

@ -2,8 +2,7 @@ import { getStore } from 'app/store/nanostores/store';
import { deepClone } from 'common/util/deepClone';
import { objectKeys } from 'common/util/objectKeys';
import { shouldConcatPromptsChanged } from 'features/controlLayers/store/canvasV2Slice';
import type { LayerData } from 'features/controlLayers/store/types';
import type { LoRA } from 'features/lora/store/loraSlice';
import type { LayerData, LoRA } from 'features/controlLayers/store/types';
import type {
AnyControlAdapterConfigMetadata,
BuildMetadataHandlers,

View File

@ -1,5 +1,6 @@
import { getCAId, getImageObjectId, getIPAId, getLayerId } from 'features/controlLayers/konva/naming';
import type { ControlAdapterData, IPAdapterData, LayerData } from 'features/controlLayers/store/types';
import { defaultLoRAConfig } from 'features/controlLayers/store/lorasReducers';
import type { ControlAdapterData, IPAdapterData, LayerData, LoRA } from 'features/controlLayers/store/types';
import {
CA_PROCESSOR_DATA,
imageDTOToImageWithDims,
@ -9,8 +10,6 @@ import {
isProcessorTypeV2,
zLayerData,
} from 'features/controlLayers/store/types';
import type { LoRA } from 'features/lora/store/loraSlice';
import { defaultLoRAConfig } from 'features/lora/store/loraSlice';
import type {
ControlNetConfigMetadata,
IPAdapterConfigMetadata,

View File

@ -16,6 +16,8 @@ import {
ipaRecalled,
layerAllDeleted,
layerRecalled,
loraAllDeleted,
loraRecalled,
negativePrompt2Changed,
negativePromptChanged,
positivePrompt2Changed,
@ -41,11 +43,10 @@ import type {
ControlAdapterData,
IPAdapterData,
LayerData,
LoRA,
RegionalGuidanceData,
} from 'features/controlLayers/store/types';
import { setHrfEnabled, setHrfMethod, setHrfStrength } from 'features/hrf/store/hrfSlice';
import type { LoRA } from 'features/lora/store/loraSlice';
import { loraRecalled, lorasReset } from 'features/lora/store/loraSlice';
import type {
ControlNetConfigMetadata,
IPAdapterConfigMetadata,
@ -186,17 +187,17 @@ const recallVAE: MetadataRecallFunc<ParameterVAEModel | null | undefined> = (vae
};
const recallLoRA: MetadataRecallFunc<LoRA> = (lora) => {
getStore().dispatch(loraRecalled(lora));
getStore().dispatch(loraRecalled({ lora }));
};
const recallAllLoRAs: MetadataRecallFunc<LoRA[]> = (loras) => {
const { dispatch } = getStore();
dispatch(lorasReset());
dispatch(loraAllDeleted());
if (!loras.length) {
return;
}
loras.forEach((lora) => {
dispatch(loraRecalled(lora));
dispatch(loraRecalled({ lora }));
});
};

View File

@ -1,6 +1,5 @@
import { getStore } from 'app/store/nanostores/store';
import type { LayerData } from 'features/controlLayers/store/types';
import type { LoRA } from 'features/lora/store/loraSlice';
import type { LayerData, LoRA } from 'features/controlLayers/store/types';
import type {
ControlNetConfigMetadata,
IPAdapterConfigMetadata,

View File

@ -18,7 +18,7 @@ export const PromptTriggerSelect = memo(({ onSelect, onClose }: PromptTriggerSel
const { t } = useTranslation();
const mainModel = useAppSelector((s) => s.canvasV2.params.model);
const addedLoRAs = useAppSelector((s) => s.lora.loras);
const addedLoRAs = useAppSelector((s) => s.canvasV2.loras);
const { data: mainModelConfig, isLoading: isLoadingMainModelConfig } = useGetModelConfigQuery(
mainModel?.key ?? skipToken
);

View File

@ -38,6 +38,7 @@ export const useClearIntermediates = (shouldShowClearIntermediates: boolean): Us
_clearIntermediates()
.unwrap()
.then((clearedCount) => {
// TODO(psyche): Do we need to reset things w/ canvas v2?
// dispatch(controlAdaptersReset());
// dispatch(resetCanvas());
toast({