From 3947d4a165ca4dc1895fa120c5aaef87e6da5086 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:25:25 +1000 Subject: [PATCH] fix(ui): normalize infill alpha to 0-255 when building infill nodes The browser/UI uses float 0-1 for alpha, while backend uses 0-255. We need to normalize the value when building the infill nodes for outpaint. --- .../web/src/features/nodes/util/graph/graphBuilderUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/graphBuilderUtils.ts b/invokeai/frontend/web/src/features/nodes/util/graph/graphBuilderUtils.ts index 3a3d5e508a..9d134099c3 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/graphBuilderUtils.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/graphBuilderUtils.ts @@ -106,10 +106,12 @@ export const getInfill = ( } if (infillMethod === 'color') { + const { a, ...rgb } = infillColorValue; + const color = { ...rgb, a: Math.round(a * 255) }; return g.addNode({ id: 'infill_rgba', type: 'infill_rgba', - color: infillColorValue, + color, }); }