implement strict image/mask input separation

Enhanced LayerForge input handling to strictly separate image and mask loading based on connection type. Images now only load when allowImage=true and masks only when allowMask=true, preventing unintended cross-loading between input types.
This commit is contained in:
Dariusz L
2025-08-09 01:44:31 +02:00
parent 285ad035b2
commit b21d6e3502
6 changed files with 244 additions and 118 deletions

View File

@@ -492,8 +492,8 @@ 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();
// On start, only allow images; mask should load on mask-connect or after execution completes
this.canvasIO.checkForInputData({ allowImage: true, allowMask: false, reason: 'execution_start' });
if (getAutoRefreshValue()) {
lastExecutionStartTime = Date.now();
@@ -520,7 +520,7 @@ 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();
await this.canvasIO.checkForInputData({ allowImage: true, allowMask: true, reason: 'execution_success' });
if (getAutoRefreshValue()) {
log.info('Auto-refresh triggered, importing latest images.');