Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Simplify character sheet prompts

Bittib8526d6f90a1
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index d723df2..898261c 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -38,7 +38,7 @@ This alpha update adds LAN generation workers, Linux support, expanded color gra
- LAN workers select weight downloads using their own GPU type and VRAM, even when a different variant is already downloaded on the client.
- Continue preserves the full joined video and audio from Slopfab. Adjacent source and continuation scenes use that shared decode in preview and export, preserving context across the cut. Regenerate older Continue scenes to apply the fix.
- The timeline playhead follows playback without waiting for editor updates.
-- Character sheets give side and back views explicit orientation instructions, keeping reference identity and clothing without copying the front-facing pose.
+- Character sheet prompts focus on each view's essential framing and orientation, with concise instructions for consistent identity and clothing.
- Extend bounding box edges gently snap to nearby original image borders when drawing, moving or resizing. Box dimensions use 32-pixel increments and stay within the maximum generation resolution.
- Extend uses the placed original in its inpainting canvas without a separately resized copy as a reference, preventing a duplicate scene beneath the preserved image. New areas regenerate through the outer edges.
- Removing a reference from a scene's last prompt citation now removes it from generation inputs and “Used by.” References selected as frame or motion inputs remain active.
diff --git a/src/lib/characterSheet.test.ts b/src/lib/characterSheet.test.ts
index f71ab29..36c08a6 100644
--- a/src/lib/characterSheet.test.ts
+++ b/src/lib/characterSheet.test.ts
@@ -64,19 +64,15 @@ it.each([false, true])("uses a shared front-view outfit with square portrait and
expect(request.canvasHeight).toBe(1024);
if (index > 0) {
expect(invoke).toHaveBeenCalledWith("save_character_sheet_view", { folderPath: "C:/Character", sheetId: id, jobId: `${id}-view-2`, index: 1 });
- expect(request.prompt).toContain("<Picture 2> is the full body front view of this same character and the fixed wardrobe reference");
- expect(request.prompt).toContain("Do not add, remove, replace, restyle or recolor any clothing");
+ expect(request.prompt).toContain("match the outfit in <Picture 2> from the requested angle");
}
expect(request.imageEdit).toBeUndefined();
- expect(request.prompt).toContain(["frontal upper-body shot framed from the waist up", "full body front view", "full body side view", "full body back view"][viewIndex]);
- expect(request.prompt).toContain("clothing, footwear, accessories");
+ expect(request.prompt).toContain(["Waist-up front view", "Full body front view", "Full body side view", "Full body back view"][viewIndex]);
+ expect(request.prompt).toContain("Keep the same character and visual style");
expect(request.prompt).toContain("<Picture 1>");
expect(request.prompt).toContain("<Subject 1> (appears in [Shot 1]): partially_preserved");
if (viewIndex === 3) {
- expect(request.prompt).toContain("The camera is directly behind the character");
- expect(request.prompt).toContain("The face, eyes and front of the chest are hidden");
- expect(request.prompt).toContain("Rotate the character 180 degrees from the wardrobe reference");
- expect(request.prompt).not.toContain("requested side or back view");
+ expect(request.prompt).toContain("head and body facing away, face hidden");
}
expect(request.prompt).not.toContain("A still photograph");
expect(session.getSnapshot().config.assets).toEqual(original.assets);
@@ -133,7 +129,7 @@ it("rejects unsupported sheet heights before queueing generation", () => {
expect(queue.getSnapshot()).toHaveLength(0);
});
-it("keeps the required rear orientation after template instructions and in reference retention", () => {
+it("keeps the required view after template instructions without repeating orientation details", () => {
const { session } = setup();
const config = session.getSnapshot().config;
const snapshot = structuredClone(config);
@@ -143,16 +139,11 @@ it("keeps the required rear orientation after template instructions and in refer
const back = views[3].prompt;
const retention = back.split("retention_analysis:\n")[1].split("\n\ndetailed_description:")[0];
expect(retention).toContain("partially_preserved");
- expect(retention).toContain("replace the reference pose, gaze, camera angle and framing");
- expect(retention).toContain("A full body back view");
+ expect(retention).toContain("use the requested outfit and view");
expect(retention).not.toContain("fully_preserved");
const afterTemplate = back.slice(back.indexOf("Template instructions:"));
- expect(afterTemplate).toContain("takes precedence over reference poses and template pose or framing instructions");
- expect(afterTemplate).toContain("The face, eyes and front of the chest are hidden");
- expect(back).toContain("without moving front closures or front graphics onto its back");
- expect(back).not.toContain("Retain the same facial features wherever visible");
- expect(views[2].prompt).toContain("head, shoulders, torso, hips and feet all face left");
- expect(views[1].prompt).toContain("Retain the same facial features wherever visible");
+ expect(afterTemplate).toContain("Required view: Full body back view, head and body facing away, face hidden");
+ expect(views[2].prompt).toContain("head and body in left-facing profile");
expect(config).toEqual(snapshot);
});
@@ -244,7 +235,7 @@ it("conditions every view on prompt references and freezes the requested outfit
expect(request.prompt).not.toContain("@[ref:");
expect(request.prompt).not.toContain("Changed after execution");
expect(request.prompt).toContain(`<Subject 2> is Red coat, providing appearance from <Picture ${index === 0 ? 2 : 3}>`);
- if (index === 0) expect(request.prompt).toContain("Apply the template's clothing instructions and references to establish the outfit");
+ if (index === 0) expect(request.prompt).toContain("Keep the outfit from <Picture 1> unless the template instructions change it");
emit("framesReady", request.jobId);
}
await waitFor(() => expect(queue.getSnapshot()[0].status).toBe("completed"));
diff --git a/src/lib/characterSheet.ts b/src/lib/characterSheet.ts
index a9995f8..3b62d52 100644
--- a/src/lib/characterSheet.ts
+++ b/src/lib/characterSheet.ts
@@ -4,10 +4,10 @@ import { outputDimensions } from "./export";
import type { ProjectAsset, ProjectConfig, ProjectReference } from "./project";
export const CHARACTER_SHEET_VIEWS = [
- { label: "Upper body front", description: "A frontal upper-body shot framed from the waist up, looking straight at the camera. Include the entire head, both shoulders, arms and torso down to the waist, clearly showing the upper-body clothing. Do not crop tightly around the face or shoulders." },
- { label: "Full body front", description: "A full body front view, facing directly toward the camera, standing in a neutral pose. Show the entire figure from head to feet without cropping." },
- { label: "Full body side", description: "A full body side view, in strict left-facing profile, standing in a neutral pose. The head, shoulders, torso, hips and feet all face left, perpendicular to the camera. Show only the profile, with no turn toward the camera or three-quarter angle. Show the entire figure from head to feet without cropping." },
- { label: "Full body back", description: "A full body back view, facing directly away from the camera, standing in a neutral pose. The camera is directly behind the character: show the back of the head, back of the shoulders and outfit, and the heels. The head, torso, hips and feet all face away together. The face, eyes and front of the chest are hidden. No head turn, over-the-shoulder look, profile or three-quarter angle. Show the entire figure from head to feet without cropping." },
+ { label: "Upper body front", description: "Waist-up front view, facing the camera, entire head visible." },
+ { label: "Full body front", description: "Full body front view, facing the camera, neutral standing pose, head to feet visible." },
+ { label: "Full body side", description: "Full body side view, head and body in left-facing profile, neutral standing pose, head to feet visible." },
+ { label: "Full body back", description: "Full body back view, head and body facing away, face hidden, neutral standing pose, head to feet visible." },
] as const;
// Establish the complete outfit before asking for any other camera angle.
@@ -32,25 +32,23 @@ export function compileCharacterSheet(config: ProjectConfig, source: ProjectAsse
while (config.references.some((reference) => reference.id === sourceReferenceId)) sourceReferenceId += "-source";
const reference: ProjectReference = {
id: sourceReferenceId, kind: "text", name: source.name,
- description: "The character in the source image. Preserve the exact identity, body proportions, skin tone, hairstyle and hair color. Preserve clothing, footwear, accessories, materials and colors unless the template instructions explicitly change them. Preserve the source's visual medium and rendering style. The reference pose, gaze, camera angle and framing are not to be copied; use the required output view.",
+ description: "Keep the same character and visual style.",
intendedUse: ["character"], createdAt: source.createdAt,
images: [{ id: "character-sheet-source-image", name: source.name, relativePath: source.relativePath, sourcePath: source.sourcePath }],
};
return CHARACTER_SHEET_VIEWS.map((view, index) => {
const wardrobe = index === 1
- ? "Apply the template's clothing instructions and references to establish the outfit. Where no change is requested, copy visible garments from <Picture 1> exactly. For clothing outside its crop, complete one coherent outfit for this character; this full body front view will define the outfit for all other views."
- : "<Picture 1> is the original identity reference. <Picture 2> is the full body front view of this same character and the fixed wardrobe reference. Use it for outfit design only, not its pose, gaze or camera angle. Reproduce that exact outfit from the requested camera angle. Keep identical garment types, layers, cuts, lengths, fit, seams, closures, patterns, colors, fabric, footwear, jewelry and accessories. Do not add, remove, replace, restyle or recolor any clothing. Preserve anatomical left/right placement of asymmetric details when turning the character. Infer hidden surfaces consistently with the same garments; details on the front stay on the front and need not be visible from other angles." + (index === 0 ? " Use frontal waist-up framing while retaining the exact visible upper-body clothing." : index === 2 ? " Rotate the character into the required strict left-facing profile." : " Rotate the character 180 degrees from the wardrobe reference into the required straight rear view. Show the back of the outfit, without moving front closures or front graphics onto its back.");
- const orientation = `Required output view (takes precedence over reference poses and template pose or framing instructions): ${view.description}`;
+ ? "Keep the outfit from <Picture 1> unless the template instructions change it; complete any unseen clothing."
+ : "Use <Picture 1> for identity and match the outfit in <Picture 2> from the requested angle.";
const selectedReference = { ...reference,
- description: `${reference.description} ${index === 3 ? "Identity must remain recognizable from the rear silhouette, hair and outfit; facial features are out of view." : "Retain the same facial features wherever visible from the required angle."} ${orientation}`,
images: index === 1 ? reference.images : [...reference.images!, { id: "character-sheet-front", name: "Full body front wardrobe reference", relativePath: frontRelativePath }],
};
const instructions = options.prompt.trim() ? `Template instructions: ${options.prompt.trim()}` : "";
- const scene = createImageScene(`Create a character reference view of @[ref:${reference.id}]. ${view.description} ${wardrobe} Preserve the character's identity. Use a plain light gray background and soft even studio lighting unless the template instructions specify otherwise. Render no text, labels, borders, additional characters or multiple views. Match the source image's visual style.\n${instructions}\n${orientation}`);
+ const scene = createImageScene(`One character reference view of @[ref:${reference.id}]. ${wardrobe} Plain light gray background, soft even lighting, no text.\n${instructions}\nRequired view: ${view.description}`);
scene.style = { mode: "art", medium: "the same visual medium and rendering style as <Picture 1>", aesthetics: "", lighting: "", detail: "" };
return compileImagePrompt({
...config, settings: { ...config.settings, defaultLook: null }, references: [selectedReference, ...config.references],
imageScene: scene,
- }, { referenceTransformations: { [reference.id]: `Retain identity, body proportions, hair, clothing and visual style, but replace the reference pose, gaze, camera angle and framing. ${orientation}` } });
+ }, { referenceTransformations: { [reference.id]: "Keep the character's identity; use the requested outfit and view." } });
});
}