diff --git a/utility/session.js b/utility/session.js index 232cc40..7b49ad0 100644 --- a/utility/session.js +++ b/utility/session.js @@ -201,11 +201,7 @@ class GenerationSession { this.deleteProgressImageHtml() await this.deleteProgressLayer() } - async setControlNetImage(control_net_index = 0) { - //check if the selection area is active - //convert layer to base64 - //the width and height of the exported image - + async setControlNetImageHelper() { const width = html_manip.getWidth() const height = html_manip.getHeight() @@ -237,7 +233,13 @@ class GenerationSession { ) await layer_util.deleteLayers([layer]) //delete the snapshot layer if it exists - + return base64_image + } + async setControlNetImage(control_net_index = 0, base64_image) { + //check if the selection area is active + //convert layer to base64 + //the width and height of the exported image + // const base64_image = this.setControlNetImageHelper() this.controlNetImage[control_net_index] = base64_image html_manip.setControlImageSrc( base64ToBase64Url(base64_image),