Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Default image style mode to None

Bitti2dad31ea47c3
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 1df772e..0e14431 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -4,6 +4,7 @@ This alpha update adds LAN generation workers, Linux support, expanded color gra
## What's new
+- New image scenes default to None style mode, which adds no style instructions to the generated prompt.
- Generation diagnostics now separate VAE model opening, weight loading, decoding and cleanup times to help identify intermittent image-generation slowdowns.
- Added Long Shot scenes: generate alternating fresh clips and latent bridges in 1 → 3 → 2 → 5 → 4 order. Bridge controls set how much of the neighboring ending and beginning may change, with joined video and audio used in preview and export. Includes updated Windows/Linux runtimes and LAN worker support; update workers alongside the app.
- Video and image generation headers now show the effective step count from the selected generator's active LoRAs, including fixed sampling schedules.
diff --git a/src-tauri/assets/agent-image.md b/src-tauri/assets/agent-image.md
index 4173dfb..ce75e2c 100644
--- a/src-tauri/assets/agent-image.md
+++ b/src-tauri/assets/agent-image.md
@@ -6,7 +6,7 @@ Prefer small, targeted commands for edits to the image hierarchy. Unmentioned fi
When imageScene.rootType is "image", sourceImage is the existing image being edited. The root has no authored text prompt. Add Object nodes describing changes, each with an explicit bounding box in the usual 0–1000 full-image coordinates. Each described node is inpainted separately, in depth-first hierarchy order, using the previous edit's result. Empty groups only organize edits. Use image.node.move to change execution order. Root style/background and project resolution do not affect these edits; source dimensions are preserved. The user chooses the source with Open image or a generated thumbnail's Edit action; commands cannot set rootType or sourceImage, and image.set preserves them. Successful generation produces a clean image root on the final result, with no pending edits. Do not put edit instructions in the root.
-- {"op":"image.configure","prompt"?:string,"background"?:string,"style"?:{"mode"?:"photo"|"art","aesthetics"?:string,"lighting"?:string,"medium"?:string,"detail"?:string},"steps"?:integer,"seed"?:integer,"referenceIds"?:string[]}. Updates only supplied fields; prompt edits the root description. Style merges supplied fields. An empty string clears a description, [] clears references. Use project.set for resolution and aspectRatio.
+- {"op":"image.configure","prompt"?:string,"background"?:string,"style"?:{"mode"?:"none"|"photo"|"art","aesthetics"?:string,"lighting"?:string,"medium"?:string,"detail"?:string},"steps"?:integer,"seed"?:integer,"referenceIds"?:string[]}. Updates only supplied fields; prompt edits the root description. Style merges supplied fields. Mode none is the default and omits all style instructions, including saved style fields and the project look. An empty string clears a description, [] clears references. Use project.set for resolution and aspectRatio.
- {"op":"image.node.add","id":string,"parent":existing-node-id,"kind":"object"|"text"|"group"|"background","name":string,"description"?:string,"text"?:string,"box"?:box|null,"colors"?:string[],"before"?:sibling-id|null}. Adds a node under parent. Optional text and description default to empty, colors to [], and box to null (automatic placement). before inserts before an existing child of parent; omit it or use null to append.
- {"op":"image.node.set","id":existing-node-id,"name"?:string,"description"?:string,"text"?:string,"box"?:box|null,"colors"?:string[]}. Edits only supplied fields. Setting box moves/resizes the node and transforms its descendants' boxes with it. box:null clears only this node's explicit placement; omission leaves placement unchanged. [] clears its palette. Root description is the image prompt.
- {"op":"image.node.move","id":existing-node-id,"parent":destination-node-id,"before"?:sibling-id|null}. Reparents and/or reorders the node with its subtree. before must be a child of the destination parent. Omit it or use null to append. Absolute placement stays unchanged. A node cannot become its own ancestor.
@@ -22,11 +22,11 @@ Example: add a grouped title, then refine its typography without replacing other
Use the actual root ID in the current document; image-root is the default. Commands apply transactionally: a missing target, cycle, invalid placement, duplicate ID, or invalid setting rejects the whole batch. Generated images, assets, outputAssetId, file paths and provider settings cannot be edited with these commands. The user controls Generate in the Image tab; scene.generate only applies to video scenes when the user requests video generation.
For an explicitly requested complete composition replacement, the older full-authoring command remains available:
-{"op":"image.set","nodes":[...],"background":"environment description","style":{"mode":"photo","aesthetics":"","lighting":"","medium":"","detail":"camera/lens or art style"},"steps":20,"seed":-1,"referenceIds":[]}
+{"op":"image.set","nodes":[...],"background":"environment description","style":{"mode":"none","aesthetics":"","lighting":"","medium":"","detail":""},"steps":20,"seed":-1,"referenceIds":[]}
All fields are required; copy unchanged authored fields from imageScene in the current project. Do not send outputAssetId: generated results belong to the app. Each node has exactly these fields:
{"id":"stable-id","parentId":null,"kind":"root","name":"Image","description":"high-level image prompt","text":"","box":null,"colors":[]}
-Use exactly one root with parentId null. Other nodes have kind group, object, text or background, and parentId naming an existing node. IDs must be unique and the tree connected and acyclic. Objects, groups and text may carry box {"x":100,"y":100,"width":400,"height":600} in 0–1000 image coordinates; extents must be positive and stay within the image. Box null means automatic placement. A group's description provides context to its children. Text nodes use text for the exact lettering and description for appearance. Colors are hex #RRGGBB strings (up to 16). Names are short tree labels; put visual instructions in description. At most 500 nodes. Style mode is photo or art, steps 2–1000, seed -1 for random or a nonnegative safe integer. Bounding-box coordinates and color palettes are omitted from H3 prompts. In image-root editing, boxes still define the inpainting area.
+Use exactly one root with parentId null. Other nodes have kind group, object, text or background, and parentId naming an existing node. IDs must be unique and the tree connected and acyclic. Objects, groups and text may carry box {"x":100,"y":100,"width":400,"height":600} in 0–1000 image coordinates; extents must be positive and stay within the image. Box null means automatic placement. A group's description provides context to its children. Text nodes use text for the exact lettering and description for appearance. Colors are hex #RRGGBB strings (up to 16). Names are short tree labels; put visual instructions in description. At most 500 nodes. Style mode is none, photo or art, steps 2–1000, seed -1 for random or a nonnegative safe integer. Bounding-box coordinates and color palettes are omitted from H3 prompts. In image-root editing, boxes still define the inpainting area.
Use project.set for project name, resolution and aspectRatio. Use ref.add/ref.set for reusable descriptions, then cite each one in a description or the background as @[ref:<id>] with its reference ID, e.g. "@[ref:ref-mara] holds the lantern". Only the references cited this way are passed to generation; referenceIds is no longer used to choose them. Cite only existing image/text references. Remove its citations before ref.remove. The Image tab is active: preserve the project's video scenes and timeline, and do not create scene.*, shot.* or clip.* commands unless the user explicitly asks to edit video. Preserve the current image composition unless asked to change it. Never invent files or claim to have generated an image: the user runs Generate in the Image tab.
diff --git a/src-tauri/src/project/commands/images.rs b/src-tauri/src/project/commands/images.rs
index 31f387d..9547394 100644
--- a/src-tauri/src/project/commands/images.rs
+++ b/src-tauri/src/project/commands/images.rs
@@ -38,7 +38,7 @@ fn new_scene(prompt: &str) -> ImageScene {
}],
background: String::new(),
style: ImageStyle {
- mode: "photo".into(),
+ mode: "none".into(),
aesthetics: String::new(),
lighting: String::new(),
medium: String::new(),
diff --git a/src-tauri/src/project/image.rs b/src-tauri/src/project/image.rs
index b884ba2..5469698 100644
--- a/src-tauri/src/project/image.rs
+++ b/src-tauri/src/project/image.rs
@@ -146,7 +146,7 @@ impl ImageScene {
|| self.nodes.len() > 500
|| !(2..=1000).contains(&self.steps)
|| !(-1..=9_007_199_254_740_991).contains(&self.seed)
- || !matches!(self.style.mode.as_str(), "photo" | "art")
+ || !matches!(self.style.mode.as_str(), "none" | "photo" | "art")
|| self.reference_ids.len() > 100
|| self.reference_ids.iter().any(String::is_empty)
|| self.output_asset_id.as_ref().is_some_and(String::is_empty)
diff --git a/src-tauri/src/tests/images.rs b/src-tauri/src/tests/images.rs
index 4d9ae7c..eeaef14 100644
--- a/src-tauri/src/tests/images.rs
+++ b/src-tauri/src/tests/images.rs
@@ -51,6 +51,7 @@ fn image_root_survives_save_and_agent_hierarchy_replacement() {
use crate::project::commands::{execute_commands_at, ProjectCommand};
let mut config = image_fixture();
let scene = config.image_scene.as_mut().unwrap();
+ scene.style.mode = "none".into();
scene.root_type = Some("image".into());
scene.source_image = Some(crate::project::image::ImageSource { relative_path: "media/imported/source.png".into(), name: "Source".into(), width: 65, height: 41 });
let root = tempfile::tempdir().unwrap();
diff --git a/src/components/workspace/ImageEditor.test.tsx b/src/components/workspace/ImageEditor.test.tsx
index 3972fdd..86f1294 100644
--- a/src/components/workspace/ImageEditor.test.tsx
+++ b/src/components/workspace/ImageEditor.test.tsx
@@ -553,6 +553,10 @@ it("edits ordered style tokens with suggestions, custom tags, removal, undo, and
expect(screen.queryByRole("option", { name: "whimsical" })).not.toBeInTheDocument();
fireEvent.keyDown(aesthetics, { key: "Backspace" });
expect(current().imageScene!.style.aesthetics).toBe("Minimal poster, intricate");
+ choose("Mode", "None");
+ expect(comboValue(screen.getByRole("combobox", { name: "Mode" }))).toBe("none");
+ expect(screen.queryByRole("combobox", { name: "Add Aesthetics tag" })).not.toBeInTheDocument();
+ expect(imageScenePrompt(current().imageScene!)).not.toMatch(/still photograph|Minimal poster|golden hour|Screen print/);
expect(parseProjectConfig(JSON.parse(JSON.stringify(current()))).imageScene).toEqual(current().imageScene);
});
diff --git a/src/components/workspace/ImageEditor.tsx b/src/components/workspace/ImageEditor.tsx
index cd4defc..ccafcd1 100644
--- a/src/components/workspace/ImageEditor.tsx
+++ b/src/components/workspace/ImageEditor.tsx
@@ -724,11 +724,13 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
<PropRow label="Resolution" htmlFor={rootField("resolution")}><ComboBox id={rootField("resolution")} aria-label="Resolution" value={settings.resolution} options={[...new Set([...PROJECT_RESOLUTIONS, settings.resolution])].map((resolution) => { const size = outputDimensions(resolution, settings.aspectRatio); return { value: resolution, label: `${size.width} × ${size.height}` }; })} onChange={(value) => { const resolution = value as ProjectConfig["settings"]["resolution"]; onChange((current) => ({ ...current, imageSettings: { ...imageSettings(current), resolution } })); }} /></PropRow>
</PropSection>
<PropSection title="Style" persistKey="image.style">
- <PropRow label="Mode" htmlFor={rootField("mode")}><ComboBox id={rootField("mode")} aria-label="Mode" value={scene.style.mode} options={[{ value: "photo", label: "Photo" }, { value: "art", label: "Art" }]} onChange={(value) => commit({ ...scene, style: { ...scene.style, mode: value as "photo" | "art" } })} /></PropRow>
+ <PropRow label="Mode" htmlFor={rootField("mode")}><ComboBox id={rootField("mode")} aria-label="Mode" value={scene.style.mode} options={[{ value: "none", label: "None" }, { value: "photo", label: "Photo" }, { value: "art", label: "Art" }]} onChange={(value) => commit({ ...scene, style: { ...scene.style, mode: value as "none" | "photo" | "art" } })} /></PropRow>
+ {scene.style.mode !== "none" && <>
<TagEditor label="Aesthetics" value={scene.style.aesthetics} suggestions={scene.style.mode === "photo" ? styleSuggestions.PhotoAestheticsSuggestions : styleSuggestions.ArtAestheticsSuggestions} onChange={(aesthetics) => commit({ ...scene, style: { ...scene.style, aesthetics } })} />
<TagEditor label="Lighting" value={scene.style.lighting} suggestions={scene.style.mode === "photo" ? styleSuggestions.PhotoLightingSuggestions : styleSuggestions.ArtLightingSuggestions} onChange={(lighting) => commit({ ...scene, style: { ...scene.style, lighting } })} />
{scene.style.mode === "art" && <TagEditor label="Medium" value={scene.style.medium} suggestions={styleSuggestions.MediumSuggestions} onChange={(medium) => commit({ ...scene, style: { ...scene.style, medium } })} />}
<TagEditor key={scene.style.mode} label={scene.style.mode === "photo" ? "Camera / lens" : "Art style"} value={scene.style.detail} suggestions={scene.style.mode === "photo" ? styleSuggestions.PhotoSuggestions : styleSuggestions.ArtSuggestions} onChange={(detail) => commit({ ...scene, style: { ...scene.style, detail } })} />
+ </>}
</PropSection>
</>}
{selected.kind === "root" && imageRoot && generatedImage && <PropSection title="Image generation" persistKey="image.generation">
diff --git a/src/lib/imagePrompt.test.ts b/src/lib/imagePrompt.test.ts
index a1f5824..620b2ef 100644
--- a/src/lib/imagePrompt.test.ts
+++ b/src/lib/imagePrompt.test.ts
@@ -43,6 +43,11 @@ describe("MiniMax H3 still-image prompts", () => {
].join("\n"));
expect(compileImagePrompt(config).prompt).not.toMatch(/\[Shot 2|00:|root:|Ignored art medium|Medium:|Aesthetics:|Camera and lens:/);
expect(config).toEqual(snapshot);
+ config.imageScene!.style.mode = "none";
+ expect(compileImagePrompt(config).prompt).toBe([
+ "integrated_multimodal_description: [Shot 1] A runner suspended mid-stride.",
+ "", "overall_soundscape: N/A", "", "non_diegetic_music: N/A",
+ ].join("\n"));
});
it("preserves nested composition while omitting placement and palettes", () => {
@@ -85,7 +90,7 @@ describe("MiniMax H3 still-image prompts", () => {
expect(result.prompt).toContain("<Subject 2> is Palette, providing appearance. Warm ochre and red.");
expect(result.prompt).toContain("<Subject 3> is Runner, providing appearance from <Picture 2> and <Picture 3>. Red jersey.");
expect(result.prompt).toContain("summary:\n[reference generation] A single still image uses <Subject 1>, <Subject 2>, <Subject 3>");
- expect(result.prompt).toContain("detailed_description:\nA still photograph.\n[Shot 1] On <Subject 1> in <Subject 2> tones, <Subject 3> is suspended mid-stride.");
+ expect(result.prompt).toContain("detailed_description:\n[Shot 1] On <Subject 1> in <Subject 2> tones, <Subject 3> is suspended mid-stride.");
for (let index = 1; index <= 3; index++) {
expect(result.prompt).toContain(`<Subject ${index}> (appears in [Shot 1]): fully_preserved`);
expect(result.prompt.split("detailed_description:")[1]).toContain(`Use <Subject ${index}>`);
diff --git a/src/lib/imagePrompt.ts b/src/lib/imagePrompt.ts
index 32482ed..26c373b 100644
--- a/src/lib/imagePrompt.ts
+++ b/src/lib/imagePrompt.ts
@@ -49,7 +49,7 @@ export function compileImagePrompt(config: ProjectConfig, options: { referenceTr
: editing ? "The still image retains the visual medium, lighting, palette and perspective of <Picture 1>." : visual.style;
const audio = ["overall_soundscape: N/A", "non_diegetic_music: N/A"];
if (!subjects.length && !sourcePicture) return {
- prompt: [`integrated_multimodal_description: [Shot 1] ${style}\n${visual.composition}`, ...audio].join("\n\n"), references,
+ prompt: [`integrated_multimodal_description: [Shot 1] ${[style, visual.composition].filter(Boolean).join("\n")}`, ...audio].join("\n\n"), references,
};
const definitions = subjects.map((subject, index) => `${label(index)} is ${subject.name}, providing ${subject.role}${subject.source}. ${subject.description}`);
const retention = subjects.map((subject, index) => {
@@ -71,7 +71,7 @@ export function compileImagePrompt(config: ProjectConfig, options: { referenceTr
`subject_definitions:\n${definitions.join("\n")}`,
`summary:\n${summary}`,
`retention_analysis:\n${retention.join("\n")}`,
- `detailed_description:\n${style}\n[Shot 1] ${visual.composition}\n${subjects.map((subject, index) => `Use ${label(index)} for ${subject.name}'s ${subject.role}${subject.source}. ${subject.description}`).join("\n")}`,
+ `detailed_description:\n${style ? `${style}\n` : ""}[Shot 1] ${visual.composition}\n${subjects.map((subject, index) => `Use ${label(index)} for ${subject.name}'s ${subject.role}${subject.source}. ${subject.description}`).join("\n")}`,
...audio,
].join("\n\n"), references };
}
diff --git a/src/lib/imageScene.test.ts b/src/lib/imageScene.test.ts
index f7d3f4f..5cc4fca 100644
--- a/src/lib/imageScene.test.ts
+++ b/src/lib/imageScene.test.ts
@@ -48,6 +48,7 @@ describe("image documents", () => {
objectScene.nodes[1].colors = ["#FF0000"];
expect(imageScenePrompt(objectScene)).toBe("");
objectScene.nodes[1].description = "sunglasses";
- expect(imageScenePrompt(objectScene)).toBe("A still photograph.\nsunglasses.");
+ expect(objectScene.style.mode).toBe("none");
+ expect(imageScenePrompt(objectScene)).toBe("sunglasses.");
});
});
diff --git a/src/lib/imageScene.ts b/src/lib/imageScene.ts
index b3770fc..7d12063 100644
--- a/src/lib/imageScene.ts
+++ b/src/lib/imageScene.ts
@@ -19,7 +19,7 @@ export const imageSceneSchema = z.object({
sourceImage: imageSourceSchema.nullish(),
nodes: z.array(imageNodeSchema).min(1).max(500),
background: z.string(),
- style: z.object({ mode: z.enum(["photo", "art"]), aesthetics: z.string(), lighting: z.string(), medium: z.string(), detail: z.string() }),
+ style: z.object({ mode: z.enum(["none", "photo", "art"]), aesthetics: z.string(), lighting: z.string(), medium: z.string(), detail: z.string() }),
steps: z.number().int().min(2).max(1000), seed: z.number().int().min(-1).max(Number.MAX_SAFE_INTEGER),
referenceIds: z.array(z.string().min(1)).max(100),
outputAssetId: z.string().min(1).nullable(),
@@ -51,7 +51,7 @@ export const imageScenePromptText = (scene: ImageScene): string =>
export function createImageScene(prompt = ""): ImageScene {
return { nodes: [{ id: "image-root", parentId: null, kind: "root", name: "Image", description: prompt, text: "", box: null, colors: [] }],
- background: "", style: { mode: "photo", aesthetics: "", lighting: "", medium: "", detail: "" }, steps: 20, seed: -1, referenceIds: [], outputAssetId: null };
+ background: "", style: { mode: "none", aesthetics: "", lighting: "", medium: "", detail: "" }, steps: 20, seed: -1, referenceIds: [], outputAssetId: null };
}
export function createImageEditScene(sourceImage: ImageSource | null, previous?: ImageScene): ImageScene {
return { ...createImageScene(), rootType: "image", sourceImage,
@@ -107,7 +107,7 @@ export function imageScenePromptParts(scene: ImageScene, look?: string): { style
...(scene.style.detail.trim() ? [`${scene.style.detail.trim()} ${scene.style.mode === "photo" ? "camera and lens characteristics" : "art style"}`] : []),
];
const medium = scene.style.mode === "photo" ? "A still photograph" : `A still image in ${scene.style.medium.trim() || "an artistic medium"}`;
- const style = sentence(`${medium}${treatment.length ? ` with ${treatment.join(", ")}` : ""}`);
+ const style = scene.style.mode === "none" ? "" : sentence(`${medium}${treatment.length ? ` with ${treatment.join(", ")}` : ""}`);
const lines: string[] = [
...(root.description.trim() ? [sentence(root.description)] : []),
...(scene.background.trim() ? [`Background: ${sentence(scene.background)}`] : []),
@@ -128,5 +128,5 @@ export function imageScenePromptParts(scene: ImageScene, look?: string): { style
export function imageScenePrompt(scene: ImageScene, look?: string): string {
const parts = imageScenePromptParts(scene, look);
- return parts ? `${parts.style}\n${parts.composition}` : "";
+ return parts ? [parts.style, parts.composition].filter(Boolean).join("\n") : "";
}
diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.ts
index a4f9374..c159a2e 100644
--- a/src/lib/workQueue.test.ts
+++ b/src/lib/workQueue.test.ts
@@ -486,6 +486,7 @@ describe("image generation work", () => {
const { queue } = setup();
const project = imageProject();
project.config.settings.defaultLook = "watercolor";
+ project.config.imageScene!.style.mode = "photo";
project.config.references = [{ id: "ocean", kind: "image", name: "Ocean", description: "Turquoise water", relativePath: "references/ocean.png", intendedUse: [], createdAt: project.config.createdAt }];
project.config.imageScene!.nodes[0].description += " over @[ref:ocean]";
const preview = compileImagePrompt(project.config).prompt;