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.

AI Influencer: an original character sheet from a brief, saved as a character

Clauded9a4c3c9aaf4
diff --git a/src/components/studio/feed.tsx b/src/components/studio/feed.tsx
index c6d11a7d..6c457b39 100644
--- a/src/components/studio/feed.tsx
+++ b/src/components/studio/feed.tsx
@@ -19,8 +19,10 @@ import {
Crop,
FastForward,
Sparkles,
+ UserRoundPlus,
} from "lucide-react";
import Link from "next/link";
+import { useRouter } from "next/navigation";
import { useState } from "react";
import { toast } from "sonner";
import {
@@ -33,11 +35,32 @@ import {
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { getModel, getPreset } from "@/lib/catalog";
import { OPERATION_LABELS, type Generation, type OutputFile } from "@/lib/catalog/types";
-import { useCreateGeneration, useGenerationActions } from "@/lib/api";
+import { useCreateGeneration, useGenerationActions, useSaveElement } from "@/lib/api";
import { elapsed, formatCost, ratioValue, timeAgo } from "@/lib/format";
import { cn } from "@/lib/utils";
import { Viewer } from "./viewer";
+/** "a 26-year-old surfer from Lisbon, freckles" → "Surfer From Lisbon" — a starting name, renamed on the element page. */
+function characterName(prompt: string | undefined): string {
+ const words = (prompt ?? "").replace(/@\S+/g, "").replace(/[^\p{L}\p{N}\s'-]/gu, " ").split(/\s+/).filter((w) => w.length > 2 && !/\d/.test(w) && !/^(the|and|with|from|who|year|old|of)$/i.test(w));
+ const pick = words.slice(0, 3).map((w) => w[0].toUpperCase() + w.slice(1).toLowerCase()).join(" ");
+ return pick || "New character";
+}
+
+/** Save an image as a character element (AI Influencer sheets, any portrait) to @mention it later. */
+function useSaveAsCharacter() {
+ const save = useSaveElement();
+ const router = useRouter();
+ return (g: Generation, o: OutputFile) =>
+ save.mutate(
+ { name: characterName(g.request.prompt), kind: "character", references: [o.url] },
+ {
+ onSuccess: (el) => toast.success(`Saved as @${el.handle}`, { action: { label: "Open", onClick: () => router.push(`/elements/${el.id}`) } }),
+ onError: (e) => toast.error((e as Error).message),
+ },
+ );
+}
+
export function downloadName(g: Generation, o: OutputFile, i: number): string {
const ext = o.url.split(".").pop()?.split("?")[0] ?? "bin";
const base = (g.request.prompt || g.prompt || g.modelId).slice(0, 40).replace(/[^\w]+/g, "-").replace(/^-|-$/g, "") || "fuobe";
@@ -185,6 +208,7 @@ export function GenerationGroup({
onError: (e) => toast.error((e as Error).message),
});
const finalize = useFinalizeDraft();
+ const saveCharacter = useSaveAsCharacter();
const p = g.request.params ?? {};
const meta = [
g.request.step?.label,
@@ -321,6 +345,9 @@ export function GenerationGroup({
<IconAction label="Use as reference" href={`/image?ref=${encodeURIComponent(o.url)}`}>
<ImagePlus className="size-4" />
</IconAction>
+ <IconAction label="Save as character" onClick={() => saveCharacter(g, o)}>
+ <UserRoundPlus className="size-4" />
+ </IconAction>
</>
) : (
<>
diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.ts
index ef270dcd..daa06c9b 100644
--- a/src/lib/catalog/apps.ts
+++ b/src/lib/catalog/apps.ts
@@ -367,6 +367,26 @@ export const APPS: Preset[] = [
prompt:
"Relight the image with {option:light} {option:dir}. Keep the subject, composition and all details identical; only the light, shadows, reflections and color temperature change.",
}),
+ app({
+ name: "AI Influencer",
+ category: "Identity",
+ description: "Invent an original character and get a full character sheet",
+ icon: "UserRoundCog",
+ hue: 280,
+ inputs: [],
+ userPrompt: "required",
+ placeholder: "Who are they? e.g. “a 26-year-old surfer and photographer from Lisbon, freckles, sun-bleached curls”",
+ prompt: "{prompt}",
+ cloud: { modelId: "ai-influencer", op: "t2i" },
+ open: {
+ modelId: "oss-z-image-turbo",
+ op: "t2i",
+ params: { aspectRatio: "16:9" },
+ promptTemplate:
+ "Character design sheet of an original character: {prompt}. Front view, three-quarter view, side view and back view side by side, plus a row of four facial expressions; full body, the same face, hairstyle and outfit in every view; plain light-grey studio background, soft even light, photorealistic, high detail.",
+ },
+ parity: "Save the sheet as a character (tile menu) to use it in any prompt with @. The open version prompts Z-Image Turbo for the sheet",
+ }),
app({
name: "Match Lighting",
category: "Camera",
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index 4cd09890..262b3f3e 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -691,10 +691,32 @@ function withLastFrameExtend(m: ModelDef): ModelDef {
return { ...m, routes: [...m.routes, { op: "extend", provider: "fal", endpoint: LAST_FRAME_CHAIN, note: "last frame → Kling image-to-video → joined" }] };
}
+/**
+ * Higgsfield's AI Influencer character sheet. Not in Higgsfield's docs catalog (console docs and
+ * the pricing API only — docs/research/higgsfield-api.json), so it's defined here, not generated.
+ */
+const AI_INFLUENCER: ModelDef = {
+ id: "ai-influencer",
+ name: "AI Influencer",
+ vendor: "Higgsfield",
+ family: "soul",
+ engine: "cloud",
+ kind: "image",
+ tagline: "An original character sheet from a short brief — human or creature",
+ badges: ["new"],
+ routes: [{ op: "t2i", provider: "higgsfield", endpoint: "higgsfield/ai-influencer", map: { prompt: "brief", seed: "seed", seedRange: [1, 1000000] } }],
+ options: {
+ seed: true,
+ controls: [{ param: "tier", label: "Look", values: ["normal", "freak", "total", "insects", "frogs", "cats", "dogs", "capybaras", "birds"], default: "normal" }],
+ },
+ pricing: { unit: "image", usd: 0.05 },
+};
+
/** Cloud models with their Higgsfield routes attached, plus the models only Higgsfield hosts. */
const cloud: ModelDef[] = [
...CLOUD_MODELS.map((m) => (HIGGSFIELD_ROUTES[m.id] ? { ...m, routes: [...m.routes, ...HIGGSFIELD_ROUTES[m.id]] } : m)).map(withLastFrameExtend),
...HIGGSFIELD_MODELS,
+ AI_INFLUENCER,
...cloudTools,
];