Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Watermark Remover: a tile's one box over marks found apart is dropped for them

Adarsha4d126098bd6
diff --git a/src/lib/watermark.ts b/src/lib/watermark.ts
index a21704fe..32bdeb08 100644
--- a/src/lib/watermark.ts
+++ b/src/lib/watermark.ts
@@ -215,6 +215,8 @@ export function scanTiles(width: number, height: number): Box[] {
}
interface ScanItem {
+ /** Which scan found it: 0 the whole photo, then the tiles in scanTiles order. */
+ src: number;
label: string;
box: Box;
type: OverlayType;
@@ -294,6 +296,7 @@ export function mergeScanReports(full: string | undefined | null, tiles: (string
const b = items[j];
if (overlap(a.box, b.box) < 0.2 * Math.min(boxArea(a.box), boxArea(b.box))) continue;
items[i] = {
+ src: a.src,
label: b.label.length > a.label.length ? b.label : a.label,
box: [Math.min(a.box[0], b.box[0]), Math.min(a.box[1], b.box[1]), Math.max(a.box[2], b.box[2]), Math.max(a.box[3], b.box[3])],
type: a.type === "unknown" || b.type === "translucent_text_logo" ? b.type : a.type,
diff --git a/tests/preset-recipes.test.ts b/tests/preset-recipes.test.ts
index 5453467c..50f43137 100644
--- a/tests/preset-recipes.test.ts
+++ b/tests/preset-recipes.test.ts
@@ -67,7 +67,7 @@ describe("which presets get a recipe", () => {
// Graded presets whose clip was graded afterwards and that have no recipe in the book.
const gradesWithoutRecipe = [...MOTIONS, ...EFFECTS].filter((x) => x.grade && !recipeKind(x));
expect(new Set(none.map((x) => x.id))).toEqual(new Set([...gradesWithoutRecipe.map((x) => x.id), ...OWN_ROUTE_APPS]));
- expect(none).toHaveLength(34);
+ expect(none).toHaveLength(35);
for (const x of none) for (const engine of ["open", "cloud"] as const) expect(presetRecipe(x, engine, inCatalog), x.id).toBeUndefined();
});