aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-28 15:43:21 -0400
committerbobzel <zzzman@gmail.com>2025-04-28 15:43:21 -0400
commitefa1501b38aa71f306ae0717afc86f0803c71be2 (patch)
treefd2fc9a615b5f374f1a17d7fc6ef49e35f639611
parenta25dc02334de3f5b58aff1911bdae30d49a1d26b (diff)
fix for outpainting alignment
-rw-r--r--src/client/views/nodes/ImageBox.tsx2
-rw-r--r--src/server/ApiManagers/FireflyManager.ts8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 197ef0998..004c2da44 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -444,6 +444,8 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
this.Document.$ai = true;
this.Document.$ai_outpainted = true;
this.Document.$ai_outpaint_prompt = customPrompt;
+ this.Document._outpaintingOriginalWidth = undefined;
+ this.Document._outpaintingOriginalHeight = undefined;
} else {
this.Document._width = origWidth;
this.Document._height = origHeight;
diff --git a/src/server/ApiManagers/FireflyManager.ts b/src/server/ApiManagers/FireflyManager.ts
index 63581d3b3..1b8a85a5c 100644
--- a/src/server/ApiManagers/FireflyManager.ts
+++ b/src/server/ApiManagers/FireflyManager.ts
@@ -343,10 +343,10 @@ export default class FireflyManager extends ApiManager {
numVariations: 1,
placement: {
inset: {
- left: Math.round(req.body.newDimensions.width - req.body.originalDimensions.width) / 2,
- top: Math.round(req.body.newDimensions.height - req.body.originalDimensions.height) / 2,
- right: Math.round(req.body.newDimensions.width - req.body.originalDimensions.width) / 2,
- bottom: Math.round(req.body.newDimensions.height - req.body.originalDimensions.height) / 2,
+ left: Math.round((req.body.newDimensions.width - req.body.originalDimensions.width) / 2),
+ top: Math.round((req.body.newDimensions.height - req.body.originalDimensions.height) / 2),
+ right: Math.round((req.body.newDimensions.width - req.body.originalDimensions.width) / 2),
+ bottom: Math.round((req.body.newDimensions.height - req.body.originalDimensions.height) / 2),
},
alignment: {
horizontal: 'center',