Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Disable feathering for whole-image edits

Bitticcdad8264881
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index e821c6c..73af4e2 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -12,6 +12,7 @@ This alpha update adds Prompt video scenes, agent image drafts, Sol attention an
## Fixes and improvements
+- Whole-image edits now reach every edge without feathering.
- Imported still images now have steps, seed and resolution controls. Resolution defaults to the source dimensions rounded down to multiples of 32, with additional sizes matching the source aspect ratio.
- Fixed CUDA transformer-loading memory failures with bounded upload buffers, more accurate memory budgeting and automatic retries with more CPU offloading, while preserving precision and output settings.
- Agent chat retains earlier replies, corrections and errors throughout the conversation. Raw JSON and command payloads stay hidden; readable replies and summaries are shown.
diff --git a/src/lib/imageEditing.test.ts b/src/lib/imageEditing.test.ts
index 4b0085a..5ee955c 100644
--- a/src/lib/imageEditing.test.ts
+++ b/src/lib/imageEditing.test.ts
@@ -96,7 +96,8 @@ it("applies whole-image actions first and compiles only the references each edit
config.imageScene = addImageNode(config.imageScene, root.id, "object");
Object.assign(config.imageScene.nodes[1], { description: "Add a @[ref:Balloon]" });
let edits = compileImageEdits(config).edits;
- expect(edits[0]).toMatchObject({ x: 0, y: 0, width: 96, height: 64 });
+ expect(edits[0]).toMatchObject({ x: 0, y: 0, width: 96, height: 64, feather: 0 });
+ expect(edits[1].feather).toBeUndefined();
expect(edits[0].prompt).toContain("Warm up the entire image like <Subject 1>");
expect(edits[0].prompt).toContain("<Subject 1> is Lighting, providing appearance from <Picture 2>");
expect(edits[0].prompt).not.toContain("Balloon");
@@ -110,3 +111,14 @@ it("applies whole-image actions first and compiles only the references each edit
config.imageScene.nodes[1].description = "Add a @[ref:missing]";
expect(() => compileImageEdits(config)).toThrow("The prompt cites a reference that no longer exists.");
});
+
+it("disables feathering for a full-canvas edit box at the selected resolution", () => {
+ const config = parseProjectConfig(fixture);
+ config.imageScene = addImageNode(createImageEditScene({ relativePath: "media/source.png", name: "Source", width: 1001, height: 809 }), "image-root", "object", { x: 0, y: 0, width: 1000, height: 1000 });
+ config.imageScene.outputSize = { width: 672, height: 544 };
+ config.imageScene.nodes[1].description = "Warm up the lighting";
+ expect(compileImageEdits(config).edits[0]).toMatchObject({ x: 0, y: 0, width: 672, height: 544, feather: 0 });
+ // A local edit touching the canvas edge still blends with the rest of the image.
+ config.imageScene.nodes[1].box!.width = 500;
+ expect(compileImageEdits(config).edits[0].feather).toBeUndefined();
+});
diff --git a/src/lib/imageEditing.ts b/src/lib/imageEditing.ts
index fcd8099..deb54de 100644
--- a/src/lib/imageEditing.ts
+++ b/src/lib/imageEditing.ts
@@ -47,7 +47,10 @@ export function compileImageEdits(config: ProjectConfig): { source: ImageSource;
node.text ? `Render the exact text "${node.text}".` : ""].filter(Boolean).join(" ");
const editScene = { ...createImageScene(description), rootType: "image" as const, sourceImage: source, referenceIds: [] };
const compiled = compileImagePrompt({ ...config, imageSettings: { ...imageSettings(config), defaultLook: null }, imageScene: editScene });
- return { prompt: compiled.prompt, references: compiled.references, x, y, width: Math.max(1, right - x), height: Math.max(1, bottom - y) };
+ // A full-canvas edit has no surrounding source to blend into at its edges.
+ const wholeImage = x === 0 && y === 0 && right === size.width && bottom === size.height;
+ return { prompt: compiled.prompt, references: compiled.references, x, y, width: Math.max(1, right - x), height: Math.max(1, bottom - y),
+ ...(wholeImage ? { feather: 0 } : {}) };
});
if (!edits.length) throw new Error("Enter a whole-image edit prompt or add an Edit node before generating.");
return { source, edits };
diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.ts
index 9384ac5..373e982 100644
--- a/src/lib/workQueue.test.ts
+++ b/src/lib/workQueue.test.ts
@@ -463,7 +463,8 @@ describe("image generation work", () => {
const request = vi.mocked(enqueueSlopfabGeneration).mock.calls[0][0];
const steps = request.imageEdit!.edits;
expect(steps).toHaveLength(2);
- expect(steps[0]).toMatchObject({ x: 0, y: 0, width: 96, height: 64 });
+ expect(steps[0]).toMatchObject({ x: 0, y: 0, width: 96, height: 64, feather: 0 });
+ expect(steps[1].feather).toBeUndefined();
for (const [index, name] of ["Lighting", "Balloon"].entries()) {
expect(steps[index].referencePaths).toEqual(["C:/Image/media/generated/source.jpg", `C:/Image/references/${name}.png`]);
expect(steps[index].refmods).toEqual([{ path: `C:/Image/references/${name}.safetensors`, strength: 0.75, copies: 2 }]);
@@ -527,7 +528,7 @@ describe("image generation work", () => {
queue.enqueueImage(session, template);
await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledOnce());
const expected = { steps: 32, seed: 123456, canvasWidth: 672, canvasHeight: 544,
- imageEdit: { sourceRelativePath: "media/source.png", edits: [expect.objectContaining({ x: 0, y: 0, width: 672, height: 544 })] } };
+ imageEdit: { sourceRelativePath: "media/source.png", edits: [expect.objectContaining({ x: 0, y: 0, width: 672, height: 544, feather: 0 })] } };
expect(vi.mocked(resolveSlopfabPlan).mock.calls[0][0]).toMatchObject(expected);
const request = vi.mocked(enqueueSlopfabGeneration).mock.calls[0][0];
expect(request).toMatchObject(expected);