From cd4dc654203217c0798139f08202e6651eb3897e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 9 May 2024 14:58:17 -0400 Subject: [PATCH] Fix --- structures/Tensorflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structures/Tensorflow.js b/structures/Tensorflow.js index 65da1c55..8006a0fa 100644 --- a/structures/Tensorflow.js +++ b/structures/Tensorflow.js @@ -83,7 +83,7 @@ module.exports = class Tensorflow { const stylizedImage = (await this.transformerModel.predict([loadedImage, stylePrediction])).squeeze(); loadedImage.dispose(); stylePrediction.dispose(); - const encodedImg = stylizedImage.mul(255).toInt(); + const encodedImg = stylizedImage.mul(255).clipByValue(0, 255).toInt(); stylizedImage.dispose(); const buffer = await tf.node.encodeJpeg(encodedImg); encodedImg.dispose();