Skip to content

Commit f0a6c4a

Browse files
fix(ui): after canceling a filter, layer loses its content
1 parent f36d22f commit f0a6c4a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

invokeai/frontend/web/src/features/controlLayers/konva/CanvasEntity/CanvasEntityFilterer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,15 @@ export class CanvasEntityFilterer extends CanvasModuleBase {
424424
// the user has applied the filter and the image has been adopted by the parent entity.
425425
if (this.imageModule && this.imageModule.konva.group.parent === this.konva.group) {
426426
this.imageModule.destroy();
427-
this.imageModule = null;
428427
}
428+
429+
// When a filter is applied, the image module is adopted by the parent entity as a "permanent" module.
430+
// Null this reference to prevent the filter module from accidentally trying to destroy a module that the
431+
// parent entity is now responsible for.
432+
this.imageModule = null;
433+
429434
const initialFilterConfig = deepClone(this.$initialFilterConfig.get() ?? this.createInitialFilterConfig());
435+
430436
this.$filterConfig.set(initialFilterConfig);
431437
this.$imageState.set(null);
432438
this.$lastProcessedHash.set('');

0 commit comments

Comments
 (0)