mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Removes mask lines check
This commit is contained in:
parent
38fd0668ba
commit
4039e9e368
@ -30,8 +30,6 @@ export const useCheckParametersSelector = createSelector(
|
||||
isProcessing: system.isProcessing,
|
||||
isConnected: system.isConnected,
|
||||
// inpainting
|
||||
isMaskEmpty:
|
||||
inpainting.lines.filter((line) => line.tool === 'brush').length === 0,
|
||||
hasInpaintingImage: Boolean(inpainting.imageToInpaint),
|
||||
};
|
||||
},
|
||||
@ -56,7 +54,6 @@ const useCheckParameters = (): boolean => {
|
||||
activeTabName,
|
||||
isProcessing,
|
||||
isConnected,
|
||||
isMaskEmpty,
|
||||
hasInpaintingImage,
|
||||
} = useAppSelector(useCheckParametersSelector);
|
||||
|
||||
@ -70,10 +67,7 @@ const useCheckParameters = (): boolean => {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
activeTabName === 'inpainting' &&
|
||||
(!hasInpaintingImage || isMaskEmpty)
|
||||
) {
|
||||
if (activeTabName === 'inpainting' && !hasInpaintingImage) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -113,7 +107,6 @@ const useCheckParameters = (): boolean => {
|
||||
seedWeights,
|
||||
seed,
|
||||
activeTabName,
|
||||
isMaskEmpty,
|
||||
hasInpaintingImage,
|
||||
]);
|
||||
};
|
||||
|
@ -127,7 +127,7 @@ export const frontendToBackendParameters = (
|
||||
generationParameters.strength = img2imgStrength;
|
||||
generationParameters.fit = false;
|
||||
|
||||
const maskDataURL = generateMask(maskImageElement, lines);
|
||||
const maskDataURL = generateMask(maskImageElement, lines, boundingBox);
|
||||
|
||||
generationParameters.init_mask = maskDataURL.split(
|
||||
'data:image/png;base64,'
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Konva from 'konva';
|
||||
import { IRect } from 'konva/lib/types';
|
||||
import { MaskLine } from '../inpaintingSlice';
|
||||
|
||||
/**
|
||||
@ -11,7 +12,11 @@ import { MaskLine } from '../inpaintingSlice';
|
||||
* drawing the mask and compositing everything correctly to output a valid
|
||||
* mask image.
|
||||
*/
|
||||
const generateMask = (image: HTMLImageElement, lines: MaskLine[]) => {
|
||||
const generateMask = (
|
||||
image: HTMLImageElement,
|
||||
lines: MaskLine[],
|
||||
boundingBox: IRect
|
||||
) => {
|
||||
const { width, height } = image;
|
||||
|
||||
const offscreenContainer = document.createElement('div');
|
||||
|
Loading…
Reference in New Issue
Block a user