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.

Originals O10: the influencer sheet keeps its shape in the cloud, the try-on LoRA always runs, Fashion moves on when a model can't, the casting look on your GPU

Claude9e1fa79154a6
diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.py
index dc8cb8f2..627cc805 100644
--- a/scripts/gen-cloud-models.py
+++ b/scripts/gen-cloud-models.py
@@ -72,7 +72,7 @@ M = []
def model(id, name, vendor, family, kind, tagline, routes, badges=None, pricing=None, defaults=None, options=None, fixed=None, hidden=False,
sliders=None, controls=None, api_defaults=None, formats=None, ranged_durations=False, fit_values=False, fps_targets=None, upscale_tiers=None,
- frame_step=None, original=False, sizes=None):
+ frame_step=None, original=False, sizes=None, keep_shape=False):
"""sliders / controls: [(field, label)] read from each route's research inputs (dotted = nested field):
numeric fields with minimum/maximum become sliders, enums become composer controls; both travel as params.extra.
fixed: fields always sent. api_defaults: fields sent unless the request sets them (FieldMap.defaults).
@@ -88,13 +88,17 @@ def model(id, name, vendor, family, kind, tagline, routes, badges=None, pricing=
original: a Fuobe Original's cloud half (written to ORIGINAL_CLOUD; models.ts joins it to the ComfyUI routes).
sizes: {tier: {aspect: [w, h]}}: exact sizes per resolution tier (Fuobe Soul's table): FieldMap.size.table, sent
as width / height fields or as one {width, height} object field (fal's image_size); the tiers become the resolutions.
+ keep_shape: an edit model that also offers "auto" (keep image 1's shape and size): a route whose size field may be
+ left out for that (fal's nullable image_size) lists the shapes it takes (EnumField.accepts), so "auto" is left out
+ and the API follows the input image; a route whose own default matches the input (Replicate's match_input_image)
+ leaves it out the same way.
A route's options dict may also set max_images (FieldMap.maxImages), note, loraEndpoint (the same model with LoRAs:
FieldMap.loras comes from its research record) and pin (a Replicate model run by version: the research's version)."""
M.append(dict(id=id, name=name, vendor=vendor, family=family, kind=kind, tagline=tagline, routes=routes,
badges=badges or [], pricing=pricing, defaults=defaults or {}, options=options or {}, fixed=fixed or {}, hidden=hidden,
sliders=sliders or [], controls=controls or [], api_defaults=api_defaults or {}, formats=formats or {},
ranged_durations=ranged_durations, fit_values=fit_values, fps_targets=fps_targets or [], upscale_tiers=upscale_tiers or [],
- frame_step=frame_step, original=original, sizes=sizes))
+ frame_step=frame_step, original=original, sizes=sizes, keep_shape=keep_shape))
# ----- Image
@@ -192,7 +196,9 @@ model("qwen-image-edit-2511-cloud", "Qwen-Image-Edit 2511 (hosted)", "Alibaba Qw
[("edit", "fal-ai/qwen-image-edit-2511", "fal", {"loraEndpoint": "fal-ai/qwen-image-edit-2511/lora"}),
("edit", "qwen/qwen-image-edit-2511", "replicate", {"keys": {"images": "image"}, "drop": ["image"]})], defaults={"aspectRatio": "1:1"},
# Replicate's aspect_ratio has no 21:9, 3:2, 2:3, 5:4 or 4:5: each route lists what it takes (fit_values).
- fit_values=True)
+ # "auto" keeps image 1's shape and size (the AI Influencer's sheet stays 16:9): fal's image_size and Replicate's
+ # aspect_ratio (match_input_image by default) are left out.
+ fit_values=True, keep_shape=True)
# Qwen-Image-Edit 2509 with its LoRAs (O4): Fuobe DoP's relight effects relight the start frame with the 2509 Relight
# LoRA before the clip is made. A helper step, not a picker model.
model("qwen-image-edit-2509-cloud", "Qwen-Image-Edit 2509 (hosted)", "Alibaba Qwen", "qwen-image", "image",
@@ -1724,8 +1730,10 @@ def build_route(op, ep, provider, m, opts, ropts=None):
# A model that asks for "auto" (Fuobe DoP · LTX: the start frame's shape) keeps it when the API takes it;
# otherwise the default fallback below would make every clip square (1:1, the first size listed).
auto = "auto" in enum and m["defaults"].get("aspectRatio") == "auto"
- fmap["aspectRatio"] = {"key": key, "values": {**({"auto": "auto"} if auto else {}), **IMAGE_SIZE_MAP}}
- opts["aspectRatios"] = union(opts.get("aspectRatios", []), (["auto"] if auto else []) + IMG_AR)
+ # keep_shape: "auto" leaves a nullable size out, so the API keeps the input image's shape and size.
+ keep = bool(m.get("keep_shape")) and not auto and bool(spec.get("nullable"))
+ fmap["aspectRatio"] = {"key": key, "values": {**({"auto": "auto"} if auto else {}), **IMAGE_SIZE_MAP}, **({"accepts": IMG_AR} if keep else {})}
+ opts["aspectRatios"] = union(opts.get("aspectRatios", []), (["auto"] if auto else []) + IMG_AR + (["auto"] if keep else []))
else:
fmap["aspectRatio"] = key
ratios = [v for v in enum if RATIO.match(str(v)) or v == "auto"]
diff --git a/src/app/api/photodump/fashion/route.ts b/src/app/api/photodump/fashion/route.ts
index 75ab5748..ebeebd7d 100644
--- a/src/app/api/photodump/fashion/route.ts
+++ b/src/app/api/photodump/fashion/route.ts
@@ -7,7 +7,7 @@ const Engine = z.enum(["cloud", "open"]);
const Body = z.discriminatedUnion("step", [
z.object({ step: z.literal("base"), templateId: z.string().max(80), elementId: z.string().max(40), engine: Engine }),
z.object({ step: z.literal("outfit"), templateId: z.string().max(80), base: File, garment: File, engine: Engine, modelId: z.string().max(80).optional() }),
- z.object({ step: z.literal("photoset"), templateId: z.string().max(80), dressed: File, engine: Engine }),
+ z.object({ step: z.literal("photoset"), templateId: z.string().max(80), dressed: File, engine: Engine, modelId: z.string().max(80).optional() }),
]);
/**
diff --git a/src/components/fashion/fashion-view.tsx b/src/components/fashion/fashion-view.tsx
index 90ec0e9a..1fd0eff4 100644
--- a/src/components/fashion/fashion-view.tsx
+++ b/src/components/fashion/fashion-view.tsx
@@ -16,7 +16,7 @@ import { CharacterPicker } from "@/components/photodump/subject";
import { UploadBox } from "@/components/photodump/upload-box";
import { useEngine, useGenerations, useModelAccess } from "@/lib/api";
import { keepOffered, offered } from "@/lib/model-access";
-import { FASHION, FASHION_START, FASHION_STEPS, fashionBlocker, fashionReducer, getTemplate, type FashionState } from "@/lib/catalog/packs";
+import { FASHION, FASHION_MODELS, FASHION_START, FASHION_STEPS, fashionBlocker, fashionReducer, getTemplate, type FashionState } from "@/lib/catalog/packs";
import type { Generation } from "@/lib/catalog/types";
import { cn } from "@/lib/utils";
import { useStoredReducer } from "./stored";
@@ -24,12 +24,17 @@ import { TemplatePreview } from "./template-preview";
const LABELS = ["Select presets", "Character", "Generation", "Clothing", "Photoset"];
const BANNER_KEY = "fuobe.fashion.banner";
-/** The cloud's outfit models: Fuobe Try-On (the Original, FLUX.2 [klein] 4B + a try-on LoRA) first, partners after. */
-const OUTFIT_MODELS = [
- ["fuobe-tryon", "Fuobe Try-On"],
- ["fashn-tryon", "FASHN Try-On"],
- ["nano-banana-pro", "Nano Banana Pro"],
-] as const;
+/**
+ * The outfit and photoset models' names (FASHION_MODELS has each step's per engine): Fuobe Try-On (the Original, FLUX.2
+ * [klein] 4B + a try-on LoRA) and Qwen-Image-Edit 2511 first, partners after.
+ */
+const MODEL_LABELS: Record<string, string> = {
+ "fuobe-tryon": "Fuobe Try-On",
+ "fashn-tryon": "FASHN Try-On",
+ "nano-banana-pro": "Nano Banana Pro",
+ "qwen-image-edit-2511-cloud": "Qwen-Image-Edit 2511",
+ "oss-qwen-edit": "Qwen-Image-Edit 2511",
+};
const bannerListeners = new Set<() => void>();
function readBanner(): boolean {
@@ -66,11 +71,16 @@ export function FashionView() {
const [s, dispatch] = useStoredReducer<FashionState, Parameters<typeof fashionReducer>[1]>("fuobe.fashion", fashionReducer, FASHION_START);
const [engine, setEngine] = useEngine();
const [garment, setGarment] = useState<SlotValue | null>(null);
- const [pickedOutfit, setOutfitModel] = useState<string>("fuobe-tryon");
- // Outfit models switched off in Settings → Models & licences leave the choice; the pick falls back to one that is on.
+ const [pickedOutfit, setOutfitModel] = useState<string>();
+ const [pickedSet, setSetModel] = useState<string>();
+ // Models switched off in Settings → Models & licences (Fuobe Try-On with its try-on LoRA off too) leave the choice;
+ // the pick falls back to one that is on.
const access = useModelAccess();
- const outfitModels = keepOffered(OUTFIT_MODELS, ([id]) => offered(access, id, "cloud"));
- const outfitModel = outfitModels.some(([id]) => id === pickedOutfit) ? pickedOutfit : outfitModels[0][0];
+ const choices = (ids: readonly string[]) => keepOffered(ids, (id) => offered(access, id, engine));
+ const outfitModels = choices(FASHION_MODELS.outfit[engine]);
+ const outfitModel = pickedOutfit && outfitModels.includes(pickedOutfit) ? pickedOutfit : outfitModels[0];
+ const setModels = choices(FASHION_MODELS.photoset[engine]);
+ const setModel = pickedSet && setModels.includes(pickedSet) ? pickedSet : setModels[0];
const [bannerSeen, hideBanner] = useBannerSeen();
const { data } = useGenerations({ features: ["fashion"], limit: 200 });
const base = useRun<Record<string, unknown>>("/api/photodump/fashion");
@@ -94,7 +104,7 @@ export function FashionView() {
const baseBody = t && s.elementId ? { step: "base", templateId: t.id, elementId: s.elementId, engine } : null;
const outfitBody = t && s.base && s.garment && !s.garment.uploading ? { step: "outfit", templateId: t.id, base: s.base, garment: s.garment.url, engine, modelId: outfitModel } : null;
- const setBody = t && s.outfit ? { step: "photoset", templateId: t.id, dressed: s.outfit, engine } : null;
+ const setBody = t && s.outfit ? { step: "photoset", templateId: t.id, dressed: s.outfit, engine, modelId: setModel } : null;
const preview = useRunPreview("/api/photodump/fashion", s.step === "character" ? baseBody : s.step === "clothing" ? (s.outfit ? setBody : outfitBody) : null);
const block = (msg: string | null) => {
@@ -243,15 +253,7 @@ export function FashionView() {
</div>
<UploadBox value={garmentValue} onChange={setGarmentValue} title="Upload outfit" hint="The product: a garment on a model or flat-lay" className="aspect-[3/4]" />
</div>
- {engine === "cloud" && (
- <div role="radiogroup" aria-label="Outfit model" onKeyDown={radioKeys} className="flex flex-wrap gap-1">
- {outfitModels.map(([id, label]) => (
- <button key={id} role="radio" aria-checked={outfitModel === id} tabIndex={radioTab(outfitModel === id)} onClick={() => setOutfitModel(id)} className={cn("h-8 rounded-full border px-2.5 text-[12.5px] font-medium transition-colors", outfitModel === id ? "border-primary bg-brand-faint text-brand-text" : "text-muted-foreground hover:bg-accent")}>
- {label}
- </button>
- ))}
- </div>
- )}
+ <ModelChips label="Outfit model" ids={outfitModels} value={outfitModel} onChange={setOutfitModel} />
<RunLine preview={outfitBody && !s.outfit ? preview.data : undefined} loading={!s.outfit && preview.isFetching} />
<Button className="w-full" variant={s.outfitIds.length ? "outline" : "default"} onClick={startOutfit} disabled={outfit.isPending}>
{outfit.isPending ? <Loader2 className="animate-spin" /> : <Sparkles />} {outfit.isPending ? "Generating..." : "Generate outfit"}
@@ -272,6 +274,7 @@ export function FashionView() {
) : (
<div className="grid h-full min-h-48 place-items-center rounded-2xl border border-dashed p-6 text-center text-[13px] text-muted-foreground">Upload the outfit, then Generate outfit to dress your base shot.</div>
)}
+ {s.outfit && <ModelChips label="Photoset model" ids={setModels} value={setModel} onChange={setSetModel} />}
<Footer onBack={() => dispatch({ type: "back" })} line={s.outfit ? <RunLine preview={preview.data} loading={preview.isFetching} /> : undefined}>
<Button onClick={startSet} disabled={photoset.isPending}>
{photoset.isPending ? <Loader2 className="animate-spin" /> : null} {photoset.isPending ? "Generating..." : "Get your photoset"}
@@ -307,6 +310,20 @@ export function FashionView() {
);
}
+/** A step's model choice (shown when there is more than one): the Original first, partners after. */
+function ModelChips({ label, ids, value, onChange }: { label: string; ids: readonly string[]; value: string; onChange: (id: string) => void }) {
+ if (ids.length < 2) return null;
+ return (
+ <div role="radiogroup" aria-label={label} onKeyDown={radioKeys} className="flex flex-wrap gap-1">
+ {ids.map((id) => (
+ <button key={id} role="radio" aria-checked={value === id} tabIndex={radioTab(value === id)} onClick={() => onChange(id)} className={cn("h-8 rounded-full border px-2.5 text-[12.5px] font-medium transition-colors", value === id ? "border-primary bg-brand-faint text-brand-text" : "text-muted-foreground hover:bg-accent")}>
+ {MODEL_LABELS[id] ?? id}
+ </button>
+ ))}
+ </div>
+ );
+}
+
function Footer({ onBack, line, children }: { onBack: () => void; line?: React.ReactNode; children: React.ReactNode }) {
return (
<div className="sticky bottom-3 z-10 flex flex-wrap items-center justify-between gap-3 rounded-2xl border bg-background/95 p-3 shadow-normal backdrop-blur">
diff --git a/src/components/lora-settings.tsx b/src/components/lora-settings.tsx
index f0c63ccd..b8b46859 100644
--- a/src/components/lora-settings.tsx
+++ b/src/components/lora-settings.tsx
@@ -17,7 +17,7 @@ interface LibraryLora {
key: string;
name: string;
file: string;
- group: "look" | "motion" | "effect";
+ group: "look" | "motion" | "effect" | "adapter";
base: string;
/** One half of a Wan 2.2 pair: the high- or low-noise expert's file. */
target?: "high" | "low";
@@ -44,6 +44,8 @@ const GROUPS = [
{ value: "look", label: "Looks" },
{ value: "motion", label: "Motions" },
{ value: "effect", label: "Effects" },
+ // A recipe's own LoRA (Fuobe Try-On's try-on LoRA): the model loads it on every run.
+ { value: "adapter", label: "Adapters" },
] as const;
/** The base a LoRA was trained for, in a few words ("wan2.2-i2v-a14b" → "Wan 2.2"). */
@@ -56,6 +58,8 @@ function baseName(base: string): string {
[/^ltx-2\.5/, "LTX-2.5"],
[/^ltx-2-/, "LTX-2"],
[/^qwen-image-edit/, "Qwen-Image-Edit"],
+ [/^flux2-klein-4b/, "FLUX.2 [klein] 4B"],
+ [/^flux2-klein-9b/, "FLUX.2 [klein] 9B"],
];
return known.find(([re]) => re.test(base))?.[1] ?? base;
}
diff --git a/src/components/settings-form.tsx b/src/components/settings-form.tsx
index c4d8deaa..974b114c 100644
--- a/src/components/settings-form.tsx
+++ b/src/components/settings-form.tsx
@@ -336,8 +336,8 @@ export function SettingsForm({ prices }: { prices?: string }) {
<Section
id="loras"
- title="LoRAs · looks, motions and effects"
- description="Looks, camera moves and effects add LoRA files to open models, on your GPU and in the cloud. Fuobe fetches the pinned version a run needs and shows each file's licence; what may run where is your call in Models & licences."
+ title="LoRAs · looks, motions, effects and adapters"
+ description="Looks, camera moves and effects add LoRA files to open models, on your GPU and in the cloud; an adapter is the LoRA an Original always loads (Fuobe Try-On's). Fuobe fetches the pinned version a run needs and shows each file's licence; what may run where is your call in Models & licences."
>
<LoraSettings folder={get("comfyLorasDir")} civitaiKey={get("civitaiKey")} />
</Section>
diff --git a/src/lib/catalog/apps.ts b/src/lib/catalog/apps.ts
index 3175abf3..d136935e 100644
--- a/src/lib/catalog/apps.ts
+++ b/src/lib/catalog/apps.ts
@@ -421,13 +421,15 @@ export const APPS: Preset[] = [
},
// The Soul Cast sheet workflow: Z-Image Turbo draws the turnaround (front, three-quarter, profile, back) and
// cuts it into the four views, which make a better character element than one wide sheet.
+ // Fuobe Soul's own base: the casting look's words and LoRAs go on it too.
open: {
modelId: "oss-zimage-soul-cast",
op: "t2i",
+ look: CAST_LOOK,
promptTemplate: "An original character: {prompt}. The same face, hairstyle and outfit in every view, photorealistic, high detail.",
},
parity:
- "Save the sheet as a character (tile menu) to use it in any prompt with @. From your own photos or a Soul Cast build, use Character Sheet. Fuobe Soul draws it in the Realistic look; the open version draws the turnaround on Z-Image Turbo and cuts it into the four views",
+ "Save the sheet as a character (tile menu) to use it in any prompt with @. From your own photos or a Soul Cast build, use Character Sheet. Fuobe Soul draws it in the Realistic look; the open version draws the turnaround in the same look on Z-Image Turbo and cuts it into the four views",
}),
app({
name: "Match Lighting",
diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.ts
index 2d86aede..a083abef 100644
--- a/src/lib/catalog/cloud-models.generated.ts
+++ b/src/lib/catalog/cloud-models.generated.ts
@@ -1954,7 +1954,19 @@ export const CLOUD_MODELS: ModelDef[] = [
"21:9": "landscape_16_9",
"5:4": "landscape_4_3",
"4:5": "portrait_4_3"
- }
+ },
+ "accepts": [
+ "1:1",
+ "4:3",
+ "3:4",
+ "16:9",
+ "9:16",
+ "3:2",
+ "2:3",
+ "21:9",
+ "5:4",
+ "4:5"
+ ]
},
"loras": {
"shape": "items",
@@ -2010,7 +2022,8 @@ export const CLOUD_MODELS: ModelDef[] = [
"2:3",
"21:9",
"5:4",
- "4:5"
+ "4:5",
+ "auto"
],
"maxOutputs": 4,
"maxImages": 10
diff --git a/src/lib/catalog/packs.ts b/src/lib/catalog/packs.ts
index 7a38a91d..ad5501d5 100644
--- a/src/lib/catalog/packs.ts
+++ b/src/lib/catalog/packs.ts
@@ -588,14 +588,26 @@ export const getTemplate = (id: string) => FASHION.find((t) => t.id === id);
/**
* Fashion Factory's models per step (build plan O10): Fuobe Try-On (FLUX.2 [klein] 4B + the try-on LoRA) dresses the
- * base shot on both engines, FASHN and Nano Banana Pro stay as cloud choices; Qwen-Image-Edit 2511 makes the photoset.
+ * base shot on both engines, FASHN and Nano Banana Pro stay as cloud choices and Qwen-Image-Edit 2511 dresses it on your
+ * GPU when the try-on can't run; Qwen-Image-Edit 2511 makes the photoset, Nano Banana Pro a cloud choice.
*/
export const TRYON_MODEL = "fuobe-tryon";
export const FASHION_MODELS = {
- outfit: { cloud: [TRYON_MODEL, "fashn-tryon", "nano-banana-pro"], open: [TRYON_MODEL] },
+ outfit: { cloud: [TRYON_MODEL, "fashn-tryon", "nano-banana-pro"], open: [TRYON_MODEL, PHOTO_EDIT.open] },
photoset: { cloud: [PHOTO_EDIT.cloud, "nano-banana-pro"], open: [PHOTO_EDIT.open] },
} as const;
+/**
+ * A Fashion step's model: the one picked when it is one of the step's on this engine, else the first of them this
+ * install offers (caps.has: its switch, and a recipe LoRA it can't run without), else the first (its run then
+ * refuses, naming the switch to turn back on).
+ */
+export function fashionModel(step: keyof typeof FASHION_MODELS, engine: Engine, pick?: string, caps?: Pick<PlanCaps, "has">): string {
+ const list: readonly string[] = FASHION_MODELS[step][engine];
+ if (pick && list.includes(pick)) return pick;
+ return list.find((id) => !caps?.has || caps.has(id, engine)) ?? list[0];
+}
+
const element = (s: PhotoSubject) => (s.kind === "element" ? `@${s.handle}` : "the person in image 1");
/** Step 2: four base shots of the character in the template's set, 3:4. */
@@ -613,9 +625,9 @@ export function fashionBaseRequest(t: FashionTemplate, subject: Extract<PhotoSub
}
/** Step 4: the base shot wearing the uploaded outfit (try-on, or an edit that dresses them). */
-export function fashionOutfitRequest(t: FashionTemplate, base: string, garment: string, engine: Engine, modelId?: string): GenerationRequest {
- const id = engine === "cloud" && modelId && (FASHION_MODELS.outfit.cloud as readonly string[]).includes(modelId) ? modelId : TRYON_MODEL;
- const tryon = id !== "nano-banana-pro";
+export function fashionOutfitRequest(t: FashionTemplate, base: string, garment: string, engine: Engine, modelId?: string, caps?: Pick<PlanCaps, "has">): GenerationRequest {
+ const id = fashionModel("outfit", engine, modelId, caps);
+ const tryon = id === TRYON_MODEL || id === "fashn-tryon";
return {
feature: "fashion",
modelId: id,
@@ -632,8 +644,8 @@ export function fashionOutfitRequest(t: FashionTemplate, base: string, garment:
}
/** Step 5: one photo per template shot, from the dressed image (Qwen-Image-Edit 2511, or Nano Banana Pro when picked). */
-export function fashionPhotosetRequests(t: FashionTemplate, dressed: string, engine: Engine, pick?: string): GenerationRequest[] {
- const modelId = engine === "cloud" && pick && (FASHION_MODELS.photoset.cloud as readonly string[]).includes(pick) ? pick : PHOTO_EDIT[engine];
+export function fashionPhotosetRequests(t: FashionTemplate, dressed: string, engine: Engine, pick?: string, caps?: Pick<PlanCaps, "has">): GenerationRequest[] {
+ const modelId = fashionModel("photoset", engine, pick, caps);
const n = t.photoset.length;
return t.photoset.map((shot, i) => ({
feature: "fashion",
diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.ts
index 418dd2a8..3ae97ae3 100644
--- a/src/lib/catalog/plan.ts
+++ b/src/lib/catalog/plan.ts
@@ -187,7 +187,8 @@ export function planGeneration(
const found = req.presetId ? getPreset(req.presetId) : undefined;
const preset = !soul || found?.type === "app" ? found : undefined;
if (req.presetId && !soul && !preset) throw new Error(`Unknown preset ${req.presetId}`);
- const look = soul && preset ? presetRoute(preset, model.engine)?.look : req.presetId;
+ const routeLook = preset?.type === "app" ? presetRoute(preset, model.engine)?.look : undefined;
+ const look = soul && preset ? routeLook : req.presetId;
let prompt = req.prompt?.trim() ?? "";
let params: GenParams = { ...model.defaults, ...req.params };
@@ -263,6 +264,13 @@ export function planGeneration(
...(r.grade && { grade: r.grade }),
...(r.overlay && { overlay: r.overlay }),
};
+ } else if (routeLook) {
+ // An app whose graph is Fuobe Soul's own base (the AI Influencer app's Soul Cast sheet on your GPU) runs in its
+ // route's look too: the look's words and LoRAs, as the AI Influencer builder and Cinema's Soul Cast send them.
+ const r = soulRecipe("soul", prompt, { look: routeLook, userLoras: req.loras, characterStrength: charStrength });
+ prompt = r.prompt;
+ loras = r.loras;
+ notes.push(...r.notes);
} else if (req.loras?.length) {
// An @character's trained LoRA on FLUX, klein, Krea or any other model: at the character strength's scale, as on Soul.
const own = charStrength === undefined ? req.loras : req.loras.map((l) => ({ ...l, strength: characterScale(charStrength) }));
@@ -270,10 +278,11 @@ export function planGeneration(
}
// The words a model takes when none are given (Fuobe Try-On: its LoRA's own instruction).
if (!prompt && model.options.defaultPrompt) prompt = model.options.defaultPrompt;
- // A recipe's own LoRAs (Fuobe Try-On's try-on LoRA) go on every run after the others, their trigger words leading.
+ // A recipe's own LoRAs (Fuobe Try-On's try-on LoRA) go on every run, first (an API's LoRA cap leaves out yours
+ // before them), their trigger words leading.
const recipe = (model.options.loras ?? []).filter((l) => !loras.some((x) => x.file === l.file));
if (recipe.length) {
- loras = [...loras, ...recipe];
+ loras = [...recipe, ...loras];
const lead = recipe.map((l) => l.trigger?.trim()).filter((t): t is string => !!t && !prompt.startsWith(t));
if (lead.length && prompt) prompt = `${lead.join(", ")} ${prompt}`;
}
diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.ts
index 9771f7bf..86116b68 100644
--- a/src/lib/catalog/types.ts
+++ b/src/lib/catalog/types.ts
@@ -529,9 +529,10 @@ export interface ModelOptions {
/** The words a run takes when none are given (Fuobe Try-On: its try-on LoRA's own instruction). */
defaultPrompt?: string;
/**
- * LoRAs the model's recipe always loads (Fuobe Try-On's try-on LoRA): every run carries them after the user's own,
- * their trigger words leading the prompt. A ComfyUI graph that loads one itself isn't given it twice (injectLoras),
- * and a run is refused while Settings → Models & licences has one switched off.
+ * LoRAs the model's recipe always loads (Fuobe Try-On's try-on LoRA): every run carries them before the user's own
+ * (an API's LoRA cap leaves out the user's first), their trigger words leading the prompt. A ComfyUI graph that loads
+ * one itself isn't given it twice (injectLoras), and a run is refused while Settings → Models & licences has one
+ * switched off, or when the route leaves one out for any other reason.
*/
loras?: LoraRef[];
/** Max reference videos / audio clips it accepts (reference-to-video: inputs.videos / inputs.audios). */
@@ -1042,7 +1043,10 @@ export interface PresetRoute {
loras?: LoraRef[];
/** Overrides the preset prompt template for this engine. */
promptTemplate?: string;
- /** An app on Fuobe Soul: the look its words run in (the AI Influencer app: the Realistic look). */
+ /**
+ * An app on Fuobe Soul, or on a graph that is Soul's own base (the Soul Cast sheet on your GPU): the look its words
+ * run in, with the look's LoRAs (the AI Influencer app: the Realistic look).
+ */
look?: string;
/**
* A partner model running the preset's words because its Original has nothing of its own here yet (a Fuobe DoP move
diff --git a/src/lib/influencer.ts b/src/lib/influencer.ts
index a3be798f..acd01447 100644
--- a/src/lib/influencer.ts
+++ b/src/lib/influencer.ts
@@ -20,6 +20,7 @@ import {
type InfluencerTier,
} from "@/lib/catalog/influencer-options.generated";
import type { PlanCaps } from "@/lib/catalog/packs";
+import { CAST_LOOK } from "@/lib/catalog/soul-cards";
import type { ChainSlot, Engine, GenerationRequest } from "@/lib/catalog/types";
export { CONFLICT_MESSAGES, CREATURE_TYPES, INFLUENCER_CATEGORIES };
@@ -803,7 +804,7 @@ export const INFLUENCER_OPEN_MODELS = { sheet: "oss-zimage-soul-cast", edit: "os
/** Fuobe Soul's steps in the cloud: the sheet on its hosted half, your face and clothing on hosted Qwen-Image-Edit 2511. */
export const INFLUENCER_SOUL = { sheet: "fuobe-soul", edit: "qwen-image-edit-2511-cloud" } as const;
/** The look the sheet is drawn in (Soul Cast's casting look: natural, unretouched skin and fabric). */
-export const INFLUENCER_LOOK = "v1-realistic";
+export const INFLUENCER_LOOK = CAST_LOOK;
/** Qwen-Image-Edit 2511 takes three images on your GPU (the sheet, then the photo and clothing); fal takes more. */
const OPEN_EDIT_IMAGES = 3;
@@ -865,8 +866,10 @@ export function planInfluencer(run: InfluencerRun, caps: Pick<PlanCaps, "has">):
const notes: string[] = [];
const has = (id: string, engine?: Engine) => !caps.has || caps.has(id, engine);
const asked = run.modelId && (INFLUENCER_CLOUD_MODELS as readonly string[]).includes(run.modelId) ? run.modelId : undefined;
- // Fuobe Soul in the cloud unless another model is asked for (or this install switched Fuobe Soul off there).
- const cloudSoul = run.engine === "cloud" && (asked ?? INFLUENCER_SOUL.sheet) === INFLUENCER_SOUL.sheet && has(INFLUENCER_SOUL.sheet, "cloud") && has(INFLUENCER_SOUL.edit);
+ // Fuobe Soul in the cloud unless another model is asked for (or this install switched Fuobe Soul off there, or hosted
+ // Qwen-Image-Edit when your photo or clothing needs it).
+ const edits = !!photo || clothing.length > 0;
+ const cloudSoul = run.engine === "cloud" && (asked ?? INFLUENCER_SOUL.sheet) === INFLUENCER_SOUL.sheet && has(INFLUENCER_SOUL.sheet, "cloud") && (!edits || has(INFLUENCER_SOUL.edit));
if (run.engine === "open" || cloudSoul) {
const open = run.engine === "open";
@@ -887,7 +890,7 @@ export function planInfluencer(run: InfluencerRun, caps: Pick<PlanCaps, "has">):
title,
},
};
- if (!photo && !clothing.length) return { steps: [sheet], modelId: sheetModel, notes };
+ if (!edits) return { steps: [sheet], modelId: sheetModel, notes };
const room = (open ? OPEN_EDIT_IMAGES : 1 + 1 + MAX_CLOTHING) - 1 - (photo ? 1 : 0);
const used = clothing.slice(0, room);
if (clothing.length > used.length) notes.push(`Qwen-Image-Edit takes 3 images (the sheet${photo ? ", your photo" : ""} and clothing) — the first ${used.length === 1 ? "clothing reference is" : `${used.length} clothing references are`} used`);
@@ -912,7 +915,8 @@ export function planInfluencer(run: InfluencerRun, caps: Pick<PlanCaps, "has">):
op: "edit",
prompt: compileDressPrompt({ state, start, clothing: used.length }),
inputs: { images: [...(photo ? [photo] : []), ...used] },
- params: { numOutputs: 1 },
+ // The graph keeps image 1's shape on your GPU; in the cloud "auto" leaves the size out, so the sheet stays 16:9.
+ params: { numOutputs: 1, ...(!open && { aspectRatio: "auto" }) },
title,
step: { label: start === "face" ? "With your face" : start === "reference" ? "Matched to your reference" : "Dressed", index: 1, of: 2 },
},
diff --git a/src/server/generations.ts b/src/server/generations.ts
index 6a93c9f1..c3287181 100644
--- a/src/server/generations.ts
+++ b/src/server/generations.ts
@@ -541,6 +541,13 @@ function prepare(original: GenerationRequest) {
const reachable =
demo || !plan.soul ? { loras: asked, notes: [] } : withoutUnreachableCivitai(asked, route.provider === "comfyui" ? "comfyui" : route.provider === "replicate" ? "replicate" : "fal");
const fitted = fitLoras(reachable.loras, route);
+ // A LoRA the recipe can't run without that this route leaves out for any reason (its cap, a GPU-only licence, no
+ // cloud path): the model can't run here, rather than running without it.
+ const lost = demo ? undefined : plan.model.options.loras?.find((l) => asked.some((a) => a.file === l.file) && !fitted.loras.some((k) => k.file === l.file));
+ if (lost) {
+ const why = [...reachable.notes, ...fitted.notes].join("; ");
+ throw new Error(`${plan.model.name} runs with the LoRA “${loraName(lost)}”, which this run leaves out${why ? ` (${why})` : ""}. Pick another model or engine`);
+ }
// A Soul look's triggers lead the prompt: a LoRA left out takes its trigger with it.
const prompt = plan.soul ? promptWithLoras(plan.prompt, plan.soul.triggers, fitted.loras) : plan.prompt;
plan = { ...plan, prompt, loras: fitted.loras };
diff --git a/src/server/model-access.ts b/src/server/model-access.ts
index e64753b4..b4783d62 100644
--- a/src/server/model-access.ts
+++ b/src/server/model-access.ts
@@ -157,11 +157,25 @@ export function offeredRoutes(m: ModelDef, routes: ModelRoute[]): ModelRoute[] {
return on;
}
-/** Whether a model id is offered (an unknown id is not). */
+/**
+ * A LoRA the model's recipe can't run without (Fuobe Try-On's try-on LoRA, ModelOptions.loras) that Settings switches
+ * off (by file or licence class): the model is on, but a run of it is refused naming that LoRA.
+ */
+export function recipeLoraOff(m: Pick<ModelDef, "options">): LoraRef | undefined {
+ const loras = m.options.loras;
+ if (!loras?.length) return undefined;
+ const { dropped } = offeredLoras(loras);
+ return loras.find((l) => dropped.some((d) => d.file === l.file));
+}
+
+/**
+ * Whether a model id is offered (an unknown id is not): its switch and routes, and the LoRAs its recipe can't run
+ * without, so a studio's picker and its server-side default move on to the next model.
+ */
export function isOffered(id: string | undefined, engine?: Engine): boolean {
const m = id ? MODELS.find((x) => x.id === id) : undefined;
const view = m && offeredModel(m);
- return !!view && (!engine || !m!.engines || (view.engines ?? [view.engine]).includes(engine));
+ return !!view && !recipeLoraOff(m!) && (!engine || !m!.engines || (view.engines ?? [view.engine]).includes(engine));
}
/**
@@ -186,9 +200,14 @@ export function offeredDefault(id: string | undefined, engine: Engine): string |
return next?.id ?? id;
}
-/** The summary the browser filters its pickers with (undefined while everything is on). */
+/**
+ * The summary the browser filters its pickers with (undefined while everything is on). A model whose recipe LoRA is
+ * switched off counts as off there too (isOffered).
+ */
export function offeredSummary(): AccessSummary | undefined {
- return summarize(MODELS, readAccess(), factsOf);
+ const summary = summarize(MODELS, readAccess(), factsOf);
+ const blocked = MODELS.filter((m) => recipeLoraOff(m) && !summary?.off.includes(m.id)).map((m) => m.id);
+ return blocked.length ? { ...summary, off: [...(summary?.off ?? []), ...blocked] } : summary;
}
// ---------------------------------------------------------------------------
diff --git a/src/server/photodump.ts b/src/server/photodump.ts
index acb7a9d8..af6d4ab0 100644
--- a/src/server/photodump.ts
+++ b/src/server/photodump.ts
@@ -1,7 +1,8 @@
import "server-only";
import { nanoid } from "nanoid";
import { getModel, getPreset } from "@/lib/catalog";
-import { CAST_LOOK, castPrompt, SOUL_BUILDER_MODEL, type CastValues } from "@/lib/catalog/cinema";
+import { CAST_LOOK, CAST_SHEET_MODEL, castPrompt, SOUL_BUILDER_MODEL, type CastValues } from "@/lib/catalog/cinema";
+import { soulRecipe } from "@/lib/catalog/soul";
import {
castSheetModel,
customPack,
@@ -267,7 +268,7 @@ export function createPhotodump(input: PhotodumpRun) {
export type FashionRun =
| { step: "base"; templateId: string; elementId: string; engine: Engine }
| { step: "outfit"; templateId: string; base: string; garment: string; engine: Engine; modelId?: string }
- | { step: "photoset"; templateId: string; dressed: string; engine: Engine };
+ | { step: "photoset"; templateId: string; dressed: string; engine: Engine; modelId?: string };
function fashionRequests(input: FashionRun): { requests: GenerationRequest[]; title: string } {
const t = getTemplate(input.templateId);
@@ -278,8 +279,9 @@ function fashionRequests(input: FashionRun): { requests: GenerationRequest[]; ti
if (subject.kind !== "element") throw new Error("Pick or create a character first");
return { requests: [fashionBaseRequest(t, subject, engine, planCaps())], title: `${t.name} · ${subject.name}` };
}
- if (input.step === "outfit") return { requests: [fashionOutfitRequest(t, input.base, input.garment, engine, input.modelId)], title: `${t.name} · outfit` };
- return { requests: fashionPhotosetRequests(t, input.dressed, engine), title: `${t.name} · photoset` };
+ // A model switched off in Settings → Models & licences (or Fuobe Try-On with its try-on LoRA off) moves on to the next.
+ if (input.step === "outfit") return { requests: [fashionOutfitRequest(t, input.base, input.garment, engine, input.modelId, planCaps())], title: `${t.name} · outfit` };
+ return { requests: fashionPhotosetRequests(t, input.dressed, engine, input.modelId, planCaps()), title: `${t.name} · photoset` };
}
export function previewFashion(input: FashionRun) {
@@ -318,14 +320,17 @@ function sheetRequest(input: SheetRun): { request: GenerationRequest; notes: str
const m = getModel(modelId);
const aspect = m?.options.aspectRatios?.includes("16:9") ? "16:9" : undefined;
const resolution = m?.options.resolutions?.includes("2K") ? "2K" : m?.options.resolutions?.includes("1080p") ? "1080p" : undefined;
- // Fuobe Soul runs on both engines (the run's engine picks its half) and draws the cast in Cinema's casting look.
+ // Fuobe Soul runs on both engines (the run's engine picks its half) and draws the cast in Cinema's casting look; the
+ // Soul Cast sheet graph is Soul's own base, so the look's words and LoRAs go on it too (as Cinema's Soul Cast does).
const soul = modelId === SOUL_BUILDER_MODEL;
+ const sheet = modelId === CAST_SHEET_MODEL ? soulRecipe("soul", castPrompt(input.cast, input.details), { look: CAST_LOOK }) : undefined;
return {
request: {
feature: "character-sheet",
modelId,
...(soul && { engine, presetId: CAST_LOOK }),
- prompt: castPrompt(input.cast, input.details),
+ prompt: sheet?.prompt ?? castPrompt(input.cast, input.details),
+ ...(sheet?.loras.length && { loras: sheet.loras }),
params: { numOutputs: 1, ...(aspect && { aspectRatio: aspect }), ...(resolution && { resolution }) },
},
notes: modelId === "nano-banana-pro" ? ["Fuobe Soul is switched off in Settings → Models & licences — Nano Banana Pro draws the sheet"] : [],
diff --git a/tests/e2e/marketing-originals.mjs b/tests/e2e/marketing-originals.mjs
index 64b34dac..aeb1c271 100644
--- a/tests/e2e/marketing-originals.mjs
+++ b/tests/e2e/marketing-originals.mjs
@@ -1,8 +1,9 @@
// Build plan O10, browser check in demo mode: the Originals are the first choice on both engines and partners stay
// choices — Marketing Studio's model menu (Fuobe Marketing Image), Ads Studio's "Pictures by" (and its price line),
// the AI Influencer builder (Fuobe Soul), Photodump's model chips (Qwen-Image-Edit 2511 hosted), Fashion Factory's
-// outfit step (Fuobe Try-On) and the try-on LoRA's row in Settings → Models & licences. Then each page at 1440 and
-// 390 px, light and dark, without sideways scroll.
+// outfit and photoset steps (Fuobe Try-On, Qwen-Image-Edit 2511; the next model when the try-on LoRA is switched off)
+// and the try-on LoRA's row in Settings → Models & licences. Then each page at 1440 and 390 px, light and dark, without
+// sideways scroll.
// Usage: node tests/e2e/marketing-originals.mjs [appUrl] [--shots <dir>] (app in demo mode, ComfyUI unreachable).
// Exits 1 on a failed check.
import fs from "node:fs";
@@ -27,8 +28,8 @@ async function upload(file, type, name) {
if (!res.ok) throw new Error(`upload failed: ${res.status}`);
return (await res.json()).url;
}
-const post = async (url, body) => {
- const res = await fetch(`${app}${url}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
+const post = async (url, body, method = "POST") => {
+ const res = await fetch(`${app}${url}`, { method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
if (!res.ok) throw new Error(`${url}: ${res.status} ${await res.text()}`);
return res.json();
};
@@ -60,7 +61,8 @@ try {
};
const text = (page) => page.evaluate(() => document.body.innerText);
const noSideways = (page) => page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1);
- const fashionAt = { step: "clothing", templateId: "red-room", elementId: character.id, baseIds: [], base: productImage, outfitIds: [] };
+ const fashionAt = { step: "clothing", templateId: "red-room", elementId: character.id, baseIds: [], base: productImage, outfitIds: [], outfit: productImage };
+ const radios = (page, name) => page.getByRole("radiogroup", { name }).getByRole("radio").allInnerTexts();
// ---------------------------------------------------------------------------
// The flows, once per engine (1440 light).
@@ -120,16 +122,42 @@ try {
// Fashion Factory: the outfit step.
await page.goto(`${app}/fashion-factory`, { waitUntil: "load" });
await page.getByRole("heading", { name: "Upload outfit" }).waitFor();
+ await page.getByRole("radiogroup", { name: "Outfit model" }).waitFor();
+ const outfit = await radios(page, "Outfit model");
+ const on = await page.getByRole("radio", { name: "Fuobe Try-On" }).getAttribute("aria-checked");
if (engine === "cloud") {
- const outfit = await page.getByRole("radiogroup", { name: "Outfit model" }).getByRole("radio").allInnerTexts();
- const on = await page.getByRole("radio", { name: "Fuobe Try-On" }).getAttribute("aria-checked");
check("cloud: Fashion Factory's outfit runs on Fuobe Try-On, FASHN and Nano Banana Pro after it", outfit[0] === "Fuobe Try-On" && on === "true" && outfit.includes("FASHN Try-On"), outfit.join(" | "));
+ const set = await radios(page, "Photoset model");
+ check("cloud: the photoset runs on Qwen-Image-Edit 2511, Nano Banana Pro a choice", set[0] === "Qwen-Image-Edit 2511" && set.includes("Nano Banana Pro"), set.join(" | "));
} else {
- check("open: no outfit model menu on your GPU", !(await page.getByRole("radiogroup", { name: "Outfit model" }).count()));
+ check("open: the outfit runs on Fuobe Try-On, Qwen-Image-Edit 2511 after it", outfit[0] === "Fuobe Try-On" && on === "true" && outfit.includes("Qwen-Image-Edit 2511"), outfit.join(" | "));
+ check("open: one photoset model on your GPU, no menu", !(await page.getByRole("radiogroup", { name: "Photoset model" }).count()));
}
await context.close();
}
+ // The try-on LoRA switched off: Fuobe Try-On can't run, so the outfit step starts on the next model on each engine.
+ await post("/api/settings/models", { changes: [{ kind: "lora", id: "tryon-klein-4b.safetensors", on: false }] }, "PUT");
+ try {
+ for (const engine of engines) {
+ const { context, page } = await contextFor(engine, { width: 1440, height: 900 }, "light", fashionAt);
+ await page.goto(`${app}/fashion-factory`, { waitUntil: "load" });
+ await page.getByRole("heading", { name: "Upload outfit" }).waitFor();
+ await page.waitForFunction(() => !/Fuobe Try-On/.test(document.querySelector('[role="radiogroup"][aria-label="Outfit model"]')?.textContent ?? "Fuobe Try-On"), null, { timeout: 30_000 }).catch(() => {});
+ const outfit = (await page.getByRole("radiogroup", { name: "Outfit model" }).count()) ? await radios(page, "Outfit model") : [];
+ const want = engine === "cloud" ? "FASHN Try-On" : "Qwen-Image-Edit 2511";
+ const picked = outfit.length ? await page.getByRole("radio", { name: want }).getAttribute("aria-checked") : null;
+ // On your GPU Qwen-Image-Edit is then the only outfit model: no menu.
+ check(`${engine}: with the try-on LoRA off the outfit menu starts on ${want}`, engine === "cloud" ? !outfit.includes("Fuobe Try-On") && picked === "true" : !outfit.length, outfit.join(" | "));
+ // The server's default moves on the same way (a request that names no model).
+ const priced = await post("/api/photodump/fashion?preview=1", { step: "outfit", templateId: "red-room", base: productImage, garment: productImage, engine });
+ check(`${engine}: and the outfit step's default runs on ${want}`, priced.modelId === (engine === "cloud" ? "fashn-tryon" : "oss-qwen-edit"), priced.modelId ?? priced.error);
+ await context.close();
+ }
+ } finally {
+ await post("/api/settings/models", { changes: [{ kind: "lora", id: "tryon-klein-4b.safetensors", on: true }] }, "PUT").catch(() => {});
+ }
+
// Settings → Models & licences: the try-on LoRA, its licence and its switch.
{
const { context, page } = await contextFor("cloud", { width: 1440, height: 900 }, "light");
@@ -143,6 +171,12 @@ try {
const lora = await text(page);
check("Settings lists the try-on LoRA with its Apache-2.0 licence", /Virtual Try-On for FLUX\.2 \[klein\] 4B \(xocialize\)/.test(lora) && /Apache-2\.0/.test(lora));
check("the try-on LoRA has its switch", (await page.getByRole("switch").count()) > 0);
+ // Settings → LoRAs: the adapter's download and mirror status, under its own kind.
+ await page.goto(`${app}/settings#loras`, { waitUntil: "load" });
+ await page.getByRole("button", { name: /LoRA library/ }).click();
+ await page.getByRole("radio", { name: "Adapters" }).click();
+ await page.getByText("Virtual Try-On for FLUX.2 [klein] 4B (xocialize)").first().waitFor({ timeout: 30_000 }).catch(() => {});
+ check("Settings → LoRAs lists the try-on LoRA under Adapters", /Virtual Try-On for FLUX\.2 \[klein\] 4B \(xocialize\)/.test(await text(page)) && /FLUX\.2 \[klein\] 4B/.test(await text(page)));
await context.close();
}
diff --git a/tests/image-studios-api.test.ts b/tests/image-studios-api.test.ts
index 8467c7b6..196a27a2 100644
--- a/tests/image-studios-api.test.ts
+++ b/tests/image-studios-api.test.ts
@@ -348,6 +348,9 @@ describe("photodump, fashion factory and character sheet runs", () => {
const cast = await (await characterRoute.POST(json("POST", { mode: "cast", engine: "open", cast: { genre: "Western", gender: "Female", age: 30, archetype: "Rebel" } }))).json();
expect(cast.items[0].modelId).toBe("oss-zimage-soul-cast");
expect(cast.items[0].prompt).toMatch(/30-year-old woman, the rebel archetype/);
+ // The Soul Cast sheet graph is Fuobe Soul's own base: the casting look's words and LoRAs go on it (as in Cinema).
+ expect(cast.items[0].prompt).toMatch(/^Realism, /);
+ expect(cast.items[0].request.loras.map((l: { file: string }) => l.file)).toEqual(["suayptalha-z-image-turbo-realism.safetensors", "AWPortrait-Z.safetensors"]);
// In the cloud the cast sheet is Fuobe Soul's, in Cinema's casting look.
const soul = await (await characterRoute.POST(json("POST", { mode: "cast", engine: "cloud", cast: { genre: "Drama" } }))).json();
expect(soul.items[0]).toMatchObject({ modelId: "fuobe-soul", engine: "cloud", presetId: "v1-realistic" });
@@ -358,5 +361,7 @@ describe("photodump, fashion factory and character sheet runs", () => {
expect(described.items[0]).toMatchObject({ presetId: "app-ai-influencer", modelId: "fuobe-soul", engine: "cloud", feature: "app:app-ai-influencer", status: "queued" });
const app = await (await characterRoute.POST(json("POST", { mode: "describe", engine: "open", prompt: "a surfer from Lisbon" }))).json();
expect(app.items[0]).toMatchObject({ presetId: "app-ai-influencer", modelId: "oss-zimage-soul-cast", feature: "app:app-ai-influencer" });
+ // …and on your GPU the app's sheet runs in the same look.
+ expect(app.items[0].prompt).toMatch(/^Realism, An original character: a surfer from Lisbon/);
});
});
diff --git a/tests/model-access-listings.test.ts b/tests/model-access-listings.test.ts
index 9c1b4f9d..dc55914d 100644
--- a/tests/model-access-listings.test.ts
+++ b/tests/model-access-listings.test.ts
@@ -94,9 +94,10 @@ describe("Models & licences in listings and picks", () => {
it("lists every model, LoRA and node pack with its licence, and flips switches through the settings API", async () => {
const list = (await (await settingsRoute.GET()).json()) as import("@/lib/model-access").AccessList;
expect(list.models.length).toBeGreaterThan(300);
- // The library's 114 LoRAs, the preset LoRA map's files that aren't library files, and MiniMax H3's four (Akatz Labs'
- // swap LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), each once.
- expect(list.loras.length).toBe(170);
+ // The library's 115 LoRAs (Fuobe Try-On's try-on LoRA among them), the preset LoRA map's files that aren't library
+ // files, and MiniMax H3's four (Akatz Labs' swap LoRA V1.5 and V1 and Person Remover V1, lightx2v's H3 Turbo), each once.
+ expect(list.loras.length).toBe(171);
+ expect(list.loras.find((l) => l.file === "tryon-klein-4b.safetensors")).toMatchObject({ group: "adapter", on: true, licence: { name: "Apache-2.0", class: "commercial" } });
expect(list.loras.find((l) => l.file === "h3_character_swap_v1.5.safetensors")).toMatchObject({ group: "adapter", base: "MiniMax H3", on: true, licence: { name: "MiniMax H3 Community License", class: "regions" } });
expect(list.packs.find((p) => p.name === "h3_character_swap")).toMatchObject({ licence: { name: "GPL-3.0" }, on: true });
expect(new Set(list.loras.map((l) => l.file)).size).toBe(list.loras.length);
diff --git a/tests/originals-marketing.test.ts b/tests/originals-marketing.test.ts
index 7b74aa93..1e3bbff8 100644
--- a/tests/originals-marketing.test.ts
+++ b/tests/originals-marketing.test.ts
@@ -148,7 +148,7 @@ describe("Fuobe Try-On and its LoRA", () => {
});
it("is Fashion Factory's outfit model on both engines, with Qwen-Image-Edit 2511 making the photoset", () => {
- expect(FASHION_MODELS.outfit.open).toEqual([TRYON_MODEL]);
+ expect(FASHION_MODELS.outfit.open[0]).toBe(TRYON_MODEL);
expect(FASHION_MODELS.outfit.cloud[0]).toBe(TRYON_MODEL);
expect(FASHION_MODELS.photoset).toEqual({ cloud: ["qwen-image-edit-2511-cloud", "nano-banana-pro"], open: ["oss-qwen-edit"] });
expect(PHOTODUMP_MODELS.cloud).toEqual(["fuobe-soul", "qwen-image-edit-2511-cloud", "nano-banana-pro", "seedream-5-pro"]);
@@ -178,3 +178,180 @@ describe("the AI Influencer app on Fuobe Soul", () => {
expect(p).toMatchObject({ engine: "cloud", demo: true });
});
});
+
+// ---------------------------------------------------------------------------
+// After review (O10 fix): the studio's engine, the sheet's shape, the recipe LoRA, Fashion's fallbacks, the eval case.
+
+const { planMarketing, estimatePlan, onPlanEngine } = await import("@/server/marketing");
+const { planInfluencer, INFLUENCER_SOUL } = await import("@/lib/influencer");
+const { buildPayload } = await import("@/lib/catalog/payload");
+const { fashionModel, fashionOutfitRequest, fashionPhotosetRequests, getTemplate } = await import("@/lib/catalog/packs");
+const { isOffered, offeredSummary } = await import("@/server/model-access");
+const { previewFashion, previewSheet } = await import("@/server/photodump");
+
+const PRODUCT = { id: "p1", brandId: null, name: "Maple Granola", sellingPoints: [], images: ["/api/files/product.png"], createdAt: 0, updatedAt: 0 };
+/** fal connected and ComfyUI reachable or not: an Original that names no engine would run on whichever is ready first. */
+function connected(comfy: boolean) {
+ setSetting("falKey", "fal_test_key_123456");
+ globalThis.__fuobeComfyReach = { ok: comfy, at: Date.now(), url: "http://127.0.0.1:9" };
+ return () => {
+ setSetting("falKey", "");
+ globalThis.__fuobeComfyReach = undefined;
+ };
+}
+
+describe("Marketing Studio runs Fuobe Marketing Image on the studio's engine", () => {
+ it("names the engine on the image step, so the GPU run isn't billed on fal and the cloud run doesn't land on ComfyUI", () => {
+ const open = planMarketing({ engine: "open", format: "product-standalone", templateId: "ps-ice-bath" }, { product: PRODUCT });
+ const cloud = planMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline" }, { product: PRODUCT });
+ expect(open.steps[0].request).toMatchObject({ modelId: MARKETING_IMAGE_MODEL, engine: "open", params: { extra: { productShot: true } } });
+ expect(cloud.steps[0].request).toMatchObject({ modelId: MARKETING_IMAGE_MODEL, engine: "cloud" });
+ // A partner model runs on its own engine: no engine named.
+ expect(planMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline", modelId: "gpt-image-2-5" }, { product: PRODUCT }).steps[0].request.engine).toBeUndefined();
+
+ // ComfyUI down, fal connected: the open run stays on the GPU side (free, a demo here), never fal's $0.03.
+ let off = connected(false);
+ try {
+ const p = previewGeneration(open.steps[0].request);
+ expect(p).toMatchObject({ engine: "open", costUsd: 0 });
+ expect(estimatePlan(open).costUsd).toBe(0);
+ } finally {
+ off();
+ }
+ // ComfyUI up, fal connected: the cloud run goes to fal, without the GPU-only product-shot flag.
+ off = connected(true);
+ try {
+ const p = previewGeneration(cloud.steps[0].request);
+ expect(p).toMatchObject({ engine: "cloud", demo: false, route: { provider: "fal", endpoint: "fal-ai/qwen-image-edit-2511" } });
+ expect(p.costUsd).toBeGreaterThan(0);
+ } finally {
+ off();
+ }
+ });
+
+ it("pins every step of a plan that names no engine to the run's engine (estimates, launches, Run again, Assist)", () => {
+ const base = planMarketing({ engine: "open", format: "poster", prompt: "Autumn" }, { product: null });
+ const bare = { ...base.steps[0].request };
+ delete bare.engine;
+ const plan = { ...base, steps: [{ ...base.steps[0], request: bare }] };
+ expect(onPlanEngine(plan).steps[0].request.engine).toBe("open");
+ // A partner step, or one that already names its engine, is left as it is.
+ expect(onPlanEngine(base)).toBe(base);
+ const gpt = planMarketing({ engine: "cloud", format: "ads", templateId: "ad-hero-headline", modelId: "gpt-image-2-5" }, { product: PRODUCT });
+ expect(onPlanEngine(gpt).steps[0].request.engine).toBeUndefined();
+ });
+});
+
+describe("the AI Influencer sheet keeps its shape in the cloud", () => {
+ const state = { tier: "normal" as const, picks: {}, locked: [] };
+
+ it("asks hosted Qwen-Image-Edit for the input's shape, so fal and Replicate keep the 16:9 sheet's size", () => {
+ const p = planInfluencer({ engine: "cloud", state, start: "face", photo: "/api/files/me.png" }, { has: () => true });
+ const dress = p.steps.find((s) => s.key === "dress")!.request;
+ expect(dress).toMatchObject({ modelId: INFLUENCER_SOUL.edit, params: { aspectRatio: "auto" } });
+ const planned = plan({ ...dress, inputs: { images: ["/sheet.png", "/me.png"] } }, "cloud");
+ const [fal, replicate] = getModel(INFLUENCER_SOUL.edit)!.routes;
+ const input = { prompt: planned.prompt, images: ["/sheet.png", "/me.png"], ...planned.params };
+ expect(buildPayload(fal.map!, input)).not.toHaveProperty("image_size");
+ expect(buildPayload(replicate.map!, input)).not.toHaveProperty("aspect_ratio");
+ // A shape asked for is still sent, and the model's own default stays square.
+ expect(buildPayload(fal.map!, { ...input, aspectRatio: "16:9" })).toMatchObject({ image_size: "landscape_16_9" });
+ expect(getModel(INFLUENCER_SOUL.edit)!.defaults).toMatchObject({ aspectRatio: "1:1" });
+ expect(getModel(INFLUENCER_SOUL.edit)!.options.aspectRatios).toContain("auto");
+ // On the GPU the graph keeps image 1's shape itself.
+ expect(planInfluencer({ engine: "open", state, start: "face", photo: "/api/files/me.png" }, { has: () => true }).steps[1].request.params).toEqual({ numOutputs: 1 });
+ });
+
+ it("needs hosted Qwen-Image-Edit only when there is a face or clothing to put on the sheet", () => {
+ const noEdit = { has: (id: string) => id !== INFLUENCER_SOUL.edit };
+ const scratch = planInfluencer({ engine: "cloud", state, start: "scratch" }, noEdit);
+ expect(scratch).toMatchObject({ modelId: "fuobe-soul", notes: [] });
+ const face = planInfluencer({ engine: "cloud", state, start: "face", photo: "/api/files/me.png" }, noEdit);
+ expect(face.modelId).toBe("nano-banana-pro");
+ expect(face.notes[0]).toMatch(/Qwen-Image-Edit 2511 \(hosted\) is switched off/);
+ });
+});
+
+describe("Fuobe Try-On's LoRA is never left out of a run", () => {
+ const req = { feature: "image", modelId: TRYON_MODEL, engine: "cloud" as const, op: "edit" as const, inputs: { images: ["/api/files/me.png", "/api/files/dress.png"] } };
+ const mine = (n: number) => Array.from({ length: n }, (_, i) => ({ file: `mine-${i}.safetensors`, url: `https://huggingface.co/me/l/resolve/main/mine-${i}.safetensors`, strength: 1 }));
+
+ it("goes first, so fal's three-LoRA cap leaves out one of yours", () => {
+ const p = previewGeneration({ ...req, loras: mine(3) });
+ expect(p.loras.applied.map((l) => l.file)).toEqual([TRYON_FILE, "mine-0.safetensors", "mine-1.safetensors"]);
+ expect(p.loras.dropped.map((d) => d.file)).toEqual(["mine-2.safetensors"]);
+ expect(p.prompt).toMatch(/^TRYON /);
+ });
+
+ it("refuses a run whose route would leave it out (a copy named without a link can't reach fal)", () => {
+ const off = connected(false);
+ try {
+ expect(() => previewGeneration({ ...req, loras: [{ file: TRYON_FILE, strength: 1 }] })).toThrow(/Fuobe Try-On runs with the LoRA “.*”, which this run leaves out \(.*only on your ComfyUI/);
+ // With its link it goes, first.
+ expect(previewGeneration({ ...req, loras: mine(3) }).loras.applied[0].file).toBe(TRYON_FILE);
+ } finally {
+ off();
+ }
+ // On the GPU the graph has it.
+ expect(previewGeneration({ ...req, engine: "open", loras: [{ file: TRYON_FILE, strength: 1 }] }).engine).toBe("open");
+ });
+});
+
+describe("Fashion Factory moves on when a model can't run", () => {
+ const t = getTemplate("red-room")!;
+
+ it("offers Qwen-Image-Edit 2511 after Fuobe Try-On on your GPU and takes the photoset's pick", () => {
+ expect(FASHION_MODELS.outfit.open).toEqual([TRYON_MODEL, "oss-qwen-edit"]);
+ const qwen = fashionOutfitRequest(t, "/b.png", "/g.png", "open", "oss-qwen-edit");
+ expect(qwen).toMatchObject({ modelId: "oss-qwen-edit", params: { aspectRatio: "3:4" } });
+ expect(qwen.prompt).toMatch(/^Dress the person in image 1/);
+ expect(fashionPhotosetRequests(t, "/d.png", "cloud", "nano-banana-pro")[0].modelId).toBe("nano-banana-pro");
+ expect(fashionModel("photoset", "open", "nano-banana-pro")).toBe("oss-qwen-edit");
+ const set = previewFashion({ step: "photoset", templateId: t.id, dressed: "/api/files/d.png", engine: "cloud", modelId: "nano-banana-pro" });
+ expect(set).toMatchObject({ modelId: "nano-banana-pro" });
+ });
+
+ it("drops Fuobe Try-On from the pickers and the defaults while its try-on LoRA is switched off", () => {
+ expect(isOffered(TRYON_MODEL, "cloud")).toBe(true);
+ changeAccess([{ kind: "lora", id: TRYON_FILE, on: false }]);
+ expect(isOffered(TRYON_MODEL, "cloud")).toBe(false);
+ expect(isOffered(TRYON_MODEL, "open")).toBe(false);
+ expect(isOffered("oss-tryon-klein")).toBe(false);
+ expect(offeredSummary()?.off).toEqual(expect.arrayContaining([TRYON_MODEL, "oss-tryon-klein"]));
+ const base = { step: "outfit" as const, templateId: t.id, base: "/api/files/b.png", garment: "/api/files/g.png" };
+ expect(previewFashion({ ...base, engine: "cloud" })).toMatchObject({ modelId: "fashn-tryon" });
+ expect(previewFashion({ ...base, engine: "open" })).toMatchObject({ modelId: "oss-qwen-edit" });
+ // Picked anyway (the API): refused, naming the LoRA's switch.
+ expect(previewFashion({ ...base, engine: "cloud", modelId: TRYON_MODEL })).toMatchObject({ error: expect.stringMatching(/switched off in Settings → Models & licences/) });
+ });
+
+ it("makes the photoset on Nano Banana Pro when hosted Qwen-Image-Edit is switched off", () => {
+ changeAccess([{ kind: "model", id: "qwen-image-edit-2511-cloud", on: false }]);
+ expect(previewFashion({ step: "photoset", templateId: t.id, dressed: "/api/files/d.png", engine: "cloud" })).toMatchObject({ modelId: "nano-banana-pro" });
+ });
+});
+
+describe("the AI Influencer app and Character Sheet run the casting look on your GPU too", () => {
+ it("puts the Realistic look's words and LoRAs on the Soul Cast sheet graph", () => {
+ const app = getPreset("app-ai-influencer")!;
+ expect(app.open).toMatchObject({ modelId: "oss-zimage-soul-cast", look: CAST_LOOK });
+ const p = plan({ feature: "app:app-ai-influencer", presetId: app.id, modelId: "oss-zimage-soul-cast", prompt: "a surfer from Lisbon" }, "open");
+ expect(p.prompt).toMatch(/^Realism, An original character: a surfer from Lisbon/);
+ expect(p.loras.map((l) => l.file)).toEqual(["suayptalha-z-image-turbo-realism.safetensors", "AWPortrait-Z.safetensors"]);
+ expect(p.soul).toBeUndefined();
+ // Character Sheet's Soul Cast form on your GPU: priced on the sheet graph (its request is checked in image-studios-api).
+ expect(previewSheet({ mode: "cast", engine: "open", cast: { gender: "Female", age: 30 } })).toMatchObject({ modelId: "oss-zimage-soul-cast", costUsd: 0 });
+ });
+});
+
+describe("the marketing eval suite", () => {
+ it("sends the product-shot flag only where ComfyUI reads it", () => {
+ const suite = JSON.parse(fs.readFileSync(path.join(process.cwd(), "scripts/eval/cases/marketing.json"), "utf8"));
+ for (const c of suite.cases) {
+ if (!JSON.stringify(c.params ?? {}).includes("productShot")) continue;
+ expect(c.engines, c.id).toEqual(["open", "demo"]);
+ }
+ const cloud = suite.cases.find((c: { id: string }) => c.id === "marketing/product-plinth-cloud");
+ expect(cloud).toMatchObject({ engines: ["cloud"], params: { aspectRatio: "3:4" }, variantModels: { partner: { cloud: ["gpt-image-2-5"] } } });
+ });
+});