AI media harness for planning, generating, and editing locally
TypeScript
Generate extensions with one preserved-source mask
Bittib1aa34238570
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 898261c..35a7739 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -40,7 +40,7 @@ This alpha update adds LAN generation workers, Linux support, expanded color gra- The timeline playhead follows playback without waiting for editor updates.- 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.+- Extend generates all new space in one outpainting pass, holding the placed original as fixed context throughout generation so edges and corners can continue the same scene. It no longer repaints separate border strips and pastes the original over them.- 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.- Copy and paste effect settings between matching effects from their **…** menus, including bypass state and LUT data.- Add voice reference chips directly in a shot's Speech field. Voice guidance stays separate from the words spoken.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex d9c6828..365b1ba 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -1,5 +1,33 @@# Slopfab compatibility+## API 1.20: single-pass image outpainting++The bundled Windows and Linux runtimes come from SlopFab commit `b7486be`,+built with `SLOPFAB_WITH_FFMPEG=OFF`. The additive+`slopfab_request_set_image_edit_invert_mask` setter makes an image-edit box+identify the preserved original instead of a region to replace.++Extend sends one inverted mask for the placed source rectangle. CUDA and+Vulkan restore original latent context at every denoising step while generating+the entire surround together. Fully contained 16-pixel latent cells are locked;+unaligned boundary cells can generate the seam. Pixel compositing preserves the+exact original rectangle, and Slopus's PNG finalizer retains its original alpha.+The original crop is also shown to Qwen as `Source scene`, supplying visual+meaning without a second, independently resized DiT reference anchor. User+references retain their picture numbering. Source-dependent prompt embeddings+are recomputed to prevent stale conditioning when the image changes.++This replaces sequential, overlapping border edits, which could rewrite the+source context and leave unrelated borders when the original was pasted back.+Selections with too little original context are rejected before generation.++LAN protocol 3 carries the inverted mask. Older workers must be updated because+they would otherwise ignore inversion and repaint the original rectangle.+An older local runtime reports the required API version; ordinary edits remain+supported. Tests cover inverted latent masks, per-step source preservation,+pixel compositing, request validation, serialization, preview and execution on+both backends, and the older-runtime error.+## API 1.18: refmod exportThe bundled runtime comes from SlopFab commit `9d45da8`, built withdiff --git a/lib/slopfab/libslopfab.so b/lib/slopfab/libslopfab.soindex 5b2d144..fb5bfca 100644--- a/lib/slopfab/libslopfab.so+++ b/lib/slopfab/libslopfab.so@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:efada2a9e1557f744766c3e51a5695a2a9b10c9a5c2697ae477b479032b424bc-size 19159008+oid sha256:93aad39f36b1fd7b359114ed337c8c15f355a61349fa505c2eeefd31bf6802d3+size 19234488diff --git a/lib/slopfab/slopfab.dll b/lib/slopfab/slopfab.dllindex 746bb5b..a50a016 100644--- a/lib/slopfab/slopfab.dll+++ b/lib/slopfab/slopfab.dll@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:1615cad955177f59c563c6ef7e65753ead5d6aedb873bd261b5d74eba547738c-size 16634880+oid sha256:718d5280d4aa47d72125b7401d11bab895175f5dfb6c675831b0a5b1b46b01f7+size 16714752diff --git a/src-tauri/core/src/slopfab/ffi/mod.rs b/src-tauri/core/src/slopfab/ffi/mod.rsindex 51a9112..53b7250 100644--- a/src-tauri/core/src/slopfab/ffi/mod.rs+++ b/src-tauri/core/src/slopfab/ffi/mod.rs@@ -45,6 +45,12 @@ impl Api {self.inner.prepare_lora_grid(path, width, allow_download)}#[cfg(test)]+ pub fn disable_outpainting_for_test(&mut self) {+ Arc::get_mut(&mut self.inner)+ .expect("configure API before creating handles")+ .disable_outpainting_for_test();+ }+ #[cfg(test)]pub fn disable_lora_preparation_for_test(&mut self) {Arc::get_mut(&mut self.inner).expect("configure API before creating handles")@@ -111,6 +117,10 @@ impl Api {self.check(r)?;self.inner.set_image_edit_rgb(r.pointer.as_ptr(), pixels, width, height, bounds, feather)}+ pub fn set_image_edit_invert_mask(&self, r: &RequestHandle) -> Result<(), String> {+ self.check(r)?;+ self.inner.set_image_edit_invert_mask(r.pointer.as_ptr())+ }pub fn set_save_latents(&self, r: &RequestHandle, path: &Path) -> Result<(), String> {self.check(r)?;self.inner.set_save_latents(r.pointer.as_ptr(), path)diff --git a/src-tauri/core/src/slopfab/ffi/raw/mod.rs b/src-tauri/core/src/slopfab/ffi/raw/mod.rsindex da2e297..d7be283 100644--- a/src-tauri/core/src/slopfab/ffi/raw/mod.rs+++ b/src-tauri/core/src/slopfab/ffi/raw/mod.rs@@ -83,6 +83,7 @@ pub struct Api {set_still_image: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,set_image_edit_path: Option<SetImageEditPath>,set_image_edit_rgb: Option<SetImageEditRgb>,+ set_image_edit_invert_mask: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,set_save_latents: Option<unsafe extern "C" fn(*mut Request, *const c_char) -> i32>,set_continuation_file: Option<unsafe extern "C" fn(*mut Request, *const c_char, i32) -> i32>,set_video_transition: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,@@ -199,6 +200,7 @@ impl Api {.map(|symbol| *symbol),set_image_edit_path: library.get::<SetImageEditPath>(b"slopfab_request_set_image_edit_path\0").ok().map(|symbol| *symbol),set_image_edit_rgb: library.get::<SetImageEditRgb>(b"slopfab_request_set_image_edit_rgb24\0").ok().map(|symbol| *symbol),+ set_image_edit_invert_mask: library.get::<unsafe extern "C" fn(*mut Request, i32) -> i32>(b"slopfab_request_set_image_edit_invert_mask\0").ok().map(|symbol| *symbol),set_steps: symbol!("slopfab_request_set_steps",unsafe extern "C" fn(*mut Request, i32) -> i32@@ -415,6 +417,10 @@ impl Api {}self.error(unsafe { set(r, pixels.as_ptr(), pixels.len(), width, height, width as usize * 3, bounds[0], bounds[1], bounds[2], bounds[3], 1.0, feather) })}+ pub fn set_image_edit_invert_mask(&self, r: *mut Request) -> Result<(), String> {+ let set = self.set_image_edit_invert_mask.ok_or("Seamless Extend requires SlopFab API 1.20 or later. Update the generation runtime.")?;+ self.error(unsafe { set(r, 1) })+ }pub fn set_save_latents(&self, r: *mut Request, path: &Path) -> Result<(), String> {let set = self.set_save_latents.ok_or("Saving generation latents requires slopfab.dll API 1.9 or later. Update the runtime.",@@ -503,6 +509,10 @@ impl Api {self.error(unsafe { prepare(path.as_ptr(), width, allow_download as i32) })}#[cfg(test)]+ pub fn disable_outpainting_for_test(&mut self) {+ self.set_image_edit_invert_mask = None;+ }+ #[cfg(test)]pub fn disable_lora_preparation_for_test(&mut self) {self.prepare_lora_grid = None;}diff --git a/src-tauri/core/src/slopfab/ffi/tests.rs b/src-tauri/core/src/slopfab/ffi/tests.rsindex e28910b..bc44ad7 100644--- a/src-tauri/core/src/slopfab/ffi/tests.rs+++ b/src-tauri/core/src/slopfab/ffi/tests.rs@@ -21,6 +21,17 @@ fn image_edit_setters_use_original_pixel_boxes_and_pad_the_plan() {assert_eq!(api.resolve(&from_path).unwrap().aligned_frames, 1);}+#[test]+fn older_runtimes_reject_outpainting_instead_of_editing_the_original() {+ let mut api = Api::load(&crate::slopfab::default_dll_path()).unwrap();+ api.disable_outpainting_for_test();+ let request = RequestHandle::new(&api).unwrap();+ api.set_image_edit_rgb(&request, &vec![127; 64 * 64 * 3], 64, 64, [16, 16, 32, 32], 0).unwrap();+ assert!(api.set_image_edit_invert_mask(&request).unwrap_err().contains("API 1.20"));+ // Ordinary image editing remains available on older runtimes.+ assert!(api.resolve(&request).is_ok());+}+#[test]fn older_runtimes_report_missing_lora_preparation_without_breaking_planning() {let mut api = Api::load(&crate::slopfab::default_dll_path()).unwrap();diff --git a/src-tauri/core/src/slopfab/h3.rs b/src-tauri/core/src/slopfab/h3.rsindex 9c56c64..371eee7 100644--- a/src-tauri/core/src/slopfab/h3.rs+++ b/src-tauri/core/src/slopfab/h3.rs@@ -62,14 +62,17 @@ pub(super) fn configure_request(let step = edit.edits.first().ok_or("Add an image edit before generating.")?;api.set_prompt(handle, &step.prompt)?;let bounds = [step.x, step.y, step.width, step.height];- // Ordinary edits blend inward. Extend replaces padding all the way to- // the canvas edge; its finalizer restores the original intersection.+ // Ordinary edits blend inward. Outpainting preserves this box and+ // generates its entire surround with shared context in one pass.let feather = step.feather.unwrap_or(16);if let Some(pixels) = &request.image_edit_pixels {api.set_image_edit_rgb(handle, pixels, request.canvas_width, request.canvas_height, bounds, feather)?;} else {api.set_image_edit_path(handle, request.image_edit_path.as_deref().ok_or("Image edit source has not been resolved.")?, bounds, feather)?;}+ if step.invert_mask {+ api.set_image_edit_invert_mask(handle)?;+ }} else {api.set_resolution(handle, request.canvas_width, request.canvas_height)?;}diff --git a/src-tauri/core/src/slopfab/planning.rs b/src-tauri/core/src/slopfab/planning.rsindex 263ec8b..dad340b 100644--- a/src-tauri/core/src/slopfab/planning.rs+++ b/src-tauri/core/src/slopfab/planning.rs@@ -67,6 +67,14 @@ pub(super) fn validate_generation_controls(request: &GenerationRequest) -> Resul|| i64::from(step.y) + i64::from(step.height) > i64::from(request.canvas_height)) {return Err("Image edits require one source image and nonempty boxes inside its dimensions.".into());}+ for step in &edit.edits {+ if step.invert_mask && (edit.edits.len() != 1 || step.feather != Some(0)+ || (step.x == 0 && step.y == 0 && step.width == request.canvas_width && step.height == request.canvas_height)+ || (i64::from(step.x) + 15) / 16 >= (i64::from(step.x) + i64::from(step.width)) / 16+ || (i64::from(step.y) + 15) / 16 >= (i64::from(step.y) + i64::from(step.height)) / 16) {+ return Err("Outpainting requires one preserved box with original context, room outside it and zero feather.".into());+ }+ }}let limits = crate::models::H3_CAPABILITIES;if request.reference_paths.len() > limits.max_image_referencesdiff --git a/src-tauri/core/src/slopfab/tests.rs b/src-tauri/core/src/slopfab/tests.rsindex 706058e..8fcb173 100644--- a/src-tauri/core/src/slopfab/tests.rs+++ b/src-tauri/core/src/slopfab/tests.rs@@ -56,7 +56,7 @@ fn image_edit_recipe_disables_motion_cache_and_keeps_source_geometry() {canvas_width: 65, canvas_height: 41,image_edit_pixels: Some(std::sync::Arc::new(vec![100; 65 * 41 * 3])),image_edit: Some(types::ImageEditRequest { source_relative_path: "media/source.png".into(), edits: vec![- types::ImageEditStep { prompt: "A red vase".into(), x: 30, y: 10, width: 35, height: 31, feather: None, reference_paths: None, refmods: None }+ types::ImageEditStep { prompt: "A red vase".into(), x: 30, y: 10, width: 35, height: 31, feather: None, invert_mask: false, reference_paths: None, refmods: None }] }), ..Default::default()};validate_generation_controls(&request).unwrap();@@ -87,6 +87,49 @@ fn image_edit_recipe_disables_motion_cache_and_keeps_source_geometry() {assert!(validate_generation_controls(&invalid).is_err());}+#[test]+fn outpainting_preserves_one_box_in_preview_execution_and_worker_requests() {+ let mut configuration = Configuration::from_settings(&BTreeMap::new());+ configuration.motion_cache = true;+ let api = ffi::Api::load(&configuration.dll_path).unwrap();+ let request: GenerationRequest = serde_json::from_value(serde_json::json!({+ "jobId":"outpaint", "prompt":"Continue the scene", "stillImage":true, "frames":1,+ "steps":4, "seed":0, "canvasWidth":128, "canvasHeight":64,+ "imageEdit":{"sourceRelativePath":"canvas.png", "edits":[{+ "prompt":"Continue the scene", "x":38, "y":13, "width":51, "height":38,+ "feather":0, "invertMask":true+ }]}+ })).unwrap();+ // This is the same serialization boundary used by LAN workers.+ let mut roundtrip: GenerationRequest = serde_json::from_value(serde_json::to_value(&request).unwrap()).unwrap();+ assert!(roundtrip.image_edit.as_ref().unwrap().edits[0].invert_mask);+ validate_generation_controls(&roundtrip).unwrap();+ roundtrip.image_edit_pixels = Some(std::sync::Arc::new(vec![127; 128 * 64 * 3]));+ for platform in [ComputePlatform::Cuda13, ComputePlatform::Vulkan] {+ for purpose in [RequestPurpose::Plan, RequestPurpose::Generate] {+ let handle = RequestHandle::new(&api).unwrap();+ configure_request(&api, &handle, &roundtrip, &configuration, platform, purpose, &ReferenceVideos::default()).unwrap();+ let plan = api.resolve(&handle).unwrap();+ assert_eq!((plan.canvas_width, plan.canvas_height, plan.aligned_frames), (128, 64, 1));+ assert_eq!(plan.num_model_evaluations, 3);+ assert!(api.describe(&handle).unwrap().contains("outpaint (preserve box)"));+ }+ }+ for change in [+ serde_json::json!({"feather":16}), serde_json::json!({"feather":null}),+ serde_json::json!({"x":0,"y":0,"width":128,"height":64}),+ serde_json::json!({"width":1}), serde_json::json!({"height":1}),+ ] {+ let mut value = serde_json::to_value(&request).unwrap();+ value["imageEdit"]["edits"][0].as_object_mut().unwrap().extend(change.as_object().unwrap().clone());+ assert!(validate_generation_controls(&serde_json::from_value(value).unwrap()).is_err());+ }+ let mut invalid = request.clone();+ let edits = &mut invalid.image_edit.as_mut().unwrap().edits;+ edits.push(edits[0].clone());+ assert!(validate_generation_controls(&invalid).is_err());+}+#[test]fn video_transitions_use_encoded_boundaries_with_the_bundled_runtime() {let references = ReferenceVideos::default();diff --git a/src-tauri/core/src/slopfab/types.rs b/src-tauri/core/src/slopfab/types.rsindex 1946cbc..58d825e 100644--- a/src-tauri/core/src/slopfab/types.rs+++ b/src-tauri/core/src/slopfab/types.rs@@ -97,6 +97,9 @@ pub struct ImageEditStep {pub height: i32,#[serde(default)]pub feather: Option<i32>,+ /// Outpainting: preserve the box and generate all surrounding pixels together.+ #[serde(default)]+ pub invert_mask: bool,#[serde(default)]pub reference_paths: Option<Vec<String>>,#[serde(default)]diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rsindex 5a7c001..c129240 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -9,7 +9,9 @@ use std::collections::BTreeMap;pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";/// Bumped on any incompatible change to the routes or bodies below.-pub const PROTOCOL_VERSION: u32 = 2;+// v3 carries inverted image masks; older workers would silently edit the+// preserved original instead of the extension if they ignored this field.+pub const PROTOCOL_VERSION: u32 = 3;pub const DEFAULT_PORT: u16 = 47321;pub const TOKEN_HEADER: &str = "x-slopus-token";diff --git a/src/lib/extendImage.test.ts b/src/lib/extendImage.test.tsindex 5187f70..f067127 100644--- a/src/lib/extendImage.test.ts+++ b/src/lib/extendImage.test.ts@@ -28,14 +28,17 @@ it("rejects boxes with no original context, no extension, fractional or excessivexpect(large.x).toBeLessThan(0);});-it("regenerates every new pixel to the outer edge in all directions", () => {+it("generates the entire surround in one pass while preserving the original in all directions", () => {const config = createProjectConfig({ name: "Extend", prompt: "", aspectRatio: "1:1", resolution: "416p", targetDurationSeconds: 15 });const source = { id: "source", name: "Source", kind: "image" as const, mimeType: "image/png", width: 128, height: 96, createdAt: config.createdAt };for (const x of [-64, 0, 32]) for (const y of [-32, 0, 32]) {const { layout, edits } = compileExtendImage(config, source, "cache/canvas.png", { bounds: { x, y, width: 192, height: 128 }, prompt: "Forest", steps: 20, seed: 0 });+ expect(edits).toHaveLength(1);+ expect(edits[0]).toMatchObject({ ...layout.preserved, invertMask: true, feather: 0 });const contains = (r: { x: number; y: number; width: number; height: number }, px: number, py: number) => px >= r.x && py >= r.y && px < r.x + r.width && py < r.y + r.height;for (let py = 0; py < layout.output.height; py++) for (let px = 0; px < layout.output.width; px++) {- if (!contains(layout.preserved, px, py)) expect(edits.some((edit) => edit.feather === 0 && contains(edit, px, py))).toBe(true);+ const generated = edits[0].invertMask && !contains(edits[0], px, py);+ expect(generated).toBe(!contains(layout.preserved, px, py));}}});@@ -48,7 +51,7 @@ it("uses the positioned canvas as context and reserves picture labels only for cconst withoutReferences = compile("");expect(withoutReferences.prompt).toMatch(/^integrated_multimodal_description:/);expect(withoutReferences.prompt).not.toContain("<Picture");- expect(withoutReferences.prompt).toContain("Keep the existing scene at its current size and position");+ expect(withoutReferences.prompt).toContain("as if the view were zoomed out");expect(withoutReferences.edits.every((edit) => edit.prompt === withoutReferences.prompt)).toBe(true);config.references = [{ id: "mood", name: "Mood", kind: "text", content: "Misty woodland", description: "", intendedUse: [], createdAt: config.createdAt }];expect(compile("@[ref:mood]").prompt).not.toContain("<Picture");@@ -63,6 +66,14 @@ it("uses the positioned canvas as context and reserves picture labels only for cexpect(withReferences.prompt).not.toContain("<Picture 10>");});+it("rejects an extension with too little preserved image to condition the generation", () => {+ const config = createProjectConfig({ name: "Extend", prompt: "", aspectRatio: "1:1", resolution: "768p", targetDurationSeconds: 15 });+ const source = { id: "source", name: "Source", kind: "image" as const, mimeType: "image/png", width: 128, height: 96, createdAt: config.createdAt };+ expect(() => compileExtendImage(config, source, "cache/canvas.png", {+ bounds: { x: 120, y: 0, width: 192, height: 192 }, prompt: "", steps: 20, seed: 0,+ })).toThrow("Keep a larger area");+});+it("keeps selection and output on the generation grid without increasing the source pixel count", () => {const config = createProjectConfig({ name: "Extend", prompt: "", aspectRatio: "16:9", resolution: "2048p", targetDurationSeconds: 15 });for (const source of [{ width: 400, height: 300 }, { width: 3648, height: 2048 }, { width: 2048, height: 3648 }, { width: 8192, height: 8192 }]) {diff --git a/src/lib/extendImage.ts b/src/lib/extendImage.tsindex b19de54..82265e6 100644--- a/src/lib/extendImage.ts+++ b/src/lib/extendImage.ts@@ -85,20 +85,19 @@ export function extendRegions(source: { width: number; height: number }, bounds:export function compileExtendImage(config: ProjectConfig, source: ProjectAsset, sourceRelativePath: string, options: ExtendOptions) {if (!source.width || !source.height) throw new Error("Wait for the source image dimensions to load.");const layout = extendLayout(config, { width: source.width, height: source.height }, options.bounds);- const { regions, output } = layout;+ const { preserved, output } = layout;+ if (Math.ceil(preserved.x / 16) >= Math.floor((preserved.x + preserved.width) / 16)+ || Math.ceil(preserved.y / 16) >= Math.floor((preserved.y + preserved.height) / 16)) {+ throw new Error("Keep a larger area of the original image inside the Extend box.");+ }if (!Number.isInteger(options.steps) || options.steps < 2 || options.steps > 1000) throw new Error("Steps must be a whole number from 2 to 1000.");if (!Number.isSafeInteger(options.seed) || options.seed < -1) throw new Error("Seed must be -1 for random or a non-negative safe integer.");const scene = createImageEditScene({ relativePath: sourceRelativePath, name: source.name, ...output });scene.steps = options.steps; scene.seed = options.seed;- scene.nodes[0].description = "Fill the masked area beyond the edges of the existing image in the canvas. Continue the environment, objects, textures, perspective and lighting seamlessly into this new space with natural new detail. Keep the existing scene at its current size and position; do not repeat, enlarge or reframe it in the new area. " + options.prompt.trim();+ scene.nodes[0].description = "A wider view of the source scene, as if the view were zoomed out. Continue the same surroundings beyond the visible edges, matching perspective, scale, lighting and textures. One continuous scene, with the original content in its existing position. " + options.prompt.trim();const compiled = compileImagePrompt({ ...config, settings: { ...config.settings, defaultLook: null }, imageScene: scene }, { sourceTreatment: "outpaint" });- // The rectangular editor needs a little original context at each seam.- // The native finalizer restores the downscaled source pixels after generation.- const overlap = 32;- const edits = regions.map((region) => {- const x = Math.max(0, region.x - overlap), y = Math.max(0, region.y - overlap);- return { x, y, width: Math.min(output.width, region.x + region.width + overlap) - x,- height: Math.min(output.height, region.y + region.height + overlap) - y, prompt: compiled.prompt, feather: 0 };- });+ // Preserve the original throughout denoising while generating every new+ // region together. Separate border passes break shared context at the seams.+ const edits = [{ ...preserved, prompt: compiled.prompt, feather: 0, invertMask: true }];return { ...compiled, scene, edits, layout };}diff --git a/src/lib/extendWork.test.ts b/src/lib/extendWork.test.tsindex 38a9f39..c1833a4 100644--- a/src/lib/extendWork.test.ts+++ b/src/lib/extendWork.test.ts@@ -56,9 +56,8 @@ it.each([false, true])("extends a frozen source and saves a child with a durableconst { jobId } = request;expect(request).toMatchObject({ stillImage: true, frames: 1, seed: 0, steps: 25, canvasWidth: 128, canvasHeight: 64,imageEdit: { sourceRelativePath: `cache/extend-images/${jobId}/canvas.png` }, referencePaths: [] });- expect(request.imageEdit!.edits).toHaveLength(4);- expect(request.imageEdit!.edits.every((edit) => edit.feather === 0)).toBe(true);- expect(request.prompt).toContain("Fill the masked area beyond the edges of the existing image in the canvas");+ expect(request.imageEdit!.edits).toEqual([{ x: 38, y: 13, width: 51, height: 38, invertMask: true, feather: 0, prompt: request.prompt }]);+ expect(request.prompt).toContain("as if the view were zoomed out");expect(request.prompt).not.toContain("<Picture");expect(request.prompt).not.toContain("composition anchor");expect(request.prompt).toContain("Continue the forest");diff --git a/src/lib/imageEditing.ts b/src/lib/imageEditing.tsindex 977df95..c80fea4 100644--- a/src/lib/imageEditing.ts+++ b/src/lib/imageEditing.ts@@ -5,6 +5,8 @@ import type { ProjectConfig, ProjectReference } from "./project";export interface ImageEditStep {prompt: string; x: number; y: number; width: number; height: number;feather?: number;+ /** Preserve this box and generate its surround in a single outpainting pass. */+ invertMask?: boolean;referencePaths?: string[];refmods?: Array<{ path: string; strength: number; copies: number }>;}diff --git a/src/lib/imagePrompt.ts b/src/lib/imagePrompt.tsindex 82e7730..50cf0fd 100644--- a/src/lib/imagePrompt.ts+++ b/src/lib/imagePrompt.ts@@ -44,7 +44,7 @@ export function compileImagePrompt(config: ProjectConfig, options: { referenceTr}).join("");const visual = { style: cite(parts.style), composition: cite(parts.composition) };const style = outpainting- ? "The still image continues the visual medium, lighting, palette and perspective of the existing image in the canvas."+ ? "Match the source scene's visual style.": 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 {