fix graduallyInpainting: alway draw newest lines on mask
this can prevent previous result change
This commit is contained in:
parent
dc950ed3fe
commit
54289ea66d
@ -129,7 +129,7 @@ export default function Editor(props: EditorProps) {
|
|||||||
[context, original]
|
[context, original]
|
||||||
)
|
)
|
||||||
|
|
||||||
const drawAllLinesOnMask = (_lineGroups: LineGroup[]) => {
|
const drawLinesOnMask = (_lineGroups: LineGroup[]) => {
|
||||||
if (!context?.canvas.width || !context?.canvas.height) {
|
if (!context?.canvas.width || !context?.canvas.height) {
|
||||||
throw new Error('canvas has invalid size')
|
throw new Error('canvas has invalid size')
|
||||||
}
|
}
|
||||||
@ -154,7 +154,11 @@ export default function Editor(props: EditorProps) {
|
|||||||
setCurLineGroup([])
|
setCurLineGroup([])
|
||||||
setIsDraging(false)
|
setIsDraging(false)
|
||||||
setIsInpaintingLoading(true)
|
setIsInpaintingLoading(true)
|
||||||
drawAllLinesOnMask(newLineGroups)
|
if (settings.graduallyInpainting) {
|
||||||
|
drawLinesOnMask([curLineGroup])
|
||||||
|
} else {
|
||||||
|
drawLinesOnMask(newLineGroups)
|
||||||
|
}
|
||||||
|
|
||||||
let targetFile = file
|
let targetFile = file
|
||||||
if (settings.graduallyInpainting === true && renders.length > 0) {
|
if (settings.graduallyInpainting === true && renders.length > 0) {
|
||||||
|
@ -49,7 +49,7 @@ export interface Settings {
|
|||||||
|
|
||||||
export const settingStateDefault = {
|
export const settingStateDefault = {
|
||||||
show: false,
|
show: false,
|
||||||
graduallyInpainting: false,
|
graduallyInpainting: true,
|
||||||
runInpaintingManually: false,
|
runInpaintingManually: false,
|
||||||
model: AIModel.LAMA,
|
model: AIModel.LAMA,
|
||||||
ldmSteps: 50,
|
ldmSteps: 50,
|
||||||
|
Loading…
Reference in New Issue
Block a user