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.

Soul looks, AI Influencer types and empty Storyboard, Elements and Character Sheet pages can show real example pictures

Adarshe0f89cd9ad3b
diff --git a/scripts/eval/eval.mjs b/scripts/eval/eval.mjs
index b099a406..9d5ff3fc 100644
--- a/scripts/eval/eval.mjs
+++ b/scripts/eval/eval.mjs
@@ -85,7 +85,8 @@ pnpm eval:covers --templates <dir> [--only group/id,group/id] [--force] [--dry-r
Covers for the studios' template and style tiles, from rendered masters: one folder per tile,
<dir>/<group>/<tile id>/ (groups: marketing, fashion, photodump, shorts, mixed-media, canvas, content-factory,
- explainer), holding clip.mp4 or still.png, then frame-2.png… for a tile with more frames (up to frame-4), and a
+ explainer, soul, influencer, examples), holding clip.mp4 or still.png, then frame-2.png… for a tile with more
+ frames (up to frame-6), and a
meta.json that can say { "rest": "end" } (a reveal: its last frame is the poster) or { "same": "<preset id>" }
(the tile shows that preset's cover). Encoded like the preset covers into public/previews/templates/<group>/ and
merged into src/lib/template-covers.generated.ts. Run again, it encodes only new or changed masters (--force: all).
diff --git a/scripts/eval/lib/template-covers.mjs b/scripts/eval/lib/template-covers.mjs
index 0bc7ab7e..61fba30e 100644
--- a/scripts/eval/lib/template-covers.mjs
+++ b/scripts/eval/lib/template-covers.mjs
@@ -1,5 +1,6 @@
// Real covers for the studios' template and style tiles (Marketing Studio's templates, Fashion Factory, Photodump packs,
-// the Shorts and Mixed Media looks, Canvas templates, Content Factory's trending styles, the Explainer styles), from
+// the Shorts and Mixed Media looks, Canvas templates, Content Factory's trending styles, the Explainer styles, Fuobe
+// Soul's looks, AI Influencer's character types, the Character Sheet, Storyboard and Elements examples), from
// rendered masters: pnpm eval:covers --templates <dir>. They are encoded the way the preset covers are (covers.mjs:
// a 768 px still, a 512 px clip, a 320 px copy of each still in thumbs/) into public/previews/templates/<group>/, and
// listed in src/lib/template-covers.generated.ts, which the tiles read (src/lib/template-covers.ts). A tile that isn't
@@ -17,10 +18,10 @@ export const TEMPLATE_MANIFEST = path.join(REPO_DIR, "src", "lib", "template-cov
export const PEAKS_FILE = path.join(REPO_DIR, "src", "lib", "preset-peaks.generated.ts");
/** The tile groups, as the manifest's keys start (`<group>/<tile id>`) and the folders under previews/templates/ are named. */
-export const TEMPLATE_GROUPS = ["marketing", "fashion", "photodump", "shorts", "mixed-media", "canvas", "content-factory", "explainer"];
+export const TEMPLATE_GROUPS = ["marketing", "fashion", "photodump", "shorts", "mixed-media", "canvas", "content-factory", "explainer", "soul", "influencer", "examples"];
-/** At most this many frames per tile: the cover and up to three more (a contact sheet's 2x2, a carousel's slides). */
-const MAX_FRAMES = 4;
+/** At most this many frames per tile: the cover and up to five more (a contact sheet's 2x2, a carousel's slides, an example storyboard). */
+const MAX_FRAMES = 6;
const STILLS = ["still.png", "still.jpg", "still.webp", "start.png", "start.jpg"];
const CLIP = "clip.mp4";
const FRAME = /^frame-([2-9])\.(png|jpe?g|webp)$/;
@@ -195,7 +196,7 @@ function readMaster(folder) {
* <dir>/<group>/<tile id>/, holding
* clip.mp4 a clip cover (its first 4 s, its first frame the poster), or
* still.png a still cover (also still.jpg / still.webp, or start.png);
- * frame-2.png … the tile's other frames, in order, up to frame-4 (a carousel's slides, a contact sheet's cells);
+ * frame-2.png … the tile's other frames, in order, up to frame-6 (a carousel's slides, a contact sheet's cells);
* meta.json { "rest": "end" } for a reveal: the clip is kept to its end and its last frame is the poster,
* or { "same": "<preset id>" }: the tile shows that preset's cover (no files of its own),
* resting on its clip's peak frame when it has one (presetCoverEntry).
diff --git a/src/components/elements-view.tsx b/src/components/elements-view.tsx
index e45d3d8f..4278a742 100644
--- a/src/components/elements-view.tsx
+++ b/src/components/elements-view.tsx
@@ -37,6 +37,7 @@ import { copyText } from "@/lib/clipboard";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
import { voiceOrigin } from "@/lib/voice-design";
+import { ElementsExample } from "@/components/empty-examples";
const TIPS: Record<ElementKind, string> = {
character: `3+ clear photos of one person (${SOUL_ID_PHOTOS.recommended}+ to train a Soul ID, up to ${SOUL_ID_PHOTOS.max}): different angles, at least one full-body, no sunglasses, filters or group shots.`,
@@ -439,6 +440,7 @@ function ElementsBody() {
<p className="mx-auto mt-1 max-w-md text-[14px] text-muted-foreground">
Save a person, a place or a product from a few photos. Then write “@Maya walking into @Rooftop_bar” in any prompt.
</p>
+ {tab === "all" && <ElementsExample />}
{!visitor && (
<Button className="mt-5" variant="outline" onClick={() => setOpen(true)}>
<Plus /> New element
diff --git a/src/components/empty-examples.tsx b/src/components/empty-examples.tsx
new file mode 100644
index 00000000..1e181834
--- /dev/null
+++ b/src/components/empty-examples.tsx
@@ -0,0 +1,75 @@
+"use client";
+
+import { CoverImg, ExampleChip } from "@/components/template-cover";
+import { templateCover, type CoverFrame } from "@/lib/template-covers";
+
+/*
+ * The example pictures of three empty pages, once they are published ("examples/<id>" in template-covers.ts): each
+ * shows what the tool makes, with an "Example" chip, and renders nothing until its pictures exist.
+ */
+
+/** Character Sheet's empty result panel: one sheet, four views of the same person (16:9). */
+export function SheetExample() {
+ const cover = templateCover("examples", "character-sheet");
+ if (!cover) return null;
+ return (
+ <div className="relative aspect-video w-full max-w-xl overflow-hidden rounded-xl bg-muted">
+ <CoverImg frame={cover.frames[0]} sizes="(min-width: 640px) 576px, 92vw" className="absolute inset-0" />
+ <ExampleChip />
+ </div>
+ );
+}
+
+/** Storyboard's empty page: a six-frame board (16:9 frames), numbered. */
+export function BoardExample() {
+ const cover = templateCover("examples", "storyboard-heist");
+ if (!cover) return null;
+ return (
+ <div className="relative grid w-full max-w-3xl grid-cols-2 gap-2 sm:grid-cols-3">
+ {cover.frames.map((f, i) => (
+ <span key={f.src} className="relative aspect-video overflow-hidden rounded-lg bg-muted">
+ <CoverImg frame={f} sizes="(min-width: 640px) 250px, 46vw" className="absolute inset-0" />
+ <span aria-hidden className="absolute bottom-1 left-1.5 text-[11px] font-medium text-white drop-shadow-sm">
+ {i + 1}
+ </span>
+ </span>
+ ))}
+ <ExampleChip />
+ </div>
+ );
+}
+
+const ELEMENT_TILES = [
+ { id: "element-maya", label: "@Maya", hint: "Character" },
+ { id: "element-rooftop-bar", label: "@Rooftop_bar", hint: "Location" },
+ { id: "element-aurora", label: "@Aurora", hint: "Prop" },
+ { id: "element-together", label: "@Maya walking into @Rooftop_bar", hint: "In a prompt" },
+] as const;
+
+/**
+ * Elements' empty list: the example its line names, shown only with all four pictures: a character, a place and a
+ * product saved as elements, and the picture "@Maya walking into @Rooftop_bar" made from two of them (4:5).
+ */
+export function ElementsExample() {
+ const tiles = ELEMENT_TILES.map((t) => ({ ...t, frame: templateCover("examples", t.id)?.frames[0] }));
+ if (!tiles.every((t): t is (typeof tiles)[number] & { frame: CoverFrame } => !!t.frame)) return null;
+ return (
+ <div className="mx-auto mt-6 grid max-w-2xl grid-cols-2 gap-3 text-left sm:grid-cols-4">
+ {tiles.map((t) => (
+ <figure key={t.id} className="min-w-0">
+ <span className="relative block aspect-[4/5] overflow-hidden rounded-xl bg-muted">
+ <CoverImg frame={t.frame} sizes="(min-width: 640px) 160px, 44vw" className="absolute inset-0" />
+ {t.id === "element-together" && <ExampleChip />}
+ </span>
+ <figcaption className="mt-1.5 min-w-0 px-0.5">
+ <span className="block truncate text-[12.5px] font-medium">{t.label}</span>
+ <span className="block truncate text-[11.5px] text-muted-foreground">{t.hint}</span>
+ </figcaption>
+ </figure>
+ ))}
+ </div>
+ );
+}
+
+/** Whether Storyboard's example board is published (its empty page then shows it in place of the icon). */
+export const hasBoardExample = () => !!templateCover("examples", "storyboard-heist");
diff --git a/src/components/fashion/character-sheet.tsx b/src/components/fashion/character-sheet.tsx
index 6d348385..e6ee73d8 100644
--- a/src/components/fashion/character-sheet.tsx
+++ b/src/components/fashion/character-sheet.tsx
@@ -25,6 +25,7 @@ import { sheetPictures } from "@/lib/catalog/turnaround";
import type { Generation } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
import { toastError } from "@/lib/refusals";
+import { SheetExample } from "@/components/empty-examples";
type Mode = "reference" | "cast" | "describe";
const MODES: [Mode, string][] = [
@@ -363,7 +364,8 @@ export function CharacterSheetView({ fields, defaults }: { fields: CastFieldData
)}
</>
) : (
- <div className="grid min-h-64 place-items-center rounded-2xl border border-dashed p-6 text-center">
+ <div className="grid min-h-64 place-items-center gap-5 rounded-2xl border border-dashed p-6 text-center">
+ <SheetExample />
<div className="max-w-sm space-y-1">
<p className="font-heading text-[22px]">Your character sheet appears here</p>
<p className="text-[13px] text-muted-foreground">Front, three-quarter, profile and back views of the same person — then save it as a character to use in any prompt with @.</p>
diff --git a/src/components/influencer/option-panel.tsx b/src/components/influencer/option-panel.tsx
index d778e15b..2e55bf4d 100644
--- a/src/components/influencer/option-panel.tsx
+++ b/src/components/influencer/option-panel.tsx
@@ -31,6 +31,8 @@ import {
type LucideIcon,
} from "lucide-react";
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
+import { CoverImg } from "@/components/template-cover";
+import { templateCover } from "@/lib/template-covers";
import {
conflictFor,
CREATURE_TYPES,
@@ -102,9 +104,49 @@ export function pickRule(c: InfluencerCategory): string {
return c.max === 1 ? "Pick one" : `Up to ${c.max}`;
}
+/** A character type's real cover ("influencer/tier-<id>"), or undefined. */
+const tierCover = (id: InfluencerTier) => templateCover("influencer", `tier-${id}`);
+/** A row of character types shows photo cards only when every type in it has its cover; otherwise its icon tiles. */
+const allCovered = (ids: InfluencerTier[]) => ids.every((id) => tierCover(id));
+const HUMAN_PHOTOS = allCovered(HUMAN_TIERS.map((t) => t.id));
+const CREATURE_PHOTOS = allCovered(CREATURE_TYPES.map((c) => c.id));
+/** A photo card's width: a third of the panel. */
+const PHOTO_SIZES = "(min-width: 1024px) 200px, 33vw";
+
/** The Character type panel: three human tiers, six creature types, then the species and body colour. */
export function TierPanel({ state, onTier, onSpecies, onBodyColor }: { state: InfluencerState; onTier: (t: InfluencerTier) => void; onSpecies: (s?: string) => void; onBodyColor: (c?: string) => void }) {
const creature = CREATURE_TYPES.find((c) => c.id === state.tier);
+ /** A type as a 4:5 photo card: its cover, its name and hint on a scrim. */
+ const photo = (id: InfluencerTier, label: string, hint: string) => {
+ const cover = tierCover(id)!;
+ const on = state.tier === id;
+ return (
+ <button
+ key={id}
+ type="button"
+ role="radio"
+ aria-checked={on}
+ tabIndex={radioTab(on)}
+ onClick={() => onTier(id)}
+ className={cn(
+ "group relative block aspect-[4/5] min-w-0 overflow-hidden rounded-xl bg-muted text-left ring-offset-2 ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ on && "ring-2 ring-primary",
+ )}
+ >
+ <CoverImg frame={cover.frames[0]} sizes={PHOTO_SIZES} className="absolute inset-0 transition-transform duration-300 group-hover:scale-[1.03]" />
+ <span aria-hidden className="absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-black/65 to-transparent" />
+ <span className="absolute inset-x-2 bottom-2 min-w-0 text-white drop-shadow-sm">
+ <span className="block truncate text-[13px] font-medium">{label}</span>
+ <span className="block truncate text-[11.5px] leading-snug text-white/80">{hint}</span>
+ </span>
+ {on && (
+ <span aria-hidden className="absolute top-1.5 right-1.5 grid size-5 place-items-center rounded-full bg-primary text-primary-foreground">
+ <Check className="size-3" />
+ </span>
+ )}
+ </button>
+ );
+ };
const tile = (id: InfluencerTier, label: string, hint: string) => {
const Icon = TIER_ICON[id];
const on = state.tier === id;
@@ -136,11 +178,19 @@ export function TierPanel({ state, onTier, onSpecies, onBodyColor }: { state: In
<div role="radiogroup" aria-label="Character type" onKeyDown={radioKeys} className="space-y-4">
<div className="space-y-2">
<p className="text-[12px] font-medium text-muted-foreground">Human</p>
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-3">{HUMAN_TIERS.map((t) => tile(t.id, t.label, t.hint))}</div>
+ {HUMAN_PHOTOS ? (
+ <div className="grid grid-cols-3 gap-2">{HUMAN_TIERS.map((t) => photo(t.id, t.label, t.hint))}</div>
+ ) : (
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-3">{HUMAN_TIERS.map((t) => tile(t.id, t.label, t.hint))}</div>
+ )}
</div>
<div className="space-y-2">
<p className="text-[12px] font-medium text-muted-foreground">Creature</p>
- <div className="grid grid-cols-2 gap-2 sm:grid-cols-3">{CREATURE_TYPES.map((c) => tile(c.id, c.label, `${c.species.length} species`))}</div>
+ {CREATURE_PHOTOS ? (
+ <div className="grid grid-cols-3 gap-2">{CREATURE_TYPES.map((c) => photo(c.id, c.label, `${c.species.length} species`))}</div>
+ ) : (
+ <div className="grid grid-cols-2 gap-2 sm:grid-cols-3">{CREATURE_TYPES.map((c) => tile(c.id, c.label, `${c.species.length} species`))}</div>
+ )}
</div>
</div>
{creature && (
diff --git a/src/components/moodboards/cards.tsx b/src/components/moodboards/cards.tsx
index 934438a0..366a53cf 100644
--- a/src/components/moodboards/cards.tsx
+++ b/src/components/moodboards/cards.tsx
@@ -7,16 +7,28 @@ import { DrawnTile } from "@/components/photodump/covers";
import { STATUS_LABEL, type CuratedMoodboard, type Moodboard } from "./logic";
/**
- * A curated look's cover: a rendered cover once the evaluation harness made one (Fuobe's own renders), otherwise
+ * A curated look's cover: its real cover once one is published (template-covers.ts, "soul/<look id>"), otherwise
* drawn in the look's hue and treatment — grain for black and white, a flash hotspot, gels…; its name on top.
*/
-export function CuratedCover({ m, className }: { m: Pick<CuratedMoodboard, "name" | "hue" | "preview" | "tone">; className?: string }) {
+export function CuratedCover({ m, className, sizes = "200px" }: { m: Pick<CuratedMoodboard, "name" | "hue" | "preview" | "tone">; className?: string; sizes?: string }) {
return (
<DrawnTile hue={m.hue} tone={m.tone ?? "plain"} className={className}>
- {/* eslint-disable-next-line @next/next/no-img-element */}
- {m.preview && <img src={m.preview} alt="" loading="lazy" className="absolute inset-0 size-full object-cover" />}
+ {m.preview && (
+ // A real cover: its 320 px copy where the cover shows small (`sizes`, how wide it shows).
+ // eslint-disable-next-line @next/next/no-img-element
+ <img
+ src={m.preview.src}
+ srcSet={`${m.preview.thumb} 320w, ${m.preview.src} 768w`}
+ sizes={sizes}
+ alt=""
+ loading="lazy"
+ decoding="async"
+ draggable={false}
+ className="absolute inset-0 size-full object-cover"
+ />
+ )}
{/* A scrim under the name, so it reads on light covers too (pastel washes, live previews). */}
- {(m.preview || m.name) && <span className="absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-black/60 to-transparent" />}
+ {m.name && <span className="absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-black/60 to-transparent" />}
{m.name && <span className="absolute inset-x-2 bottom-2 font-heading text-[19px] leading-tight text-white drop-shadow-sm">{m.name}</span>}
</DrawnTile>
);
diff --git a/src/components/moodboards/logic.ts b/src/components/moodboards/logic.ts
index 272a4bc0..d22b33b9 100644
--- a/src/components/moodboards/logic.ts
+++ b/src/components/moodboards/logic.ts
@@ -7,6 +7,7 @@ import { coverTone, hueOf, spreadHue, type CoverTone } from "@/lib/catalog/packs
import { lookCard, lookSet, type SoulLookCard } from "@/lib/catalog/soul-cards";
import { kmeans, suggestName, type MoodboardPick, type MoodboardStatus, type RGB } from "@/lib/catalog/palettes";
import type { Engine, Generation } from "@/lib/catalog/types";
+import { templateCover, type CoverFrame } from "@/lib/template-covers";
export interface Moodboard {
id: string;
@@ -41,23 +42,27 @@ export interface CuratedMoodboard {
categories?: string[];
/** Whose look: Soul 2.0's looks (the default) or Soul's. */
source?: CuratedSource;
- /** A rendered cover, once the evaluation harness made one (otherwise the cover is drawn). */
- preview?: string;
+ /** The look's real cover (template-covers.ts, "soul/<look id>") and its 320 px copy; without one the cover is drawn. */
+ preview?: CoverFrame;
}
/** The curated sets: Fuobe Soul's Soul 2.0 looks and its Soul (v1) looks. */
export type CuratedSource = "soul-v1" | "soul-v2";
-const toCurated = (c: SoulLookCard, i: number): CuratedMoodboard => ({
- id: c.id,
- name: c.name,
- category: c.categories[0] ?? "All presets",
- categories: c.categories,
- description: c.description,
- hue: spreadHue(i),
- tone: coverTone(c.name, c.description),
- ...(c.family === "v1" && { source: "soul-v1" as const }),
-});
+const toCurated = (c: SoulLookCard, i: number): CuratedMoodboard => {
+ const cover = templateCover("soul", c.id)?.frames[0];
+ return {
+ id: c.id,
+ name: c.name,
+ category: c.categories[0] ?? "All presets",
+ categories: c.categories,
+ description: c.description,
+ hue: spreadHue(i),
+ tone: coverTone(c.name, c.description),
+ ...(c.family === "v1" && { source: "soul-v1" as const }),
+ ...(cover && { preview: cover }),
+ };
+};
/**
* The curated sets of the Moodboard panel: Fuobe Soul's looks (src/lib/catalog/soul-cards.ts), Soul 2.0's 33 and
@@ -70,10 +75,10 @@ export const CURATED_SETS: Record<CuratedSource, CuratedMoodboard[]> = {
export const SOUL_STYLES = CURATED_SETS["soul-v1"];
const LOOKS = new Map([...CURATED_SETS["soul-v2"], ...CURATED_SETS["soul-v1"]].map((c) => [c.id, c]));
-/** A curated look's drawn cover by id (the composer chip's dot); unknown ids get a hue of their own. */
-export const curatedLook = (id: string): { hue: number; tone: CoverTone } => {
+/** A curated look's cover by id (the composer chip's dot, the look pickers): its real cover, else drawn; unknown ids get a hue of their own. */
+export const curatedLook = (id: string): { hue: number; tone: CoverTone; preview?: CoverFrame } => {
const c = LOOKS.get(lookCard(id)?.id ?? id);
- return c ? { hue: c.hue, tone: c.tone ?? "plain" } : { hue: hueOf(id), tone: "plain" };
+ return c ? { hue: c.hue, tone: c.tone ?? "plain", ...(c.preview && { preview: c.preview }) } : { hue: hueOf(id), tone: "plain" };
};
/** The category pills of each curated set ("All presets" first). */
diff --git a/src/components/moodboards/moodboards-view.tsx b/src/components/moodboards/moodboards-view.tsx
index 4a673f77..083303f7 100644
--- a/src/components/moodboards/moodboards-view.tsx
+++ b/src/components/moodboards/moodboards-view.tsx
@@ -261,7 +261,7 @@ export function MoodboardsView() {
aria-label={`Use ${c.name} in the Image studio${c.description ? ` — ${c.description}` : ""}`}
className="group/cur min-w-0 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
>
- <CuratedCover m={c} className="aspect-[3/4] rounded-xl transition-transform duration-300 group-hover/cur:scale-[1.02]" />
+ <CuratedCover m={c} sizes="(min-width: 1024px) 240px, (min-width: 640px) 33vw, 50vw" className="aspect-[3/4] rounded-xl transition-transform duration-300 group-hover/cur:scale-[1.02]" />
<p className="mt-1.5 px-0.5 text-[12px] text-muted-foreground">{c.category}</p>
<p className="line-clamp-2 px-0.5 text-[12.5px]">{c.description}</p>
</Link>
diff --git a/src/components/palettes/signature-chips.tsx b/src/components/palettes/signature-chips.tsx
index 4743215a..942d0a5a 100644
--- a/src/components/palettes/signature-chips.tsx
+++ b/src/components/palettes/signature-chips.tsx
@@ -107,7 +107,7 @@ export default function SignatureChips({
<Chip icon={mb ? undefined : Images} active={!!mb} aria-label={mb ? `Moodboard: ${mb.name}` : "Moodboard"}>
{mb &&
(mb.kind === "curated" ? (
- <CuratedCover m={{ name: "", ...curatedLook(mb.id) }} className="size-4 rounded-full" />
+ <CuratedCover m={{ name: "", ...curatedLook(mb.id) }} className="size-4 rounded-full" sizes="16px" />
) : mb.cover ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={mb.cover} alt="" className="size-4 rounded-full object-cover" />
diff --git a/src/components/storyboard-view.tsx b/src/components/storyboard-view.tsx
index ce9cebf4..04541120 100644
--- a/src/components/storyboard-view.tsx
+++ b/src/components/storyboard-view.tsx
@@ -26,6 +26,7 @@ import { timeAgo } from "@/lib/format";
import { BOARD_TITLES_KEY, boardTitle, filmReady, rememberTitle } from "@/lib/storyboard-board";
import { cn } from "@/lib/utils";
import { responseError, toastError } from "@/lib/refusals";
+import { BoardExample, hasBoardExample } from "@/components/empty-examples";
const ASPECTS: readonly string[] = STORYBOARD_ASPECTS;
@@ -567,9 +568,10 @@ export function StoryboardView({ modelNames = {} }: { /** Display names of the s
))}
</div>
) : (
- <div className="grid place-items-center rounded-xl border border-dashed py-14 text-center text-muted-foreground">
- <ImagePlus className="size-6" />
- <p className="mt-2 text-[14px]">Your storyboards appear here.</p>
+ <div className="grid place-items-center rounded-xl border border-dashed px-4 py-14 text-center text-muted-foreground">
+ {/* An example board (six frames) in place of the icon, once it is published. */}
+ {hasBoardExample() ? <BoardExample /> : <ImagePlus className="size-6" />}
+ <p className={cn("text-[14px]", hasBoardExample() ? "mt-4" : "mt-2")}>Your storyboards appear here.</p>
</div>
)}
</div>
diff --git a/src/components/studio/look-chip.tsx b/src/components/studio/look-chip.tsx
index 885270fa..eaf6e90d 100644
--- a/src/components/studio/look-chip.tsx
+++ b/src/components/studio/look-chip.tsx
@@ -62,7 +62,7 @@ export default function LookChip({
className="w-[min(92vw,480px)] p-2"
trigger={
<Chip icon={picked ? undefined : Sparkles} active={!!value} aria-label={`Look: ${picked?.name ?? none ?? "General"}`}>
- {picked && <CuratedCover m={{ name: "", ...curatedLook(picked.id) }} className="size-4 rounded-full" />}
+ {picked && <CuratedCover m={{ name: "", ...curatedLook(picked.id) }} className="size-4 rounded-full" sizes="16px" />}
<span className="max-w-32 truncate">{picked?.name ?? none ?? "Look"}</span>
{strength < 1 && <span className="text-muted-foreground tabular-nums">{pct(strength)}</span>}
</Chip>
diff --git a/src/components/template-cover.tsx b/src/components/template-cover.tsx
index 7b741a11..28f494a2 100644
--- a/src/components/template-cover.tsx
+++ b/src/components/template-cover.tsx
@@ -41,3 +41,8 @@ export function CoverImg({ frame, sizes, className }: { frame: CoverFrame; sizes
/>
);
}
+
+/** The chip on an example picture in an empty list (Character Sheet, Storyboard, Elements): what the tool makes. */
+export function ExampleChip({ className }: { className?: string }) {
+ return <span className={cn("pointer-events-none absolute top-2 left-2 rounded-full bg-background/90 px-2 py-0.5 text-[11px] font-medium text-foreground shadow-soft", className)}>Example</span>;
+}
diff --git a/src/lib/template-covers.ts b/src/lib/template-covers.ts
index 948584fb..7b75556a 100644
--- a/src/lib/template-covers.ts
+++ b/src/lib/template-covers.ts
@@ -1,15 +1,16 @@
/**
* The real covers of the studios' template and style tiles (Marketing Studio's templates, Fashion Factory, Photodump
- * packs, the Shorts and Mixed Media looks, Canvas templates, Content Factory's trending styles, the Explainer styles),
- * from template-covers.generated.ts (pnpm eval:covers --templates). A tile that isn't listed keeps its drawn art.
- * Every URL comes from the manifest with its version (?v=): never build one here without it.
+ * packs, the Shorts and Mixed Media looks, Canvas templates, Content Factory's trending styles, the Explainer styles,
+ * Fuobe Soul's looks, AI Influencer's character types, and the example pictures of Character Sheet, Storyboard and
+ * Elements), from template-covers.generated.ts (pnpm eval:covers --templates). A tile that isn't listed keeps its drawn
+ * art. Every URL comes from the manifest with its version (?v=): never build one here without it.
*/
import { thumbOf, type PresetPreview } from "./preset-cards";
import { TEMPLATE_COVERS, type TemplateCoverEntry } from "./template-covers.generated";
-export type TemplateGroup = "marketing" | "fashion" | "photodump" | "shorts" | "mixed-media" | "canvas" | "content-factory" | "explainer";
+export type TemplateGroup = "marketing" | "fashion" | "photodump" | "shorts" | "mixed-media" | "canvas" | "content-factory" | "explainer" | "soul" | "influencer" | "examples";
-export const TEMPLATE_GROUPS: readonly TemplateGroup[] = ["marketing", "fashion", "photodump", "shorts", "mixed-media", "canvas", "content-factory", "explainer"];
+export const TEMPLATE_GROUPS: readonly TemplateGroup[] = ["marketing", "fashion", "photodump", "shorts", "mixed-media", "canvas", "content-factory", "explainer", "soul", "influencer", "examples"];
/** One still of a cover, and its 320 px copy (thumbs/ next to it, with the same version). */
export interface CoverFrame {
diff --git a/tests/template-cover-tiles.test.ts b/tests/template-cover-tiles.test.ts
index a05225e2..36bc8a83 100644
--- a/tests/template-cover-tiles.test.ts
+++ b/tests/template-cover-tiles.test.ts
@@ -26,6 +26,21 @@ vi.mock("@/lib/template-covers.generated", () => ({
"canvas/effect-chain-fallen-angel": { poster: "/previews/presets/effect-fallen-angel.jpg?v=1a2b3c4e", video: "/previews/presets/effect-fallen-angel.mp4?v=2b3c4d5f" },
"content-factory/what-if": ["3c4d5e60", "4d5e6f71"],
"explainer/pixel-art": "5e6f7082",
+ "soul/v2-general": "70819304",
+ // Every human type has its cover; of the creatures only the cats.
+ "influencer/tier-normal": "81920a15",
+ "influencer/tier-freak": "920a1b26",
+ "influencer/tier-total": "0a1b2c37",
+ "influencer/tier-cats": "1b2c3d48",
+ "examples/character-sheet": "2c3d4e59",
+ "examples/storyboard-heist": {
+ poster: "/previews/templates/examples/storyboard-heist.jpg?v=3d4e5f6a",
+ frames: [2, 3, 4, 5, 6].map((k) => `/previews/templates/examples/storyboard-heist-${k}.jpg?v=4e5f6a7${k}`),
+ },
+ "examples/element-maya": "5f6a7b8c",
+ "examples/element-rooftop-bar": "6a7b8c9d",
+ "examples/element-aurora": "7b8c9dae",
+ "examples/element-together": "8c9daebf",
},
}));
@@ -44,6 +59,11 @@ const { MIXED_PRESETS, mixedPreview } = await import("@/lib/catalog/mixed-media"
const { CANVAS_TEMPLATES, outline } = await import("@/lib/catalog/canvas");
const { PRESETS } = await import("@/lib/catalog/content-factory");
const { templateCover } = await import("@/lib/template-covers");
+const { CuratedCover } = await import("@/components/moodboards/cards");
+const { CURATED_SETS, curatedLook } = await import("@/components/moodboards/logic");
+const { TierPanel } = await import("@/components/influencer/option-panel");
+const { INFLUENCER_START } = await import("@/lib/influencer");
+const { BoardExample, ElementsExample, SheetExample, hasBoardExample } = await import("@/components/empty-examples");
/** A component's markup as the server renders it first (a memo component or a function). */
const html = (type: unknown, props: Record<string, unknown>) => renderToStaticMarkup(createElement(type as FC<Record<string, unknown>>, props));
@@ -196,6 +216,66 @@ describe("Content Factory's trending styles and the Explainer styles", () => {
});
});
+describe("Fuobe Soul's looks", () => {
+ it("show the look's cover in the curated sets and the look pickers, its 320 px copy where small, else the drawn cover", () => {
+ const general = CURATED_SETS["soul-v2"].find((c) => c.id === "v2-general")!;
+ expect(general.preview).toEqual({ src: "/previews/templates/soul/v2-general.jpg?v=70819304", thumb: "/previews/templates/soul/thumbs/v2-general.jpg?v=70819304" });
+ expect(curatedLook("v2-general").preview).toEqual(general.preview);
+ const h = html(CuratedCover, { m: general, sizes: "200px" });
+ expect(h).toContain('src="/previews/templates/soul/v2-general.jpg?v=70819304"');
+ expect(h).toContain("/previews/templates/soul/thumbs/v2-general.jpg?v=70819304 320w");
+ expect(h).toMatch(/<img[^>]*loading="lazy"/);
+ expect(unversioned(h)).toEqual([]);
+ // A look without a cover keeps its drawn one.
+ const other = CURATED_SETS["soul-v1"][0];
+ expect(other.preview).toBeUndefined();
+ expect(curatedLook(other.id).preview).toBeUndefined();
+ expect(html(CuratedCover, { m: other })).not.toContain("<img");
+ });
+});
+
+describe("AI Influencer's character types", () => {
+ const panel = () => html(TierPanel, { state: INFLUENCER_START, onTier: noop, onSpecies: noop, onBodyColor: noop });
+
+ it("show photo cards for a row whose every type has its cover, and keep the icon tiles for a row that doesn't", () => {
+ const h = panel();
+ for (const id of ["normal", "freak", "total"]) expect(h).toContain(`src="/previews/templates/influencer/tier-${id}.jpg?v=`);
+ expect(h).toContain("/previews/templates/influencer/thumbs/tier-normal.jpg?v=81920a15 320w");
+ // Only the cats have a cover among the creatures: their row stays as icons, with no picture at all.
+ expect(h).not.toContain("tier-cats");
+ expect(h.match(/<img/g)).toHaveLength(3);
+ // Still a radio group: the picked type is checked.
+ expect(h).toMatch(/role="radio" aria-checked="true"[^>]*>(?:(?!<\/button>).)*tier-normal/);
+ expect(unversioned(h)).toEqual([]);
+ });
+});
+
+describe("The empty pages' examples", () => {
+ it("show Character Sheet's example sheet with its chip", () => {
+ const h = html(SheetExample, {});
+ expect(h).toContain('src="/previews/templates/examples/character-sheet.jpg?v=2c3d4e59"');
+ expect(h).toContain(">Example<");
+ });
+
+ it("show Storyboard's six frames in order, numbered", () => {
+ expect(hasBoardExample()).toBe(true);
+ const h = html(BoardExample, {});
+ const srcs = [...h.matchAll(/ src="([^"]+)"/g)].map((m) => m[1]);
+ expect(srcs).toEqual(["/previews/templates/examples/storyboard-heist.jpg?v=3d4e5f6a", ...[2, 3, 4, 5, 6].map((k) => `/previews/templates/examples/storyboard-heist-${k}.jpg?v=4e5f6a7${k}`)]);
+ expect(h).toContain(">6<");
+ expect(unversioned(h)).toEqual([]);
+ });
+
+ it("show Elements' three saved elements and the picture of two of them together", () => {
+ const h = html(ElementsExample, {});
+ expect([...h.matchAll(/ src="([^"]+)"/g)].map((m) => m[1].split("?")[0])).toEqual(
+ ["element-maya", "element-rooftop-bar", "element-aurora", "element-together"].map((id) => `/previews/templates/examples/${id}.jpg`),
+ );
+ expect(h).toContain("@Maya walking into @Rooftop_bar");
+ expect(h.match(/>Example</g)).toHaveLength(1);
+ });
+});
+
describe("templateCover", () => {
it("reads every form of entry, with versions on every URL, and nothing for a tile that isn't listed", () => {
expect(templateCover("marketing", "m2-sticker-pop")).toEqual({
diff --git a/tests/template-covers.test.ts b/tests/template-covers.test.ts
index 477b8239..2629b550 100644
--- a/tests/template-covers.test.ts
+++ b/tests/template-covers.test.ts
@@ -12,6 +12,8 @@ import { AD_STYLES, TEMPLATES } from "@/lib/catalog/marketing";
import { MIXED_PRESETS } from "@/lib/catalog/mixed-media";
import { FASHION, PACKS } from "@/lib/catalog/packs";
import { SHORTS_PRESETS } from "@/lib/catalog/shorts";
+import { lookSet } from "@/lib/catalog/soul-cards";
+import { CREATURE_TYPES, HUMAN_TIERS } from "@/lib/influencer";
import { PRESET_PEAKS } from "@/lib/preset-peaks.generated";
import { PRESET_PREVIEWS } from "@/lib/preset-previews.generated";
import { TEMPLATE_GROUPS, templateCover, type TemplateGroup } from "@/lib/template-covers";
@@ -46,6 +48,12 @@ const TILES: Record<TemplateGroup, string[]> = {
canvas: CANVAS_TEMPLATES.map((t) => t.id),
"content-factory": PRESETS.map((p) => p.id),
explainer: [...EXPLAINER_STYLE_IDS],
+ // Fuobe Soul's looks, Soul 2.0's and Soul's, by look id.
+ soul: [...lookSet("v2").items, ...lookSet("v1").items].map((c) => c.id),
+ // AI Influencer's character types as tier-<type>.
+ influencer: [...HUMAN_TIERS, ...CREATURE_TYPES].map((t) => `tier-${t.id}`),
+ // The example pictures of the empty pages: Character Sheet, Storyboard (six frames), Elements (four pictures).
+ examples: ["character-sheet", "storyboard-heist", "element-maya", "element-rooftop-bar", "element-aurora", "element-together"],
};
const VERSIONED = /^(\/previews\/[^?]+)\?v=([0-9a-f]{8})$/;
const sha8 = (...files: string[]) => {
@@ -111,15 +119,16 @@ describe("the template covers manifest", () => {
n++;
let e: Entry;
if (group === "mixed-media" || id.startsWith("effect-chain-")) e = pick(presetCovers, n);
- else if (group === "fashion" || group === "photodump" || ["product-angles", "script-film", "table-film", "clips-film", "compare-image"].includes(id))
- e = { poster: t(key, n), frames: [2, 3, 4].slice(0, group === "photodump" ? 3 : 2).map((k) => t(key, n + k, `-${k}`)) };
+ else if (group === "fashion" || group === "photodump" || ["product-angles", "script-film", "table-film", "clips-film", "compare-image", "storyboard-heist"].includes(id))
+ e = { poster: t(key, n), frames: [2, 3, 4, 5, 6].slice(0, id === "storyboard-heist" ? 5 : group === "photodump" ? 3 : 2).map((k) => t(key, n + k, `-${k}`)) };
else if (group === "shorts") e = { poster: t(key, n), video: `/previews/templates/${key}.mp4?v=${v(n + 1)}`, at: 3.542 };
else if (group === "marketing" || group === "content-factory") e = { poster: t(key, n), video: `/previews/templates/${key}.mp4?v=${v(n + 1)}` };
else e = { poster: t(key, n) };
lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(gen.slimEntry(key, { poster: e.poster, ...(e.video && { video: e.video }), ...(e.at && { at: e.at }), ...(e.frames && { frames: e.frames }) }))}`);
}
}
- expect(lines).toHaveLength(239);
+ // The studios' tiles (239), Fuobe Soul's looks (139), AI Influencer's types (9) and the empty pages' examples (6).
+ expect(lines).toHaveLength(239 + 139 + 9 + 6);
const text = `{\n${lines.join(",\n")}\n}`;
expect(text.length).toBeLessThan(36_000);
expect(gzipSync(text).length).toBeLessThan(8_000);
@@ -232,4 +241,13 @@ describe.skipIf(!hasFfmpeg)("pnpm eval:covers --templates", () => {
expect(now).not.toBe(was);
expect(now).toBe(`/previews/templates/marketing/ps-sunlit-plinth.jpg?v=${sha8(poster, fileOf(thumbOf(now), publicDir))}`);
});
+
+ it("takes an example board's six frames (the cover and five more), and no more", () => {
+ put("examples/storyboard-heist", Object.fromEntries([["still.png", still], ...[2, 3, 4, 5, 6, 7].map((k) => [`frame-${k}.png`, still])]));
+ const r = run({ only: ["examples/storyboard-heist"] });
+ expect(r.covers.map((c) => c.key)).toEqual(["examples/storyboard-heist"]);
+ const board = gen.readTemplateManifest(manifest)["examples/storyboard-heist"];
+ expect(board.frames).toEqual([2, 3, 4, 5, 6].map((k) => expect.stringMatching(new RegExp(`^/previews/templates/examples/storyboard-heist-${k}\\.jpg\\?v=[0-9a-f]{8}$`))));
+ expect(templateCover("examples", "storyboard-heist", { "examples/storyboard-heist": gen.slimEntry("examples/storyboard-heist", board) } as never)?.frames).toHaveLength(6);
+ });
});