Files
Comfyui-LayerForge/js/ImageCache.js
Dariusz L c892f93c35 Refactor utils imports and move utility files to utils/
Moved CommonUtils.js, ImageUtils.js, and LoggerUtils.js to a new utils/ directory and updated all import paths accordingly throughout the codebase. Also increased the default canvas width in Canvas.js from 512 to 1024.
2025-06-26 03:44:21 +02:00

31 lines
668 B
JavaScript

import {createModuleLogger} from "./utils/LoggerUtils.js";
// Inicjalizacja loggera dla modułu ImageCache
const log = createModuleLogger('ImageCache');
export class ImageCache {
constructor() {
this.cache = new Map();
}
set(key, imageData) {
log.info("Caching image data for key:", key);
this.cache.set(key, imageData);
}
get(key) {
const data = this.cache.get(key);
log.debug("Retrieved cached data for key:", key, !!data);
return data;
}
has(key) {
return this.cache.has(key);
}
clear() {
log.info("Clearing image cache");
this.cache.clear();
}
}