mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-24 14:02:11 -03:00
Added mask and image input
This commit is contained in:
@@ -91,6 +91,11 @@ export class Canvas {
|
||||
onStateChange: (() => void) | undefined;
|
||||
pendingBatchContext: any;
|
||||
pendingDataCheck: number | null;
|
||||
pendingInputDataCheck: number | null;
|
||||
inputDataLoaded: boolean;
|
||||
lastLoadedImageSrc?: string;
|
||||
lastLoadedLinkId?: number;
|
||||
lastLoadedMaskLinkId?: number;
|
||||
previewVisible: boolean;
|
||||
requestSaveState: () => void;
|
||||
viewport: Viewport;
|
||||
@@ -138,6 +143,8 @@ export class Canvas {
|
||||
|
||||
this.dataInitialized = false;
|
||||
this.pendingDataCheck = null;
|
||||
this.pendingInputDataCheck = null;
|
||||
this.inputDataLoaded = false;
|
||||
this.imageCache = new Map();
|
||||
|
||||
this.requestSaveState = () => {};
|
||||
@@ -483,6 +490,11 @@ export class Canvas {
|
||||
};
|
||||
|
||||
const handleExecutionStart = () => {
|
||||
// Check for input data when execution starts, but don't reset the flag
|
||||
log.debug('Execution started, checking for input data...');
|
||||
// Don't reset inputDataLoaded here - we want to remember if we already loaded this input
|
||||
this.canvasIO.checkForInputData();
|
||||
|
||||
if (getAutoRefreshValue()) {
|
||||
lastExecutionStartTime = Date.now();
|
||||
// Store a snapshot of the context for the upcoming batch
|
||||
@@ -506,6 +518,10 @@ export class Canvas {
|
||||
};
|
||||
|
||||
const handleExecutionSuccess = async () => {
|
||||
// Always check for input data after execution completes
|
||||
log.debug('Execution success, checking for input data...');
|
||||
await this.canvasIO.checkForInputData();
|
||||
|
||||
if (getAutoRefreshValue()) {
|
||||
log.info('Auto-refresh triggered, importing latest images.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user