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.

Genjutsu: a second Character swap example, on the runway; Character Swap Studio links it too

Adarsh0c06595d5d89
diff --git a/public/examples/genjutsu-character/2/in-clip.384.webp b/public/examples/genjutsu-character/2/in-clip.384.webp
new file mode 100644
index 00000000..4c7174d1
Binary files /dev/null and b/public/examples/genjutsu-character/2/in-clip.384.webp differ
diff --git a/public/examples/genjutsu-character/2/in-clip.jpg b/public/examples/genjutsu-character/2/in-clip.jpg
new file mode 100644
index 00000000..c196b1cc
Binary files /dev/null and b/public/examples/genjutsu-character/2/in-clip.jpg differ
diff --git a/public/examples/genjutsu-character/2/in-photo1.384.webp b/public/examples/genjutsu-character/2/in-photo1.384.webp
new file mode 100644
index 00000000..2d048829
Binary files /dev/null and b/public/examples/genjutsu-character/2/in-photo1.384.webp differ
diff --git a/public/examples/genjutsu-character/2/in-photo1.jpg b/public/examples/genjutsu-character/2/in-photo1.jpg
new file mode 100644
index 00000000..9d17b607
Binary files /dev/null and b/public/examples/genjutsu-character/2/in-photo1.jpg differ
diff --git a/public/examples/genjutsu-character/2/show.mp4 b/public/examples/genjutsu-character/2/show.mp4
new file mode 100644
index 00000000..eb6b5863
Binary files /dev/null and b/public/examples/genjutsu-character/2/show.mp4 differ
diff --git a/public/examples/genjutsu-character/2/show.peak.webp b/public/examples/genjutsu-character/2/show.peak.webp
new file mode 100644
index 00000000..313425cb
Binary files /dev/null and b/public/examples/genjutsu-character/2/show.peak.webp differ
diff --git a/public/examples/genjutsu-character/2/show.poster.webp b/public/examples/genjutsu-character/2/show.poster.webp
new file mode 100644
index 00000000..ac6f5222
Binary files /dev/null and b/public/examples/genjutsu-character/2/show.poster.webp differ
diff --git a/src/lib/examples/media.generated.ts b/src/lib/examples/media.generated.ts
index ea518dca..be2f820d 100644
--- a/src/lib/examples/media.generated.ts
+++ b/src/lib/examples/media.generated.ts
@@ -6233,6 +6233,70 @@ export const EXAMPLE_MEDIA: Record<string, ExampleMediaFile> = {
"w": 1024,
"h": 768
},
+ "/examples/genjutsu-character/2/in-clip.384.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 28334,
+ "sha256": "e3502de86cbd014c8e4dab7d6927d7895dbd354d566127ac3624347f4f401503",
+ "v": "e3502de8",
+ "w": 384,
+ "h": 288
+ },
+ "/examples/genjutsu-character/2/in-clip.jpg": {
+ "role": "in",
+ "type": "image/jpeg",
+ "bytes": 166631,
+ "sha256": "bffdd9674febf76bab1d11dc5fc0baf79e4abe51de3113eea76502b03858da0d",
+ "v": "bffdd967",
+ "w": 1024,
+ "h": 768,
+ "thumb": "/examples/genjutsu-character/2/in-clip.384.webp?v=e3502de8"
+ },
+ "/examples/genjutsu-character/2/in-photo1.384.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 9904,
+ "sha256": "253800a94a4bad4c42c7d0dc4b94e02066e6af145733f9a19b2d8424732533a6",
+ "v": "253800a9",
+ "w": 384,
+ "h": 288
+ },
+ "/examples/genjutsu-character/2/in-photo1.jpg": {
+ "role": "in",
+ "type": "image/jpeg",
+ "bytes": 132363,
+ "sha256": "27b5644c11cecccfe9d2065364a9ccddce079ea49fdbbb0f0ca154df419f58b9",
+ "v": "27b5644c",
+ "w": 1280,
+ "h": 960,
+ "thumb": "/examples/genjutsu-character/2/in-photo1.384.webp?v=253800a9"
+ },
+ "/examples/genjutsu-character/2/show.mp4": {
+ "role": "show",
+ "type": "video/mp4",
+ "bytes": 967301,
+ "sha256": "780da2f97ab83ffdf68f40b48d924a3b37845c4fba02a21f0589da5a2b05f65e",
+ "v": "780da2f9",
+ "poster": "/examples/genjutsu-character/2/show.poster.webp?v=26766823"
+ },
+ "/examples/genjutsu-character/2/show.peak.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 37146,
+ "sha256": "b794dfc3809f52d94161371130184d5815d6cb8b84202b5eb4ca8d3a2d1737ff",
+ "v": "b794dfc3",
+ "w": 512,
+ "h": 384
+ },
+ "/examples/genjutsu-character/2/show.poster.webp": {
+ "role": "show",
+ "type": "image/webp",
+ "bytes": 82720,
+ "sha256": "267668235facdbc060553af093b3082ecbe620346fbd337b9ff062f4773a52c7",
+ "v": "26766823",
+ "w": 1024,
+ "h": 768
+ },
"/examples/genjutsu-finish/1/in-clip.384.webp": {
"role": "show",
"type": "image/webp",
diff --git a/src/lib/examples/plan.json b/src/lib/examples/plan.json
index 6863cd6a..362efd7d 100644
--- a/src/lib/examples/plan.json
+++ b/src/lib/examples/plan.json
@@ -4993,5 +4993,62 @@
"at": 5,
"from": 0
}
+ },
+ {
+ "id": "genjutsu-character.2",
+ "surface": "tool:genjutsu/character",
+ "rank": 2,
+ "caption": "A new model takes the runway",
+ "words": "The runway walk in the palm house, now worn by a new model in an emerald satin gown. Every step, turn and the crowd stay as filmed.",
+ "load": "genjutsu",
+ "genjutsu": {
+ "layout": "inset",
+ "went": "A 5 s clip and a photo",
+ "recipe": {
+ "mode": "character",
+ "engine": "open",
+ "model": "oss-h3-group-swap",
+ "quality": "720p",
+ "target": "type",
+ "seed": 7,
+ "length": 5.166,
+ "originalSound": "everything"
+ },
+ "own": {
+ "character": {
+ "people": [
+ {
+ "role": "the model walking the runway"
+ }
+ ]
+ }
+ }
+ },
+ "inputs": {
+ "clip": "/examples/genjutsu-character/2/in-clip.jpg",
+ "photo1": "/examples/genjutsu-character/2/in-photo1.jpg"
+ },
+ "output": "/examples/genjutsu-character/2/show.mp4",
+ "rest": {
+ "src": "/examples/genjutsu-character/2/show.peak.webp",
+ "at": 3,
+ "from": 0
+ }
+ },
+ {
+ "id": "character-swap.2",
+ "surface": "tool:character-swap",
+ "rank": 2,
+ "caption": "A new model takes the runway",
+ "words": "The runway walk in the palm house, now worn by a new model in an emerald satin gown. Every step, turn and the crowd stay as filmed.",
+ "load": "look",
+ "href": "/genjutsu?mode=character&example=genjutsu-character.2",
+ "inputs": {},
+ "output": "/examples/genjutsu-character/2/show.mp4",
+ "rest": {
+ "src": "/examples/genjutsu-character/2/show.peak.webp",
+ "at": 3,
+ "from": 0
+ }
}
]
diff --git a/tests/fixtures/genjutsu-examples/genjutsu-character.2.json b/tests/fixtures/genjutsu-examples/genjutsu-character.2.json
new file mode 100644
index 00000000..3b624d4b
--- /dev/null
+++ b/tests/fixtures/genjutsu-examples/genjutsu-character.2.json
@@ -0,0 +1,36 @@
+{
+ "id": "genjutsu-character.2",
+ "note": "The request body of the run that made this example (file addresses replaced by neutral ones).",
+ "body": {
+ "engine": "open",
+ "mode": "character",
+ "modelId": "oss-h3-group-swap",
+ "quality": "720p",
+ "target": "type",
+ "references": [
+ "/api/files/example-photo1.png"
+ ],
+ "source": {
+ "url": "/api/files/example-clip.mp4",
+ "name": "clip.mp4",
+ "duration": 5.166,
+ "fps": 24,
+ "width": 1024,
+ "height": 768,
+ "hasAudio": true
+ },
+ "range": {
+ "start": 0,
+ "end": 5.166
+ },
+ "seed": 7,
+ "character": {
+ "people": [
+ {
+ "role": "the model walking the runway"
+ }
+ ]
+ },
+ "originalSound": "everything"
+ }
+}
diff --git a/tests/genjutsu-examples.test.ts b/tests/genjutsu-examples.test.ts
index 514d63c2..85148e75 100644
--- a/tests/genjutsu-examples.test.ts
+++ b/tests/genjutsu-examples.test.ts
@@ -14,7 +14,7 @@ import {
type GenjutsuPlanInput,
type GenjutsuSetup,
} from "@/lib/catalog/genjutsu";
-import { exampleFor, exampleSettings, recipeProblem, sameRecipe, toRecipe } from "@/lib/examples/genjutsu";
+import { exampleFor, examplesOf, exampleSettings, recipeProblem, sameRecipe, toRecipe } from "@/lib/examples/genjutsu";
import type { GenjutsuRecipe } from "@/lib/examples/types";
import { genjutsuLive } from "@/server/genjutsu-live";
import plan from "@/lib/examples/plan.json";
@@ -198,12 +198,11 @@ describe("Genjutsu mode examples", () => {
.find((c) => c!.id === r.id)!;
const mode = card.load.recipe.mode;
// Each feature it needs closes it on its own.
- for (const f of card.load.needs) expect(exampleFor(examples, mode, (g) => g !== f)?.id === r.id, `${r.id} without ${f}`).toBe(false);
+ for (const f of card.load.needs) expect(examplesOf(examples, mode, (g) => g !== f).some((c) => c.id === r.id), `${r.id} without ${f}`).toBe(false);
// The committed gate (src/server/genjutsu-live.ts): what a visitor sees today.
const live = genjutsuLive();
- const visitor = exampleFor(examples, mode, (f) => !!live[f]);
- if (card.load.needs.every((f) => live[f])) expect(visitor?.id, r.id).toBe(r.id);
- else expect(visitor?.id === r.id, r.id).toBe(false);
+ const visitor = examplesOf(examples, mode, (f) => !!live[f]).map((c) => c.id);
+ expect(visitor.includes(r.id), r.id).toBe(card.load.needs.every((f) => live[f]));
}
});