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 builder: the cloud sheet runs on Nano Banana Pro or Seedream 5.0 Pro, no Higgsfield route

Claude8406d1be7326
diff --git a/scripts/gen-influencer-options.py b/scripts/gen-influencer-options.py
index 0a160135..42adff91 100644
--- a/scripts/gen-influencer-options.py
+++ b/scripts/gen-influencer-options.py
@@ -84,7 +84,7 @@ if errors:
OUT.write_text(
"// GENERATED by scripts/gen-influencer-options.py from docs/research/higgsfield-delta-4.json (aiInfluencerBuilder) — do not edit.\n"
- "// Higgsfield's AI Influencer builder: its option ids (the API's `selection`), labels, tiers, swatches and Shuffle weights.\n\n"
+ "// Higgsfield's AI Influencer builder: its option ids, labels, tiers, swatches and Shuffle weights.\n\n"
"/** Human tiers: Average (normal), Bold (freak), Extreme (total). */\n"
"export type HumanTier = \"normal\" | \"freak\" | \"total\";\n"
f"export type CreatureType = {' | '.join(json.dumps(c['id']) for c in creatures)};\n"
diff --git a/src/app/api/influencer/route.ts b/src/app/api/influencer/route.ts
index d317829b..bbdb0b6a 100644
--- a/src/app/api/influencer/route.ts
+++ b/src/app/api/influencer/route.ts
@@ -26,9 +26,9 @@ function bodyError(issues: z.core.$ZodIssue[]): string {
}
/**
- * AI Influencer builder: a character sheet from the builder's picks — Higgsfield's AI Influencer
- * (with a key), Nano Banana Pro or Seedream 5.0 on the cloud, the Soul Cast sheet workflow (plus
- * Qwen-Image-Edit 2511 for a face or clothing) on the open engine. `?preview=1` prices it instead.
+ * AI Influencer builder: a character sheet from the builder's picks — Nano Banana Pro or Seedream 5.0
+ * Pro on the cloud, the Soul Cast sheet workflow (plus Qwen-Image-Edit 2511 for a face, a reference or
+ * clothing) on the open engine. `?preview=1` prices it instead.
*/
export async function POST(request: Request) {
const parsed = Body.safeParse(await request.json().catch(() => null));
diff --git a/src/components/influencer/influencer-builder.tsx b/src/components/influencer/influencer-builder.tsx
index ed890da3..31a46635 100644
--- a/src/components/influencer/influencer-builder.tsx
+++ b/src/components/influencer/influencer-builder.tsx
@@ -15,7 +15,7 @@ import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Textarea } from "@/components/ui/textarea";
-import { useEngine, useGenerations, useStatus } from "@/lib/api";
+import { useEngine, useGenerations } from "@/lib/api";
import {
categoriesFor,
CREATURE_TYPES,
@@ -46,13 +46,12 @@ const STARTS: [InfluencerStart, string][] = [
["face", "Add your face"],
];
-const CLOUD_MODELS: { id: string; label: string; note: string; higgsfield?: boolean }[] = [
- { id: "auto", label: "Best available", note: "AI Influencer with a Higgsfield key, else Nano Banana Pro" },
- { id: "ai-influencer", label: "AI Influencer · Higgsfield", note: "Higgsfield's own character sheet, from your picks", higgsfield: true },
- { id: "nano-banana-pro", label: "Nano Banana Pro", note: "A wide sheet from the compiled description" },
- { id: "seedream-5-pro", label: "Seedream 5.0 Pro", note: "Photoreal, from the compiled description" },
+const CLOUD_MODELS: { id: string; label: string; note: string }[] = [
+ { id: "nano-banana-pro", label: "Nano Banana Pro", note: "A wide 2K sheet from your picks, keeps a face and clothing closely" },
+ { id: "seedream-5-pro", label: "Seedream 5.0 Pro", note: "Photoreal, from the same picks" },
];
+
type Message = { kind: "conflict" | "note"; text: string } | null;
/** Arrow keys move along the rail's tabs (and pick), Home / End jump to the ends. */
@@ -102,8 +101,6 @@ function RunInfo({ preview, loading, blocker }: { preview?: RunPreview & { steps
*/
export function InfluencerBuilder() {
const [engine, setEngine] = useEngine();
- const status = useStatus().data;
- const higgsfield = !!status?.providers?.higgsfield?.configured;
const [state, setState] = useState<InfluencerState>(INFLUENCER_START);
const [active, setActive] = useState("tier");
const [message, setMessage] = useState<Message>(null);
@@ -111,7 +108,7 @@ export function InfluencerBuilder() {
const [photo, setPhoto] = useState<SlotValue | null>(null);
const [clothing, setClothing] = useState<SlotValue[]>([]);
const [direction, setDirection] = useState("");
- const [modelId, setModelId] = useState("auto");
+ const [modelId, setModelId] = useState(CLOUD_MODELS[0].id);
const [ids, setIds] = useState<string[]>([]);
const clothingInput = useRef<HTMLInputElement>(null);
const model = CLOUD_MODELS.find((m) => m.id === modelId) ?? CLOUD_MODELS[0];
@@ -136,7 +133,7 @@ export function InfluencerBuilder() {
() =>
uploading
? null
- : { engine, state, direction: direction.trim() || undefined, start, photo: photoRef, clothing: clothing.map((c) => c.ref), modelId: engine === "cloud" && modelId !== "auto" ? modelId : undefined },
+ : { engine, state, direction: direction.trim() || undefined, start, photo: photoRef, clothing: clothing.map((c) => c.ref), modelId: engine === "cloud" ? modelId : undefined },
[uploading, engine, state, direction, start, photoRef, clothing, modelId],
);
const settled = useSettled(body);
@@ -373,7 +370,6 @@ export function InfluencerBuilder() {
</Select>
<p id="ib-model-note" className="text-[12px] leading-snug text-muted-foreground">
{model.note}
- {model.higgsfield && !higgsfield && " · needs a Higgsfield key"}
</p>
</div>
) : (
diff --git a/src/lib/catalog/influencer-options.generated.ts b/src/lib/catalog/influencer-options.generated.ts
index d687ee9d..24f5c817 100644
--- a/src/lib/catalog/influencer-options.generated.ts
+++ b/src/lib/catalog/influencer-options.generated.ts
@@ -1,5 +1,5 @@
// GENERATED by scripts/gen-influencer-options.py from docs/research/higgsfield-delta-4.json (aiInfluencerBuilder) — do not edit.
-// Higgsfield's AI Influencer builder: its option ids (the API's `selection`), labels, tiers, swatches and Shuffle weights.
+// Higgsfield's AI Influencer builder: its option ids, labels, tiers, swatches and Shuffle weights.
/** Human tiers: Average (normal), Bold (freak), Extreme (total). */
export type HumanTier = "normal" | "freak" | "total";
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index 706081d0..0f7de344 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -1406,17 +1406,9 @@ const AI_INFLUENCER: ModelDef = {
kind: "image",
tagline: "An original character sheet from a short brief — human or creature",
badges: ["new"],
- // The builder (/influencer) sends Higgsfield's own fields as params.extra: tier, selection (category →
- // option ids), pinned_species and body_color. A photo (Add your face, a reference) goes to image_url,
- // clothing references to item_image_urls (up to 3).
- routes: [
- { op: "t2i", provider: "higgsfield", endpoint: "higgsfield/ai-influencer", map: { prompt: "brief", images: "item_image_urls", maxImages: 3, seed: "seed", seedRange: [1, 1000000] } },
- { op: "edit", provider: "higgsfield", endpoint: "higgsfield/ai-influencer", map: { prompt: "brief", image: "image_url", moreImages: "item_image_urls", seed: "seed", seedRange: [1, 1000000] } },
- ],
+ routes: [{ op: "t2i", provider: "higgsfield", endpoint: "higgsfield/ai-influencer", map: { prompt: "brief", seed: "seed", seedRange: [1, 1000000] } }],
options: {
seed: true,
- maxImages: 4,
- promptOptional: true,
controls: [{ param: "tier", label: "Look", values: ["normal", "freak", "total", "insects", "frogs", "cats", "dogs", "capybaras", "birds"], default: "normal" }],
},
pricing: { unit: "image", usd: 0.05 },
diff --git a/src/lib/catalog/payload.ts b/src/lib/catalog/payload.ts
index c58298cc..a0e05dc8 100644
--- a/src/lib/catalog/payload.ts
+++ b/src/lib/catalog/payload.ts
@@ -228,7 +228,6 @@ export function buildPayload(map: FieldMap, input: GenInput): Record<string, unk
if (map.images && images.length) out[map.images] = images;
if (map.image && images.length) out[map.image] = images[0];
if (map.image2 && images.length > 1) out[map.image2] = images[1];
- if (map.moreImages && images.length > 1) out[map.moreImages] = images.slice(1);
if (map.endImage && input.endImage) out[map.endImage] = input.endImage;
if (map.mask && input.mask) out[map.mask] = input.mask;
if (map.video && input.video) out[map.video] = input.video;
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index 2fcd7fc5..a4ca85b1 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -279,8 +279,6 @@ export interface FieldMap {
image?: string;
/** Array of images field, e.g. "image_urls" (receives every reference image). */
images?: string;
- /** Array field that receives every image after the first, which goes to `image` (AI Influencer: image_url + item_image_urls). */
- moreImages?: string;
endImage?: string;
mask?: string;
/** What the mask's paint means to this API: white (default), black or transparent = change. */
diff --git a/src/lib/influencer.ts b/src/lib/influencer.ts
index 034685df..d9f00dbe 100644
--- a/src/lib/influencer.ts
+++ b/src/lib/influencer.ts
@@ -710,14 +710,6 @@ export function compileDressPrompt({ start = "scratch", clothing = 0 }: CompileI
.concat(".");
}
-/** Higgsfield AI Influencer's own fields: tier, selection (category → option ids), pinned_species, body_color. */
-export function higgsfieldFields(state: InfluencerState): Record<string, unknown> {
- const creature = isCreature(state.tier);
- const selection = Object.fromEntries(Object.entries(state.picks).filter(([k, v]) => k !== "tier" && v.length));
- const species = creature && creatureOf(state.tier)?.species.some((s) => s.id === state.species) ? state.species : undefined;
- return { tier: state.tier, selection, ...(species && { pinned_species: species }), ...(creature && state.bodyColor && { body_color: state.bodyColor.toLowerCase() }) };
-}
-
/** The picks as chips for the summary: [Category label, "Option, Option"]. */
export function summaryRows(state: InfluencerState): { category: string; label: string; options: string }[] {
return categoriesFor(state.tier).flatMap((c) => {
@@ -770,8 +762,8 @@ export function cleanState(raw: unknown): { state: InfluencerState; problem: str
// ---------------------------------------------------------------------------
// The plan per engine
-/** The cloud models that can draw the sheet: Higgsfield's own (with a key), then the two the research names. */
-export const INFLUENCER_CLOUD_MODELS = ["ai-influencer", "nano-banana-pro", "seedream-5-pro"] as const;
+/** The cloud models that draw the sheet from the compiled prompt: Nano Banana Pro (the default), Seedream 5.0 Pro. */
+export const INFLUENCER_CLOUD_MODELS = ["nano-banana-pro", "seedream-5-pro"] as const;
export const INFLUENCER_OPEN_MODELS = { sheet: "oss-zimage-soul-cast", edit: "oss-qwen-edit" } as const;
/** Qwen-Image-Edit 2511 takes three images: the sheet, then the photo and clothing. */
const OPEN_EDIT_IMAGES = 3;
@@ -818,12 +810,12 @@ export function influencerBlocker(run: Pick<InfluencerRun, "state" | "direction"
}
/**
- * The jobs for a run. Cloud: Higgsfield's AI Influencer with its own fields (a key, and not turned off),
- * else Nano Banana Pro or Seedream 5.0 with the compiled prompt, the photo and clothing as references.
+ * The jobs for a run. Cloud: Nano Banana Pro (or Seedream 5.0 Pro when asked) draws the sheet from the
+ * compiled prompt, with the photo and clothing as references.
* Open: the Soul Cast sheet workflow (Z-Image Turbo) draws the character; with a photo or clothing,
* Qwen-Image-Edit 2511 then puts your face and clothes on that sheet, so the sheet keeps its wide shape.
*/
-export function planInfluencer(run: InfluencerRun, caps: PlanCaps): InfluencerPlan {
+export function planInfluencer(run: InfluencerRun, caps: Pick<PlanCaps, "has">): InfluencerPlan {
const blocker = influencerBlocker(run);
if (blocker) throw new Error(blocker);
const { state, start } = run;
@@ -869,31 +861,8 @@ export function planInfluencer(run: InfluencerRun, caps: PlanCaps): InfluencerPl
const has = (id: string) => !caps.has || caps.has(id);
const asked = run.modelId && (INFLUENCER_CLOUD_MODELS as readonly string[]).includes(run.modelId) ? run.modelId : undefined;
- const native = caps.higgsfield && has("ai-influencer") && (!asked || asked === "ai-influencer");
- if (asked === "ai-influencer" && !native) notes.push("AI Influencer needs a Higgsfield key — Nano Banana Pro draws the sheet from the same choices");
const images = [...(photo ? [photo] : []), ...clothing];
- if (native) {
- // Higgsfield builds the character from the picks itself: the Direction is the brief.
- return {
- steps: [
- {
- key: "sheet",
- request: {
- feature: FEATURE,
- modelId: "ai-influencer",
- op: photo ? "edit" : "t2i",
- prompt: direction ?? "",
- ...(images.length && { inputs: { images } }),
- params: { numOutputs: 1, extra: higgsfieldFields(state) },
- title,
- },
- },
- ],
- modelId: "ai-influencer",
- notes,
- };
- }
- const modelId = asked && asked !== "ai-influencer" && has(asked) ? asked : "nano-banana-pro";
+ const modelId = asked && has(asked) ? asked : INFLUENCER_CLOUD_MODELS[0];
return {
steps: [
{
diff --git a/tests/influencer-api.test.ts b/tests/influencer-api.test.ts
index f1b8df23..b43999a3 100644
--- a/tests/influencer-api.test.ts
+++ b/tests/influencer-api.test.ts
@@ -43,12 +43,13 @@ async function settle(id: string, ms = 40_000) {
}
describe("/api/influencer", () => {
- it("prices a cloud sheet on Nano Banana Pro without a key, and Higgsfield's AI Influencer with one", async () => {
+ it("prices a cloud sheet on Nano Banana Pro (Seedream 5.0 Pro when asked), with or without a Higgsfield key", async () => {
const cloud = await (await post({ engine: "cloud", state, start: "scratch" }, true)).json();
expect(cloud).toMatchObject({ modelId: "nano-banana-pro", modelName: "Nano Banana Pro", count: 1, steps: 1, demo: true });
+ // Fuobe uses no Higgsfield API: a key changes nothing here.
setSetting("higgsfieldKey", "key:secret");
- const hf = await (await post({ engine: "cloud", state, start: "scratch" }, true)).json();
- expect(hf).toMatchObject({ modelId: "ai-influencer", modelName: "AI Influencer", costUsd: 0.05, demo: false });
+ expect(await (await post({ engine: "cloud", state, start: "scratch" }, true)).json()).toMatchObject({ modelId: "nano-banana-pro", demo: true });
+ expect((await (await post({ engine: "cloud", state, start: "scratch", modelId: "ai-influencer" }, true)).json()).modelId).toBe("nano-banana-pro");
const seedream = await (await post({ engine: "cloud", state, start: "scratch", modelId: "seedream-5-pro" }, true)).json();
expect(seedream.modelId).toBe("seedream-5-pro");
});
diff --git a/tests/influencer-comfy.test.ts b/tests/influencer-comfy.test.ts
index d33910ec..75cd6916 100644
--- a/tests/influencer-comfy.test.ts
+++ b/tests/influencer-comfy.test.ts
@@ -19,7 +19,7 @@ const state: InfluencerState = { tier: "cats", picks: { gender: ["female"], hair
describe("the builder's open engine through the provider", () => {
it("Soul Cast sheet: the compiled character goes after the graph's own turnaround wording", async () => {
- const [sheet] = planInfluencer({ engine: "open", state, start: "scratch", direction: "Runs a night bakery" }, { higgsfield: false }).steps;
+ const [sheet] = planInfluencer({ engine: "open", state, start: "scratch", direction: "Runs a night bakery" }, {}).steps;
const { workflow: wf } = await prepare("soul-cast-sheet-zimage", { prompt: sheet.request.prompt, seed: 11 }, "t2i");
expect(at(wf, "20", "string_b")).toBe(compileCastPrompt({ state, direction: "Runs a night bakery" }));
expect(at(wf, "20", "string_b")).toMatch(/^A female anthropomorphic Maine Coon cat with pale pink fur, with a tall beehive updo, wearing an all-black goth outfit\. Anthropomorphic Maine Coon cat/);
@@ -28,7 +28,7 @@ describe("the builder's open engine through the provider", () => {
});
it("Qwen-Image-Edit 2511: the sheet is image 1, your face image 2, the clothing image 3", async () => {
- const plan = planInfluencer({ engine: "open", state, start: "face", photo: "face.png", clothing: ["coat.png", "boots.png"] }, { higgsfield: false });
+ const plan = planInfluencer({ engine: "open", state, start: "face", photo: "face.png", clothing: ["coat.png", "boots.png"] }, {});
const dress = plan.steps[1].request;
// What the chain hands the step when the sheet is done (position "first").
const images = ["sheet.png", ...(dress.inputs?.images ?? [])];
@@ -38,7 +38,7 @@ describe("the builder's open engine through the provider", () => {
});
it("with the face only, the third image slot is left out rather than refused", async () => {
- const plan = planInfluencer({ engine: "open", state, start: "face", photo: "face.png" }, { higgsfield: false });
+ const plan = planInfluencer({ engine: "open", state, start: "face", photo: "face.png" }, {});
const dress = plan.steps[1].request;
const { workflow: wf } = await prepare("qwen-image-edit-2511-multi", { prompt: dress.prompt, images: ["sheet.png", ...(dress.inputs?.images ?? [])] }, "edit");
expect([at(wf, "41", "image"), at(wf, "83", "image")]).toEqual(["sheet.png", "face.png"]);
diff --git a/tests/influencer.test.ts b/tests/influencer.test.ts
index 45d21eb9..4b7bba8e 100644
--- a/tests/influencer.test.ts
+++ b/tests/influencer.test.ts
@@ -2,7 +2,6 @@ import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { getModel, getPreset } from "@/lib/catalog";
-import { buildPayload } from "@/lib/catalog/payload";
import { planGeneration } from "@/lib/catalog/plan";
import {
categoriesFor,
@@ -16,7 +15,6 @@ import {
CREATURE_TYPES,
describeInfluencer,
getOption,
- higgsfieldFields,
INFLUENCER_CATEGORIES,
INFLUENCER_START,
influencerBlocker,
@@ -357,12 +355,6 @@ describe("the prompt compiler", () => {
expect(compileDressPrompt({ state: s, clothing: 2 })).toContain("clothing shown in images 2 and 3");
});
- it("sends Higgsfield its own fields", () => {
- expect(higgsfieldFields(S("cats", { gender: ["male"], hair: ["hair_afro"] }, { species: "pug", bodyColor: "#AABBCC" }))).toEqual({ tier: "cats", selection: { gender: ["male"], hair: ["hair_afro"] }, body_color: "#aabbcc" });
- expect(higgsfieldFields(S("dogs", { gender: ["male"] }, { species: "pug", bodyColor: "#AABBCC" }))).toEqual({ tier: "dogs", selection: { gender: ["male"] }, pinned_species: "pug", body_color: "#aabbcc" });
- expect(higgsfieldFields(S("normal", { accessory: ["acc_glasses", "acc_bag"] }))).toEqual({ tier: "normal", selection: { accessory: ["acc_glasses", "acc_bag"] } });
- });
-
it("summarises and names", () => {
const s = S("normal", { gender: ["male"], aesthetic: ["suits"], hair: ["hair_mullet"], accessory: ["acc_glasses", "acc_hat"] });
expect(summaryRows(s)).toEqual([
@@ -400,61 +392,46 @@ describe("the plan per engine", () => {
const clothes = ["/api/files/a.png", "/api/files/b.png", "/api/files/c.png"];
const state = S("freak", { gender: ["female"], hair: ["hs_beehive"], aesthetic: ["goth"] });
const run = (o: Partial<InfluencerRun>): InfluencerRun => ({ engine: "cloud", state, start: "scratch", ...o });
- const KEY = { higgsfield: true, has: () => true };
- const NO_KEY = { higgsfield: false, has: () => true };
+ const ALL = { has: () => true };
const valid = (p: ReturnType<typeof planInfluencer>) => p.steps.map((s) => planGeneration(s.request, getModel, getPreset));
- it("cloud with a Higgsfield key: AI Influencer with its own fields; the photo is image_url, clothing item_image_urls", () => {
- const p = planInfluencer(run({ start: "face", photo: face, clothing: clothes.slice(0, 2), direction: "A potter from Porto" }), KEY);
- expect(p.modelId).toBe("ai-influencer");
- const r = p.steps[0].request;
- expect(r).toMatchObject({ feature: "influencer", modelId: "ai-influencer", op: "edit", prompt: "A potter from Porto", inputs: { images: [face, ...clothes.slice(0, 2)] } });
- expect(r.params?.extra).toEqual({ tier: "freak", selection: state.picks });
- const [plan] = valid(p);
- const route = getModel("ai-influencer")!.routes.find((x) => x.op === plan.op)!;
- expect(buildPayload(route.map!, { prompt: plan.prompt, images: r.inputs!.images, ...plan.params })).toEqual({
- brief: "A potter from Porto",
- image_url: face,
- item_image_urls: clothes.slice(0, 2),
- tier: "freak",
- selection: state.picks,
- });
- // From scratch with clothing: no image_url, an empty brief is fine.
- const t2i = planInfluencer(run({ clothing: clothes }), KEY);
- const [plan2] = valid(t2i);
- expect(plan2.op).toBe("t2i");
- const route2 = getModel("ai-influencer")!.routes.find((x) => x.op === "t2i")!;
- expect(buildPayload(route2.map!, { prompt: plan2.prompt, images: clothes, ...plan2.params })).toEqual({ brief: "", item_image_urls: clothes, tier: "freak", selection: state.picks });
- });
-
- it("cloud without a key: Nano Banana Pro (or Seedream 5.0) draws a wide sheet from the compiled prompt", () => {
- const p = planInfluencer(run({ start: "face", photo: face, clothing: [clothes[0]] }), NO_KEY);
+ it("cloud: Nano Banana Pro draws a wide sheet from the compiled prompt, Seedream 5.0 Pro when asked", () => {
+ const p = planInfluencer(run({ start: "face", photo: face, clothing: [clothes[0]] }), ALL);
expect(p.modelId).toBe("nano-banana-pro");
expect(p.notes).toEqual([]);
- expect(p.steps[0].request).toMatchObject({ op: "edit", inputs: { images: [face, clothes[0]] }, params: { aspectRatio: "16:9", resolution: "2K", numOutputs: 1 } });
+ expect(p.steps).toHaveLength(1);
+ expect(p.steps[0].request).toMatchObject({ feature: "influencer", op: "edit", inputs: { images: [face, clothes[0]] }, params: { aspectRatio: "16:9", resolution: "2K", numOutputs: 1 } });
expect(p.steps[0].request.prompt).toContain("the face of the person in image 1");
expect(p.steps[0].request.prompt).toContain("clothing shown in image 2");
valid(p);
- const asked = planInfluencer(run({ modelId: "ai-influencer" }), NO_KEY);
- expect(asked.modelId).toBe("nano-banana-pro");
- expect(asked.notes).toEqual(["AI Influencer needs a Higgsfield key — Nano Banana Pro draws the sheet from the same choices"]);
- expect(asked.steps[0].request.op).toBe("t2i");
- const seedream = planInfluencer(run({ modelId: "seedream-5-pro" }), KEY);
+ const scratch = planInfluencer(run({ direction: "A potter from Porto" }), ALL);
+ expect(scratch.steps[0].request).toMatchObject({ op: "t2i", prompt: compileSheetPrompt({ state, direction: "A potter from Porto" }) });
+ expect(scratch.steps[0].request.inputs).toBeUndefined();
+ valid(scratch);
+ const seedream = planInfluencer(run({ modelId: "seedream-5-pro", clothing: clothes }), ALL);
expect(seedream.modelId).toBe("seedream-5-pro");
expect(seedream.steps[0].request.params).toEqual({ numOutputs: 1, aspectRatio: "16:9" });
+ expect(seedream.steps[0].request.inputs?.images).toEqual(clothes);
valid(seedream);
- expect(planInfluencer(run({ modelId: "flux-3-max" }), NO_KEY).modelId).toBe("nano-banana-pro");
+ // Nothing else is asked for: not Higgsfield's AI Influencer, not a model the builder doesn't list.
+ for (const modelId of ["ai-influencer", "flux-3-max"]) {
+ const other = planInfluencer(run({ modelId }), ALL);
+ expect(other.modelId).toBe("nano-banana-pro");
+ expect(other.steps[0].request.params?.extra).toBeUndefined();
+ }
+ // Seedream missing from the install: Nano Banana Pro.
+ expect(planInfluencer(run({ modelId: "seedream-5-pro" }), { has: (id) => id !== "seedream-5-pro" }).modelId).toBe("nano-banana-pro");
});
it("open from scratch: the Soul Cast sheet workflow with the compiled character", () => {
- const p = planInfluencer(run({ engine: "open", direction: "loves jazz" }), NO_KEY);
+ const p = planInfluencer(run({ engine: "open", direction: "loves jazz" }), ALL);
expect(p.steps).toHaveLength(1);
expect(p.steps[0].request).toMatchObject({ feature: "influencer", modelId: "oss-zimage-soul-cast", op: "t2i", prompt: compileCastPrompt({ state, direction: "loves jazz" }) });
valid(p);
});
it("open with your face: the sheet, then Qwen-Image-Edit 2511 puts the face (and one clothing reference) on it", () => {
- const p = planInfluencer(run({ engine: "open", start: "face", photo: face, clothing: clothes }), NO_KEY);
+ const p = planInfluencer(run({ engine: "open", start: "face", photo: face, clothing: clothes }), ALL);
expect(p.modelId).toBe("oss-qwen-edit");
expect(p.steps.map((s) => [s.key, s.request.feature, s.request.modelId, s.after])).toEqual([
["sheet", "influencer-step", "oss-zimage-soul-cast", undefined],
@@ -465,11 +442,11 @@ describe("the plan per engine", () => {
expect(p.steps[1].request.prompt).toBe(compileDressPrompt({ state, start: "face", clothing: 1 }));
expect(p.notes[0]).toBe("Qwen-Image-Edit takes 3 images (the sheet, your photo and clothing) — the first clothing reference is used");
valid(p);
- const dressed = planInfluencer(run({ engine: "open", clothing: clothes }), NO_KEY);
+ const dressed = planInfluencer(run({ engine: "open", clothing: clothes }), ALL);
expect(dressed.steps[1].request.inputs?.images).toEqual(clothes.slice(0, 2));
expect(dressed.notes).toEqual(["Qwen-Image-Edit takes 3 images (the sheet and clothing) — the first 2 clothing references are used", "Two steps: Z-Image Turbo draws the sheet, then Qwen-Image-Edit 2511 dresses it in your clothing"]);
// A photo only matters when the run starts from it.
- expect(planInfluencer(run({ engine: "open", start: "scratch", photo: face }), NO_KEY).steps).toHaveLength(1);
+ expect(planInfluencer(run({ engine: "open", start: "scratch", photo: face }), ALL).steps).toHaveLength(1);
});
it("says what is missing or too much, in Higgsfield's words where it has them", () => {
@@ -478,6 +455,6 @@ describe("the plan per engine", () => {
expect(influencerBlocker(run({ clothing: [...clothes, "/api/files/d.png"] }))).toBe("You can add up to three clothing references");
expect(influencerBlocker(run({ start: "face" }))).toBe("Add your photo first");
expect(influencerBlocker(run({ start: "reference" }))).toBe("Add a reference image first");
- expect(() => planInfluencer(run({ state: S("freak", { body_type: ["body_ultra"], proportions: ["pr_longlimbs"] }) }), KEY)).toThrow(CONFLICT_MESSAGES.buildLegs);
+ expect(() => planInfluencer(run({ state: S("freak", { body_type: ["body_ultra"], proportions: ["pr_longlimbs"] }) }), ALL)).toThrow(CONFLICT_MESSAGES.buildLegs);
});
});