mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: Upload not working correctly on the ip Adapter image upload
This commit is contained in:
parent
b7773c9962
commit
231b7a5000
@ -3,7 +3,7 @@ import { skipToken } from '@reduxjs/toolkit/dist/query';
|
|||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
import IAIDndImage from 'common/components/IAIDndImage';
|
import IAIDndImage from 'common/components/IAIDndImage';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
import IAIDndImageIcon from 'common/components/IAIDndImageIcon';
|
||||||
import { IAINoContentFallback } from 'common/components/IAIImageFallback';
|
import { IAINoContentFallback } from 'common/components/IAIImageFallback';
|
||||||
import { ipAdapterImageChanged } from 'features/controlNet/store/controlNetSlice';
|
import { ipAdapterImageChanged } from 'features/controlNet/store/controlNetSlice';
|
||||||
import {
|
import {
|
||||||
@ -14,6 +14,7 @@ import { memo, useMemo } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FaUndo } from 'react-icons/fa';
|
import { FaUndo } from 'react-icons/fa';
|
||||||
import { useGetImageDTOQuery } from 'services/api/endpoints/images';
|
import { useGetImageDTOQuery } from 'services/api/endpoints/images';
|
||||||
|
import { PostUploadAction } from 'services/api/types';
|
||||||
|
|
||||||
const ParamIPAdapterImage = () => {
|
const ParamIPAdapterImage = () => {
|
||||||
const ipAdapterInfo = useAppSelector(
|
const ipAdapterInfo = useAppSelector(
|
||||||
@ -49,6 +50,13 @@ const ParamIPAdapterImage = () => {
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const postUploadAction = useMemo<PostUploadAction>(
|
||||||
|
() => ({
|
||||||
|
type: 'SET_IP_ADAPTER_IMAGE',
|
||||||
|
}),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
sx={{
|
sx={{
|
||||||
@ -62,7 +70,8 @@ const ParamIPAdapterImage = () => {
|
|||||||
imageDTO={imageDTO}
|
imageDTO={imageDTO}
|
||||||
droppableData={droppableData}
|
droppableData={droppableData}
|
||||||
draggableData={draggableData}
|
draggableData={draggableData}
|
||||||
isUploadDisabled={true}
|
postUploadAction={postUploadAction}
|
||||||
|
isUploadDisabled={!isIPAdapterEnabled}
|
||||||
isDropDisabled={!isIPAdapterEnabled}
|
isDropDisabled={!isIPAdapterEnabled}
|
||||||
dropLabel={t('toast.setIPAdapterImage')}
|
dropLabel={t('toast.setIPAdapterImage')}
|
||||||
noContentFallback={
|
noContentFallback={
|
||||||
@ -72,21 +81,11 @@ const ParamIPAdapterImage = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{ipAdapterInfo.adapterImage && (
|
<IAIDndImageIcon
|
||||||
<IAIIconButton
|
onClick={() => dispatch(ipAdapterImageChanged(null))}
|
||||||
tooltip={t('controlnet.resetIPAdapterImage')}
|
icon={ipAdapterInfo.adapterImage ? <FaUndo /> : undefined}
|
||||||
aria-label={t('controlnet.resetIPAdapterImage')}
|
tooltip={t('controlnet.resetIPAdapterImage')}
|
||||||
icon={<FaUndo />}
|
/>
|
||||||
onClick={() => dispatch(ipAdapterImageChanged(null))}
|
|
||||||
isDisabled={!imageDTO}
|
|
||||||
size="sm"
|
|
||||||
sx={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 3,
|
|
||||||
right: 3,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user