mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add reset button for control image
This commit is contained in:
parent
6c2b39d1df
commit
ae14adec2a
@ -51,6 +51,9 @@ const ControlNetImagePreview = (props: Props) => {
|
|||||||
[controlImage, controlNetId, dispatch]
|
[controlImage, controlNetId, dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleResetControlImage = useCallback(() => {
|
||||||
|
dispatch(controlNetImageChanged({ controlNetId, controlImage: null }));
|
||||||
|
}, [controlNetId, dispatch]);
|
||||||
const handleMouseEnter = useCallback(() => {
|
const handleMouseEnter = useCallback(() => {
|
||||||
setIsMouseOverImage(true);
|
setIsMouseOverImage(true);
|
||||||
}, []);
|
}, []);
|
||||||
@ -150,6 +153,22 @@ const ControlNetImagePreview = (props: Props) => {
|
|||||||
<IAIImageFallback />
|
<IAIImageFallback />
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
{controlImage && (
|
||||||
|
<Flex sx={{ position: 'absolute', top: 0, insetInlineEnd: 0 }}>
|
||||||
|
<IAIIconButton
|
||||||
|
aria-label="Reset Control Image"
|
||||||
|
tooltip="Reset Control Image"
|
||||||
|
size="sm"
|
||||||
|
onClick={handleResetControlImage}
|
||||||
|
icon={<FaUndo />}
|
||||||
|
variant="link"
|
||||||
|
sx={{
|
||||||
|
p: 2,
|
||||||
|
color: 'base.50',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user