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.

Video tools: a Remove background example, and its card's cut-out

Adarshc9cc12487bd8
diff --git a/public/examples/video-tools/1/in-video.384.webp b/public/examples/video-tools/1/in-video.384.webp
new file mode 100644
index 00000000..5b23f811
Binary files /dev/null and b/public/examples/video-tools/1/in-video.384.webp differ
diff --git a/public/examples/video-tools/1/in-video.mp4 b/public/examples/video-tools/1/in-video.mp4
new file mode 100644
index 00000000..36ca0803
Binary files /dev/null and b/public/examples/video-tools/1/in-video.mp4 differ
diff --git a/public/examples/video-tools/1/show.mp4 b/public/examples/video-tools/1/show.mp4
new file mode 100644
index 00000000..23d79eea
Binary files /dev/null and b/public/examples/video-tools/1/show.mp4 differ
diff --git a/public/examples/video-tools/1/show.peak.webp b/public/examples/video-tools/1/show.peak.webp
new file mode 100644
index 00000000..e9f7643e
Binary files /dev/null and b/public/examples/video-tools/1/show.peak.webp differ
diff --git a/public/examples/video-tools/1/show.poster.webp b/public/examples/video-tools/1/show.poster.webp
new file mode 100644
index 00000000..79d79c1d
Binary files /dev/null and b/public/examples/video-tools/1/show.poster.webp differ
diff --git a/public/examples/video-tools/2/in-video.384.webp b/public/examples/video-tools/2/in-video.384.webp
new file mode 100644
index 00000000..27bbf5b6
Binary files /dev/null and b/public/examples/video-tools/2/in-video.384.webp differ
diff --git a/public/examples/video-tools/2/in-video.mp4 b/public/examples/video-tools/2/in-video.mp4
new file mode 100644
index 00000000..2c8652f9
Binary files /dev/null and b/public/examples/video-tools/2/in-video.mp4 differ
diff --git a/public/previews/fx/video-tools/after.480.avif b/public/previews/fx/video-tools/after.480.avif
new file mode 100644
index 00000000..ddc74365
Binary files /dev/null and b/public/previews/fx/video-tools/after.480.avif differ
diff --git a/public/previews/fx/video-tools/after.480.webp b/public/previews/fx/video-tools/after.480.webp
new file mode 100644
index 00000000..70a3f9bf
Binary files /dev/null and b/public/previews/fx/video-tools/after.480.webp differ
diff --git a/public/previews/fx/video-tools/after.960.avif b/public/previews/fx/video-tools/after.960.avif
new file mode 100644
index 00000000..8d497631
Binary files /dev/null and b/public/previews/fx/video-tools/after.960.avif differ
diff --git a/public/previews/fx/video-tools/after.960.webp b/public/previews/fx/video-tools/after.960.webp
new file mode 100644
index 00000000..53750cec
Binary files /dev/null and b/public/previews/fx/video-tools/after.960.webp differ
diff --git a/public/previews/fx/video-tools/before.480.avif b/public/previews/fx/video-tools/before.480.avif
new file mode 100644
index 00000000..55fa674f
Binary files /dev/null and b/public/previews/fx/video-tools/before.480.avif differ
diff --git a/public/previews/fx/video-tools/before.480.webp b/public/previews/fx/video-tools/before.480.webp
new file mode 100644
index 00000000..1e63852c
Binary files /dev/null and b/public/previews/fx/video-tools/before.480.webp differ
diff --git a/public/previews/fx/video-tools/before.960.avif b/public/previews/fx/video-tools/before.960.avif
new file mode 100644
index 00000000..38ed8e4e
Binary files /dev/null and b/public/previews/fx/video-tools/before.960.avif differ
diff --git a/public/previews/fx/video-tools/before.960.webp b/public/previews/fx/video-tools/before.960.webp
new file mode 100644
index 00000000..3d1c375d
Binary files /dev/null and b/public/previews/fx/video-tools/before.960.webp differ
diff --git a/scripts/examples/publish-examples.mjs b/scripts/examples/publish-examples.mjs
index f6bfef8f..e67c76ee 100644
--- a/scripts/examples/publish-examples.mjs
+++ b/scripts/examples/publish-examples.mjs
@@ -285,6 +285,15 @@ async function writeManifest(dry) {
const p = posterFor(row.output);
if (p) e.poster = `${p}?v=${(await add(p, media[p]?.role ?? "show")).v}`;
}
+ // A card that opens a tool with an example's files (its link's ?video=, ?image=…): files a run reads too.
+ if (row.href) {
+ for (const v of new URL(row.href, "https://fuobe.invalid").searchParams.values()) {
+ if (!/^\/examples\//.test(v)) continue;
+ const e = await add(v, "in");
+ const t = thumbFor(v);
+ if (t) e.thumb = `${t}?v=${(await add(t, media[t]?.role ?? "show")).v}`;
+ }
+ }
// The still a clip's card rests on (cut-example-peaks.mjs).
if (row.rest) await add(row.rest.src, media[row.rest.src]?.role ?? "show");
}
diff --git a/src/lib/examples/media.generated.ts b/src/lib/examples/media.generated.ts
index 4759723c..20fb911c 100644
--- a/src/lib/examples/media.generated.ts
+++ b/src/lib/examples/media.generated.ts
@@ -9044,6 +9044,49 @@ export const EXAMPLE_MEDIA: Record<string, ExampleMediaFile> = {
"w": 1024,
"h": 768
},
+ "/examples/video-tools/1/in-video.384.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 18574,
+ "sha256": "c96818276a28baafb4fe520722038eca2c05ed3dabf7ee0f186d708cfb0a0a61",
+ "v": "c9681827",
+ "w": 384,
+ "h": 288
+ },
+ "/examples/video-tools/1/in-video.mp4": {
+ "role": "in",
+ "type": "video/mp4",
+ "bytes": 2558459,
+ "sha256": "2a0dcc2816117a1e09d07216324e194984f95b0aed2201c58f424e4a0e759899",
+ "v": "2a0dcc28",
+ "thumb": "/examples/video-tools/1/in-video.384.webp?v=c9681827"
+ },
+ "/examples/video-tools/1/show.mp4": {
+ "role": "show",
+ "type": "video/mp4",
+ "bytes": 1059241,
+ "sha256": "9d47fcaee57b9e041bdcc8554074bd63977a3f4a39a49eb0fb3eaf68f1365c73",
+ "v": "9d47fcae",
+ "poster": "/examples/video-tools/1/show.poster.webp?v=14eed7c3"
+ },
+ "/examples/video-tools/1/show.peak.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 9936,
+ "sha256": "6f62d15a9ad4bde6bcfc374728fae79e6218aa896a8268deae375980d10b2236",
+ "v": "6f62d15a",
+ "w": 512,
+ "h": 384
+ },
+ "/examples/video-tools/1/show.poster.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 45030,
+ "sha256": "14eed7c38910a8bff814e2ffea2fce383a8b45bb0f75cf38f1873f9d112911bd",
+ "v": "14eed7c3",
+ "w": 1024,
+ "h": 768
+ },
"/samples/clean-voice/noisy.m4a": {
"role": "in",
"type": "audio/mp4",
diff --git a/src/lib/examples/plan.json b/src/lib/examples/plan.json
index be7cd45a..22f696e5 100644
--- a/src/lib/examples/plan.json
+++ b/src/lib/examples/plan.json
@@ -4864,5 +4864,21 @@
"at": 4.717,
"from": 0
}
+ },
+ {
+ "id": "video-tools.1",
+ "surface": "hub:video-tools",
+ "rank": 1,
+ "caption": "Cut from a lavender field, cape and all",
+ "modelId": "oss-video-matte-birefnet",
+ "inputs": {
+ "video": "/examples/video-tools/1/in-video.mp4"
+ },
+ "output": "/examples/video-tools/1/show.mp4",
+ "rest": {
+ "src": "/examples/video-tools/1/show.peak.webp",
+ "at": 2.5,
+ "from": 0
+ }
}
]
diff --git a/src/lib/fx-pairs.generated.ts b/src/lib/fx-pairs.generated.ts
index 4fc8a81a..43ad9900 100644
--- a/src/lib/fx-pairs.generated.ts
+++ b/src/lib/fx-pairs.generated.ts
@@ -73,6 +73,10 @@ export const FX_PAIRS: Record<string, FxPair> = {
0.25
]
},
+ "video-tools": {
+ "v": "5a5c1320",
+ "kind": "matte"
+ },
"video-tools-colors": {
"v": "84eb8101",
"kind": "pair"
diff --git a/tests/examples-catalog.test.ts b/tests/examples-catalog.test.ts
index ee8a38eb..18543661 100644
--- a/tests/examples-catalog.test.ts
+++ b/tests/examples-catalog.test.ts
@@ -266,7 +266,11 @@ describe("the examples' catalog", () => {
it("links a card that opens another page to an example that page loads", () => {
for (const c of cards) {
if (c.load.via !== "look" || !c.load.href) continue;
- const id = new URL(c.load.href, "https://x").searchParams.get("example")!;
+ const sp = new URL(c.load.href, "https://x").searchParams;
+ // The files it hands over are published inputs a run may read.
+ for (const v of sp.values()) if (v.startsWith("/examples/")) expect(EXAMPLE_MEDIA[v]?.role, `${c.id}: ${v}`).toBe("in");
+ const id = sp.get("example");
+ if (!id) continue;
expect(exampleById(id), `${c.id} → ${id}`).toBeTruthy();
const surface = exampleSurfaceOf(id)!;
// The link opens the page of the example it names (a Genjutsu mode's: Genjutsu, on that mode).