AI media harness for planning, generating, and editing locally
TypeScript
Add Fibo Base and template editing controls
Bittieae19ac160bf
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 33c4f42..6c63287 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -4,7 +4,9 @@ This alpha update adds Prompt video scenes, agent image drafts, Sol attention an## What's new-- **Image negative prompts.** MOSS exposes a Negative prompt field below the image root prompt, saved per model with drafts and generated images and applied during local or LAN generation. Fibo Turbo shows the field disabled because its single positive prediction does not support negative prompts. Visibility and support are controlled by model settings. Update LAN workers to protocol 16.+- **Fibo 2.0 Base and editing capabilities.** Added the Base generator with the Dev transformer and shared Fibo encoder/VAE. A per-template Editing model switch controls image editing and Zoom, defaults off for Base and MOSS, and is preserved when sharing templates. Fibo Edit Turbo now supports Zoom with masked border generation that preserves the source image.++- **Image negative prompts.** MOSS exposes a Negative prompt field below the image root prompt, saved per model with drafts and generated images and applied during local or LAN generation. Fibo Turbo shows the field disabled because its single positive prediction does not support negative prompts. Visibility and support are controlled by model settings. Update LAN workers to protocol 17.- **Fibo 2.0 image editing.** Added an Edit Turbo generator with transformer, Qwen3-VL encoder and Flux2 VAE downloads. Generate directly from a text prompt, use whole-image, box or lasso edits, or cite up to four images in a new image prompt. Defaults to four steps on CUDA; unsupported video and H3-only controls are disabled.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex 46bd74a..b4504f6 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -471,7 +471,7 @@ CUDA/Vulkan numerical output and render performance were not revalidated here.## Fibo 2.0 (API 1.34)The bundled Windows and Linux libraries are updated to Slopfab commit `0a902eb`-(API 1.36.0), built with FFmpeg disabled. LAN protocol 16 requires updated workers.+(API 1.36.0), built with FFmpeg disabled. LAN protocol 17 requires updated workers.The `fibo2` model uses the Edit Turbo transformer, Qwen3-VL 4B text encoder andFlux2 VAE. The tokenizer is embedded, and no audio VAE is needed. The generator@@ -484,7 +484,7 @@ optional structured edit JSON pass through without H3 prompt sections. Lassooutlines use the same native masks as H3, including compound contours.Shared model capabilities disable video, extra references-on source edits, Zoom, character sheets, LoRAs/refmods, MotionCache, CFG, LCS and+on source edits, character sheets, LoRAs/refmods, MotionCache, CFG, LCS andH3 sampling overrides. Native request validation enforces the same constraintsfor local and LAN jobs.@@ -519,3 +519,24 @@ skips vision feature injection when there are no image tokens. Verificationincludes a real Windows CUDA four-step text-only generation, finite RGB output,cancellation, and Linux text-only planning. LAN protocol 16 requires workerswith the same source-free Fibo support.++## Fibo Base and Zoom++The Fibo 2.0 Base template uses `fibo2_dev_int8_convrot.safetensors` with the same+Qwen3-VL encoder and Flux2 VAE as Edit Turbo. The per-template `editingModel`+setting defaults off for Base and MOSS and on for Edit Turbo. Legacy templates+inherit their model family's editing capability. Settings, portable `.slop`+files, agent commands and generation requests preserve this flag; both the UI+and native validation prevent editing when it is off. Family capabilities still+limit unsupported operations, including MOSS editing.++Fibo Edit Turbo Zoom generates borders using an explicit even-odd mask: the+output canvas minus the preserved source rectangle. It uses plain Fibo prompts,+without H3 inverted-mask conditioning, Langevin controls or duplicate image+references. Crop-only Zoom uses whole-image refinement at strength 0.65.+The existing runtime (API 1.36.0) supports these masks without a library update.+LAN protocol 17 enforces template editing capabilities on workers.++Validation covers migration, sharing, editing controls, queued requests and+native planning, plus a real four-step CUDA border-mask generation that checks+finite output, exact preserved center pixels and cancellation.diff --git a/src-tauri/core/src/slopfab/config.rs b/src-tauri/core/src/slopfab/config.rsindex fa60651..140a213 100644--- a/src-tauri/core/src/slopfab/config.rs+++ b/src-tauri/core/src/slopfab/config.rs@@ -25,6 +25,7 @@ pub(super) struct SigmaShifts {#[derive(Clone)]pub(super) struct Configuration {pub(super) model_type: String,+ pub(super) editing_model: bool,pub(super) dll_path: PathBuf,pub(super) vulkan: bool,pub(super) attention: &'static str,@@ -64,6 +65,7 @@ impl Configuration {}};Self {+ editing_model: !matches!(slopfab.and_then(|setting| setting.options.get("editingModel")), Some(ProviderOption::Boolean(false))),model_type: string_option("modelType").unwrap_or("minimax-h3").to_owned(),sigma_shifts: (|| Ok(SigmaShifts { video: shift("videoSigmaShift")?, audio: shift("audioSigmaShift")?,video_override: shift("videoSigmaShiftOverride")?, audio_override: shift("audioSigmaShiftOverride")? }))(),@@ -138,8 +140,8 @@ impl Configuration {if request.still_image && !features.image_generation || !request.still_image && !features.video_generation {return Err(format!("{} does not support {} generation.", features.label, if request.still_image { "image" } else { "video" }));}- if !features.image_editing && request.image_edit.is_some() {- return Err(format!("{} does not support image editing.", features.label));+ if (!features.image_editing || !self.editing_model) && request.image_edit.is_some() {+ return Err(format!("This {} generator does not support image editing.", features.label));}if features.requires_image_input && request.image_edit.is_none() && request.reference_paths.is_empty() {return Err(format!("{} requires a source image or image references.", features.label));@@ -154,6 +156,9 @@ impl Configuration {if !features.edit_image_references && (!request.reference_paths.is_empty() || edit.edits.iter().any(|step| step.reference_paths.as_ref().is_some_and(|paths| !paths.is_empty()))) {return Err(format!("{} edits use exactly one source image without additional image references.", features.label));}+ if self.model_type == "fibo2" && edit.edits.iter().any(|step| step.invert_mask) {+ return Err("Fibo outpainting requires an explicit mask rather than H3 inverted-mask conditioning.".into());+ }if !features.image_outpainting && edit.edits.iter().any(|step| step.invert_mask) {return Err(format!("{} does not support Zoom or outpainting.", features.label));}diff --git a/src-tauri/core/src/slopfab/icons.rs b/src-tauri/core/src/slopfab/icons.rsindex 1dca332..851cce6 100644--- a/src-tauri/core/src/slopfab/icons.rs+++ b/src-tauri/core/src/slopfab/icons.rs@@ -110,6 +110,7 @@ pub fn generate_reference_icon_batch(};let configuration = Configuration {model_type: "minimax-h3".into(),+ editing_model: true,dll_path: batch.dll_path.clone(),loras: Ok(Vec::new()),step_override: Ok(None),diff --git a/src-tauri/core/src/slopfab/tests.rs b/src-tauri/core/src/slopfab/tests.rsindex 72395c6..bbf00a5 100644--- a/src-tauri/core/src/slopfab/tests.rs+++ b/src-tauri/core/src/slopfab/tests.rs@@ -1601,7 +1601,7 @@ fn fibo_planning_and_execution_requests_keep_the_image_family_and_masks() {configuration.model_type = "fibo2".into();configuration.attention = "flash2";let api = ffi::Api::load(&configuration.dll_path).unwrap();- for mask in [false, true] {+ for mask in 0..3 {let mut request: GenerationRequest = serde_json::from_value(serde_json::json!({"jobId":"fibo", "prompt":"Make the object blue", "stillImage":true, "frames":1, "steps":4, "seed":1,"canvasWidth":64, "canvasHeight":96,@@ -1609,13 +1609,23 @@ fn fibo_planning_and_execution_requests_keep_the_image_family_and_masks() {"prompt":"Make the object blue", "x":0, "y":0, "width":64, "height":96, "feather":0}]}})).unwrap();- if mask {+ if mask == 1 {request.image_edit.as_mut().unwrap().edits[0].mask_polygon = Some(vec![crate::image_mask::MaskPoint { x: 0.0, y: 0.0 },crate::image_mask::MaskPoint { x: 32.0, y: 0.0 },crate::image_mask::MaskPoint { x: 0.0, y: 32.0 },]);}+ if mask == 2 {+ let contours = vec![(0.0, 0.0, 64.0, 96.0), (16.0, 24.0, 48.0, 72.0)].into_iter()+ .map(|(x, y, right, bottom)| vec![(x,y), (right,y), (right,bottom), (x,bottom)].into_iter()+ .map(|(x,y)| crate::image_mask::MaskPoint { x, y }).collect()).collect::<Vec<_>>();+ let coverage = crate::image_mask::rasterize_contours(&contours, 64, 96).unwrap();+ for y in 0..96 { for x in 0..64 {+ assert_eq!(coverage[y * 64 + x], if (16..48).contains(&x) && (24..72).contains(&y) { 0 } else { 255 });+ }}+ request.image_edit.as_mut().unwrap().edits[0].mask_contours = Some(contours);+ }request.image_edit_pixels = Some(std::sync::Arc::new(vec![100; 64 * 96 * 3]));for purpose in [RequestPurpose::Plan, RequestPurpose::Generate] {let handle = RequestHandle::new(&api).unwrap();@@ -1698,3 +1708,21 @@ fn fibo_text_only_requests_resolve_without_source_images() {assert_eq!((plan.canvas_width, plan.canvas_height, plan.aligned_frames, plan.num_model_evaluations), (256, 384, 1, 4));}}++#[test]+fn template_editing_flag_is_enforced_without_blocking_text_generation() {+ let mut settings: BTreeMap<String, ProviderSetting> = serde_json::from_value(serde_json::json!({+ "slopfab": {"enabled":true, "model":null, "options":{"modelType":"fibo2", "attention":"flash2", "editingModel":false}}+ })).unwrap();+ let configuration = Configuration::from_settings(&settings);+ let mut request = GenerationRequest { still_image: true, frames: 1, steps: 4, prompt: "A forest".into(), canvas_width: 64, canvas_height: 96, ..Default::default() };+ configuration.validate_inputs(&request).unwrap();+ request.image_edit = Some(serde_json::from_value(serde_json::json!({"sourceRelativePath":"source.png", "edits":[{+ "prompt":"Make it blue", "x":0, "y":0, "width":64, "height":96+ }]})).unwrap());+ assert!(configuration.validate_inputs(&request).unwrap_err().contains("does not support image editing"));+ settings.get_mut("slopfab").unwrap().options.insert("editingModel".into(), crate::settings::ProviderOption::Boolean(true));+ Configuration::from_settings(&settings).validate_inputs(&request).unwrap();+ settings.get_mut("slopfab").unwrap().options.remove("editingModel");+ Configuration::from_settings(&settings).validate_inputs(&request).unwrap();+}diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rsindex aa8cf4c..f08e48c 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -9,6 +9,7 @@ use std::collections::BTreeMap;pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";/// Bumped on any incompatible change to the routes or bodies below.+// v17 enforces per-template editing capability and enables masked Fibo Zoom.// v16 enables Fibo text-to-image; older workers require source images.// v15 carries image negative prompts; older workers would silently discard them.// v14 adds Fibo model routing, validation and image-only weights.@@ -22,7 +23,7 @@ pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";// v6 added custom upscale weights.// v5 added overlap locking.// v4 added SeedVR2 export streams. v3 added inverted image masks.-pub const PROTOCOL_VERSION: u32 = 16;+pub const PROTOCOL_VERSION: u32 = 17;/// Streaming SeedVR2 restoration; model paths are resolved on the worker.#[derive(Debug, Clone, Serialize, Deserialize)]diff --git a/src-tauri/src/agent/generators.rs b/src-tauri/src/agent/generators.rsindex acd0755..302cf8f 100644--- a/src-tauri/src/agent/generators.rs+++ b/src-tauri/src/agent/generators.rs@@ -44,6 +44,7 @@ pub enum GeneratorRead {pub struct GeneratorPatch {pub name: Option<String>,pub model_type: Option<String>,+ pub editing_model: Option<bool>,pub default_steps: Option<u32>,pub attention: Option<String>,pub mode: Option<String>,@@ -271,8 +272,14 @@ pub(crate) fn prepare(template["motionCache"] = json!(false);template["loras"] = json!([]);}+ if add || template["modelType"] != model.as_str() {+ template["editingModel"] = json!(model != "moss");+ }template["modelType"] = json!(model);}+ if let Some(editing) = patch.editing_model {+ template["editingModel"] = json!(editing);+ }if let Some(steps) = patch.default_steps {if !(2..=i32::MAX as u32).contains(&steps) {return Err("defaultSteps must be 2..2147483647.".into());diff --git a/src-tauri/src/agent/tests_generators.rs b/src-tauri/src/agent/tests_generators.rsindex db578a8..4f48fed 100644--- a/src-tauri/src/agent/tests_generators.rs+++ b/src-tauri/src/agent/tests_generators.rs@@ -333,3 +333,13 @@ fn fibo_generator_uses_image_defaults_and_needs_no_audio_or_tokenizer() {assert_eq!(template["defaultSteps"], 4);assert_eq!(template["attention"], "flash2");}++#[test]+fn generator_editing_flag_survives_agent_changes() {+ let context = prepare(&GeneratorContext::default(), &[command(json!({"op":"generator.add", "id":"fibo-base",+ "settings":{"name":"Fibo Base", "modelType":"fibo2", "editingModel":false}}))]).unwrap();+ assert_eq!(context.settings["templates"][0]["editingModel"], false);+ let updated = prepare(&context, &[command(json!({"op":"generator.set", "id":"fibo-base",+ "settings":{"editingModel":true}}))]).unwrap();+ assert_eq!(updated.settings["templates"][0]["editingModel"], true);+}diff --git a/src/components/SettingsView.test.tsx b/src/components/SettingsView.test.tsxindex 80b6283..d7d7d5e 100644--- a/src/components/SettingsView.test.tsx+++ b/src/components/SettingsView.test.tsx@@ -136,6 +136,17 @@ describe("the settings screen", () => {expect(screen.getByRole("list", { name: "Other weights" })).toBeTruthy();});+ it("persists the editing switch for Fibo Base", () => {+ open("Fibo 2.0");+ fireEvent.click(screen.getByRole("button", { name: "Edit Fibo 2.0 Base generator" }));+ const toggle = screen.getByRole("switch", { name: "Editing model" });+ expect(toggle.getAttribute("aria-checked")).toBe("false");+ fireEvent.click(toggle);+ expect(loadGeneratorTemplateSettings().templates.find(({ id }) => id === "fibo2-base")!.editingModel).toBe(true);+ fireEvent.click(toggle);+ expect(loadGeneratorTemplateSettings().templates.find(({ id }) => id === "fibo2-base")!.editingModel).toBe(false);+ });+it("offers Fibo settings with embedded tokenizer and no H3-only controls", () => {open("Fibo 2.0");fireEvent.click(screen.getByRole("button", { name: "Edit Fibo 2.0 Edit Turbo generator" }));diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsxindex 8f4dd89..b3f6ce7 100644--- a/src/components/SettingsView.tsx+++ b/src/components/SettingsView.tsx@@ -449,7 +449,7 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBarprobe({ ...EMPTY_ENGINE_SETTINGS });};- const updateTemplate = (updates: Partial<Pick<typeof selectedTemplate, "modelType" | "name" | "defaultSteps" | "videoSigmaShift" | "audioSigmaShift" | "attention" | "motionCache" | "loras" | "mode" | "additionalSafetensors">>) => {+ const updateTemplate = (updates: Partial<Pick<typeof selectedTemplate, "editingModel" | "modelType" | "name" | "defaultSteps" | "videoSigmaShift" | "audioSigmaShift" | "attention" | "motionCache" | "loras" | "mode" | "additionalSafetensors">>) => {setTemplateSettings((current) => {const next = {...current,@@ -578,12 +578,17 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBar<ComboBox aria-label="Generator model" value={selectedTemplate.modelType} options={[...GENERATOR_MODELS,...(!GENERATOR_MODELS.some(({ value }) => value === selectedTemplate.modelType) ? [{ value: selectedTemplate.modelType, label: selectedTemplate.modelType }] : []),- ]} onChange={(modelType) => updateTemplate({ modelType, ...(modelType === MOSS_MODEL_TYPE || modelType === FIBO_MODEL_TYPE ? { mode: "prompt", attention: "flash2", defaultSteps: modelType === FIBO_MODEL_TYPE ? 4 : 50, motionCache: false, loras: [], audioSigmaShift: undefined, ...(modelType === FIBO_MODEL_TYPE ? { videoSigmaShift: undefined } : {}) } : {}) })} />+ ]} onChange={(modelType) => updateTemplate({ modelType, editingModel: generatorModel(modelType).imageEditing, ...(modelType === MOSS_MODEL_TYPE || modelType === FIBO_MODEL_TYPE ? { mode: "prompt", attention: "flash2", defaultSteps: modelType === FIBO_MODEL_TYPE ? 4 : 50, motionCache: false, loras: [], audioSigmaShift: undefined, ...(modelType === FIBO_MODEL_TYPE ? { videoSigmaShift: undefined } : {}) } : {}) })} /></SettingsCard>{generatorModel(selectedTemplate.modelType).videoGeneration && <SettingsCard icon={<Video20 />} header="Mode"><ComboBox aria-label="Generator mode" value={selectedTemplate.mode ?? "prompt"} onChange={(value) => updateTemplate({ mode: value === "animate" ? "animate" : "prompt" })}options={[{ value: "prompt", label: "Text prompt" }, { value: "animate", label: "Animate (reference video)" }]} /></SettingsCard>}+ <SettingsCard icon={<Options20 />} header="Editing model" description="Enable image editing and Zoom for weights that support editing.">+ <ToggleSwitch aria-label="Editing model" checked={generatorModel(selectedTemplate.modelType).imageEditing && selectedTemplate.editingModel !== false}+ disabled={!generatorModel(selectedTemplate.modelType).imageEditing || selectedTemplate.mode === "animate"}+ onChange={(editingModel) => updateTemplate({ editingModel })} />+ </SettingsCard><SettingsCard icon={<Steps20 />} header="Default steps"><input className="text-field settings-field settings-field--number" aria-label="Generator default steps" type="number" min={2} max={MAX_GENERATION_STEPS} step={1} value={selectedTemplate.defaultSteps} onChange={(event) => {const value = Number(event.target.value);diff --git a/src/components/workspace/ImageEditor.test.tsx b/src/components/workspace/ImageEditor.test.tsxindex f030d5c..5365476 100644--- a/src/components/workspace/ImageEditor.test.tsx+++ b/src/components/workspace/ImageEditor.test.tsx@@ -8,7 +8,7 @@ import { ImageEditor } from "./ImageEditor";import { choose, comboValue } from "./comboTestUtils";import { imageGenerationSnapshotSchema, parseProjectConfig, referenceImages, sceneFrameInputs, type ProjectConfig } from "../../lib/project";import { completeImageDraft, createTemplateImageDraft, imageGenerationSnapshot, restoreGeneratedImage, saveImageDraft } from "../../lib/imageHistory";-import { createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, defaultGeneratorTemplate, saveGeneratorTemplateSettings } from "../../lib/settings";+import { createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, fiboBaseTemplate, defaultGeneratorTemplate, saveGeneratorTemplateSettings } from "../../lib/settings";import { createImageEditScene, createImageScene, imageScenePrompt } from "../../lib/imageScene";import type { WorkItem } from "../../lib/workQueue";import { compileImageEdits } from "../../lib/imageEditing";@@ -85,7 +85,7 @@ it("allows Fibo text-to-image and editing while disabling unsupported templates"expect(screen.getByRole("radio", { name: "Lasso" })).toBeEnabled();expect(screen.queryByRole("spinbutton", { name: "CFG" })).not.toBeInTheDocument();fireEvent.click(screen.getByRole("button", { name: "Template" }));- expect(screen.getByRole("menuitem", { name: "Zoom" })).toBeDisabled();+ expect(screen.getByRole("menuitem", { name: "Zoom" })).toBeEnabled();expect(screen.getByRole("menuitem", { name: "Character sheet" })).toBeDisabled();});@@ -1363,3 +1363,24 @@ it("uses Fibo's four-step default for fresh images and imports, preserving savedfireEvent.change(screen.getByLabelText("Steps"), { target: { value: "8" } });expect(latest().imageScene!.steps).toBe(8);});++it.each([fiboBaseTemplate(), { ...fiboImageTemplate(), editingModel: false }])("disables editing and Zoom for $name when editing is off", (template) => {+ vi.spyOn(persistence, "isTauri").mockReturnValue(true);+ const usable = { ...template, sources: {}, paths: { transformer: "fibo", textEncoder: "qwen", videoVae: "flux", tokenizer: "", audioVae: "" } };+ saveGeneratorTemplateSettings({ templates: [usable], defaultTemplateId: usable.id, catalogVersion: 15 });+ const initial = parseProjectConfig(fixture);+ initial.imageScene = createImageScene("A forest");+ setup(initial);+ expect(screen.getByRole("button", { name: "Generate" })).toBeEnabled();+ cleanup();+ const source = { id: "source", kind: "image" as const, name: "Source", relativePath: "media/source.png", width: 512, height: 512, mimeType: "image/png", createdAt: initial.createdAt };+ initial.assets = [source];+ initial.imageScene = { ...createImageEditScene(source), outputAssetId: source.id };+ initial.imageScene.nodes[0].description = "Make it blue";+ setup(initial);+ expect(screen.getByRole("button", { name: "Generate" })).toBeDisabled();+ expect(screen.getByRole("radio", { name: "Edit Box" })).toBeDisabled();+ expect(screen.getByRole("radio", { name: "Lasso" })).toBeDisabled();+ fireEvent.click(screen.getByRole("button", { name: "Template" }));+ expect(screen.getByRole("menuitem", { name: "Zoom" })).toBeDisabled();+});diff --git a/src/components/workspace/ImageEditor.tsx b/src/components/workspace/ImageEditor.tsxindex 5e6bb5d..0e975b3 100644--- a/src/components/workspace/ImageEditor.tsx+++ b/src/components/workspace/ImageEditor.tsx@@ -13,7 +13,7 @@ import { compileImagePrompt } from "../../lib/imagePrompt";import { createEmptyImage, imageFamily, imageFamilyRoot, makeImagePrimary, removeImageAsset, restoreGeneratedImage, saveImageDraft } from "../../lib/imageHistory";import { isTauri } from "../../lib/persistence";import { createDraftGenerationJob, isVideoReference, PROJECT_RESOLUTIONS, referenceTypeLabel, type ProjectConfig, type ProjectReference } from "../../lib/project";-import { defaultGeneratorTemplate, selectedImageGeneratorTemplate, generationStepsForTemplate, loadDebugOptionsEnabled, loadGeneratorTemplateSettings, MINIMAX_H3_MODEL_TYPE, generatorModel, templateSupportsImages, subscribeDebugOptions, subscribeGeneratorTemplates, templateUsable, type GeneratorTemplate } from "../../lib/settings";+import { defaultGeneratorTemplate, selectedImageGeneratorTemplate, generationStepsForTemplate, loadDebugOptionsEnabled, loadGeneratorTemplateSettings, MINIMAX_H3_MODEL_TYPE, generatorModel, templateSupportsImages, templateSupportsEditing, templateSupportsOutpainting, subscribeDebugOptions, subscribeGeneratorTemplates, templateUsable, type GeneratorTemplate } from "../../lib/settings";import { isWorkActive, MAX_IMAGE_BATCH_COUNT, type WorkItem } from "../../lib/workQueue";import type { ConfigUpdate } from "./TimelineView";import { ReferenceImage } from "./ReferenceImage";@@ -110,9 +110,9 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGenetry { compileImagePrompt(config, { modelType: template?.modelType }); return null; }catch (reason) { return reason instanceof Error ? reason.message : String(reason); }}, [config, imageRoot, model.requiresImageInput, template?.modelType]);- const outpaintingBlocked = !model.imageOutpainting ? `${model.label} does not support Zoom.` : null;+ const outpaintingBlocked = !templateSupportsOutpainting(template) ? `${template.name} does not support Zoom.` : null;const effectsBlocked = activeGenerationEffects(scene.generationEffects) && !model.generationEffects ? "This model does not support generation effects. Bypass or remove the effects, or choose another generator." : null;- const editingBlocked = !model.imageEditing ? `${model.label} does not support image editing. Choose an editing generator.` : null;+ const editingBlocked = !templateSupportsEditing(template) ? `${template.name} does not support image editing. Choose an editing generator.` : null;const referencesBlocked = !model.characterSheets ? `${model.label} does not support character sheets. Choose a character sheet generator.` : null;const creationBlocked = !imageRoot && !model.imageCompositionCreation;const isMiniMaxH3 = !template || template.modelType === MINIMAX_H3_MODEL_TYPE;@@ -633,7 +633,7 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGenevalue={template?.id ?? ""}disabled={Boolean(active) || !imageTemplates.length}placeholder="No image generators"- options={imageTemplates.map((item) => ({ value: item.id, label: item.name, disabled: !templateUsable(item) || (imageRoot && !generatorModel(item.modelType).imageEditing), description: imageRoot && !generatorModel(item.modelType).imageEditing ? "Does not support editing" : !templateUsable(item) ? "Download in Settings" : undefined }))}+ options={imageTemplates.map((item) => ({ value: item.id, label: item.name, disabled: !templateUsable(item) || (imageRoot && !templateSupportsEditing(item)), description: imageRoot && !templateSupportsEditing(item) ? "Does not support editing" : !templateUsable(item) ? "Download in Settings" : undefined }))}onChange={(id) => { setTemplateId(id); localStorage.setItem("slopus.image-generator-template.v1", id); const next = imageTemplates.find((candidate) => candidate.id === id); if (next) commit({ ...scene, steps: next.defaultSteps }); }}/></span>diff --git a/src/lib/agentGenerators.ts b/src/lib/agentGenerators.tsindex a1ccbe1..049e3ee 100644--- a/src/lib/agentGenerators.ts+++ b/src/lib/agentGenerators.ts@@ -3,7 +3,7 @@ import { loadLoras, saveLoras, type Lora } from "./loras";import { loadGeneratorTemplateSettings, saveGeneratorTemplateSettings, type GeneratorTemplate, type GeneratorTemplateSettings } from "./settings";export interface GeneratorContext { settings: GeneratorTemplateSettings; loras: Lora[] }-export type GeneratorPatch = Partial<Pick<GeneratorTemplate, "name" | "modelType" | "defaultSteps" | "attention" | "mode" | "motionCache" | "loras">>+export type GeneratorPatch = Partial<Pick<GeneratorTemplate, "name" | "modelType" | "editingModel" | "defaultSteps" | "attention" | "mode" | "motionCache" | "loras">>& { paths?: Partial<GeneratorTemplate["paths"]> };export type GeneratorCommand =| { op: "generator.add" | "generator.set"; id: string; settings: GeneratorPatch; makeDefault?: boolean }diff --git a/src/lib/extendImage.test.ts b/src/lib/extendImage.test.tsindex a3e5b3c..e9383e8 100644--- a/src/lib/extendImage.test.ts+++ b/src/lib/extendImage.test.ts@@ -139,7 +139,7 @@ it("limits the blend for small source intersections without erasing their intericonst source = { id: "source", name: "Source", kind: "image" as const, mimeType: "image/png", width, height: width, createdAt: config.createdAt };const { edits: [edit] } = compileExtendImage(config, source, "cache/canvas.png",{ bounds: { x: -32, y: -32, width: 416, height: 416 }, prompt: "", steps: 30, seed: 0 });- if (!("outpaintBlendOverlap" in edit)) throw new Error("Expected an outpaint edit");+ if (edit.outpaintBlendOverlap === undefined) throw new Error("Expected an outpaint edit");expect(edit.outpaintBlendOverlap).toBeGreaterThanOrEqual(1);expect(edit.outpaintBlendOverlap).toBeLessThanOrEqual(33);expect(edit.outpaintBlendOverlap % 2).toBe(1);@@ -184,3 +184,29 @@ it("rejects an extension that disappears when mapped to a lower resolution", ()const config = createProjectConfig({ name: "Extend", prompt: "", aspectRatio: "1:1", resolution: "416p", targetDurationSeconds: 15 });expect(() => extendLayout(config, { width: 1024, height: 1024 }, { x: -1, y: 0, width: 1024, height: 1024 })).toThrow("Expand the box further");});++it("extends Fibo with a border mask and refines crops without H3 conditioning", () => {+ const config = createProjectConfig({ name: "Zoom", 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 bounds of [{ x: -32, y: -32, width: 192, height: 160 }, { x: 0, y: 0, width: 192, height: 96 }, { x: 32, y: 0, width: 64, height: 64 }]) {+ const result = compileExtendImage(config, source, "cache/canvas.png", { bounds, prompt: "A forest", steps: 4, seed: 1 }, "fibo2");+ const edit = result.edits[0];+ expect(result.references).toEqual([]);+ expect(result.prompt).toContain("A forest");+ expect(result.prompt).not.toMatch(/Picture|Source scene|Shot|overall_soundscape/);+ expect(edit.invertMask).toBe(false);+ expect(edit.outpaintLangevinSteps).toBeUndefined();+ expect(edit.outpaintBlendOverlap).toBeUndefined();+ if (result.layout.mode === "regenerate") {+ expect(edit.strength).toBe(0.65);+ expect(edit.maskContours).toBeUndefined();+ } else {+ const { width, height } = result.layout.output;+ const { x, y, width: w, height: h } = result.layout.preserved;+ expect(edit.maskContours).toEqual([+ [{ x: 0, y: 0 }, { x: width, y: 0 }, { x: width, y: height }, { x: 0, y: height }],+ [{ x, y }, { x: x + w, y }, { x: x + w, y: y + h }, { x, y: y + h }],+ ]);+ }+ }+});diff --git a/src/lib/extendImage.ts b/src/lib/extendImage.tsindex c643b39..e5ef119 100644--- a/src/lib/extendImage.ts+++ b/src/lib/extendImage.ts@@ -1,3 +1,5 @@+import { FIBO_MODEL_TYPE, MINIMAX_H3_MODEL_TYPE } from "./settings";+import type { ImageEditStep } from "./imageEditing";import { imageSettings } from "./imageSettings";import { createImageEditScene } from "./imageScene";import { compileImagePrompt } from "./imagePrompt";@@ -112,23 +114,33 @@ function extendBlendOverlap(context: ExtendBounds, output: { width: number; heigreturn Math.floor(band / 2) * 2 + 1;}-export function compileExtendImage(config: ProjectConfig, source: ProjectAsset, sourceRelativePath: string, options: ExtendOptions) {+export function compileExtendImage(config: ProjectConfig, source: ProjectAsset, sourceRelativePath: string, options: ExtendOptions, modelType = MINIMAX_H3_MODEL_TYPE) {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 { preserved, output } = layout;const regenerate = layout.mode === "regenerate";- const context = regenerate ? preserved : extendContext(preserved);+ const fibo = modelType === FIBO_MODEL_TYPE;+ const context = regenerate || fibo ? preserved : extendContext(preserved);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 = (regenerate+ scene.nodes[0].description = (fibo+ ? regenerate ? "Refine the selected crop, preserving its subjects, composition, lighting and style. " : "Extend the image into the blank borders, continuing its scene, perspective, lighting and textures. Preserve the existing subjects and their positions. "+ : regenerate? "Refine the selected crop in <Picture 1> at the target resolution. Recover natural fine detail and clean textures while preserving the subjects, composition, perspective, lighting and visual style. ": "One continuous scene matching Source scene's setting, perspective, subject scale, lighting and textures. The existing subjects remain at their canvas positions. ") + options.prompt.trim();- const compiled = compileImagePrompt({ ...config, imageSettings: { ...imageSettings(config), defaultLook: null }, imageScene: scene }, regenerate ? {} : { sourceTreatment: "outpaint" });+ const compiled = compileImagePrompt({ ...config, imageSettings: { ...imageSettings(config), defaultLook: null }, imageScene: scene }, { modelType, ...(!regenerate && !fibo ? { sourceTreatment: "outpaint" as const } : {}) });// Outpainting locks the interior and generates all borders together. Crops// refine the whole frame with partial denoising to retain the composition.- const edits = [{ ...context, prompt: compiled.prompt, feather: 0, invertMask: !regenerate,- ...(regenerate ? { strength: 0.65 } : { outpaintBlendOverlap: extendBlendOverlap(context, output), outpaintLangevinSteps: ZOOM_LANGEVIN_STEPS }) }];+ const edits: ImageEditStep[] = [{ ...context, prompt: compiled.prompt, feather: 0, invertMask: !regenerate && !fibo,+ ...(regenerate ? { strength: 0.65 } : fibo ? {+ // Fibo uses an explicit mask: the outer canvas with the source cut out.+ // This keeps source pixels intact without H3's inverted-mask conditioning.+ x: 0, y: 0, ...output,+ maskContours: [{ x: 0, y: 0, ...output }, preserved].map(({ x, y, width, height }) => [+ { x, y }, { x: x + width, y }, { x: x + width, y: y + height }, { x, y: y + height },+ ]),+ } : { outpaintBlendOverlap: extendBlendOverlap(context, output), outpaintLangevinSteps: ZOOM_LANGEVIN_STEPS }) }];return { ...compiled, scene, edits, layout };}diff --git a/src/lib/generatorModels.json b/src/lib/generatorModels.jsonindex 5be5164..38add48 100644--- a/src/lib/generatorModels.json+++ b/src/lib/generatorModels.json@@ -58,7 +58,7 @@"motionCache": false,"generationEffects": false,"cfg": null,- "imageOutpainting": false,+ "imageOutpainting": true,"characterSheets": false,"requiresImageInput": false,"editImageReferences": false,diff --git a/src/lib/settings.test.ts b/src/lib/settings.test.tsindex d015046..308f46f 100644--- a/src/lib/settings.test.ts+++ b/src/lib/settings.test.ts@@ -4,7 +4,7 @@ import { beforeEach, describe, expect, it } from "vitest";import { TURBO_LORA, VIGGLE_ANIMATE_LORA, loadLoras, saveLoras } from "./loras";import {agentEndpointProviderSettings,- selectedImageGeneratorTemplate, createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, defaultGeneratorTemplate, generatorPathFields, templateSupportsVideo,+ selectedImageGeneratorTemplate, createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, fiboBaseTemplate, templateSupportsEditing, templateSupportsOutpainting, defaultGeneratorTemplate, generatorPathFields, templateSupportsVideo,engineProviderSetting,loadInferenceBackend,saveInferenceBackend,@@ -47,7 +47,7 @@ describe("generator templates", () => {const custom = createGeneratorTemplate("Custom");saveGeneratorTemplateSettings({ templates: [custom], defaultTemplateId: custom.id, catalogVersion: 13 });const migrated = loadGeneratorTemplateSettings();- expect(migrated.templates).toEqual([expect.objectContaining(custom), fiboImageTemplate()]);+ expect(migrated.templates).toEqual([expect.objectContaining(custom), fiboImageTemplate(), fiboBaseTemplate()]);expect(migrated.defaultTemplateId).toBe(custom.id);expect(loadGeneratorTemplateSettings()).toEqual(migrated);saveGeneratorTemplateSettings({ ...migrated, templates: [custom] });@@ -75,7 +75,7 @@ describe("generator templates", () => {const custom = createGeneratorTemplate("Custom");saveGeneratorTemplateSettings({ templates: [custom], defaultTemplateId: custom.id, catalogVersion: 9 });const migrated = loadGeneratorTemplateSettings();- expect(migrated.templates).toEqual([expect.objectContaining(custom), mossImageTemplate(), fiboImageTemplate()]);+ expect(migrated.templates).toEqual([expect.objectContaining(custom), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);expect(migrated.defaultTemplateId).toBe(custom.id);expect(loadGeneratorTemplateSettings()).toEqual(migrated);saveGeneratorTemplateSettings({ ...migrated, templates: [custom] });@@ -99,7 +99,7 @@ describe("generator templates", () => {it("assigns MiniMax H3 to current and legacy generators and preserves future model types", () => {expect(createGeneratorTemplate().modelType).toBe("minimax-h3");- expect(loadGeneratorTemplateSettings().templates.filter((template) => ! ["moss-image", "fibo2-edit-turbo"].includes(template.id)).every((template) => template.modelType === "minimax-h3")).toBe(true);+ expect(loadGeneratorTemplateSettings().templates.filter((template) => ! ["moss-image", "fibo2-edit-turbo", "fibo2-base"].includes(template.id)).every((template) => template.modelType === "minimax-h3")).toBe(true);for (const modelType of [undefined, null, "", 123]) {localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({templates: [{ id: "legacy", name: "Renamed generator", modelType }], defaultTemplateId: "legacy", catalogVersion: 9,@@ -130,7 +130,7 @@ describe("generator templates", () => {localStorage.setItem("slopus.engine-paths.v1", JSON.stringify({ transformer: "D:\\Models\\main.safetensors" }));const settings = loadGeneratorTemplateSettings();expect(settings.defaultTemplateId).toBe("default");- expect(settings.templates).toHaveLength(8);+ expect(settings.templates).toHaveLength(9);expect(settings.templates[1].name).toBe("First/Last Frame");expect(settings.templates[0]).toMatchObject({id: "default",@@ -198,7 +198,7 @@ describe("generator templates", () => {paths: { ...original.paths, transformer },sources: { ...original.sources, transformer: [{ ...original.sources!.transformer![0], url: transformer }, { url: "https://huggingface.co/koongrizzly/MiniMax_H3_int4_W4A8_ConvRot_Pruned/resolve/main/diffusion_models/minimax_h3_ref2va_hybrid_b20-49_pruned_w4a8_mixed.safetensors", gpuModel: "", minVramGb: 0 }] },});- expect(loadGeneratorTemplateSettings().templates.map(({ name }) => name)).toEqual(["Default", "First/Last Frame", "References", "FastH3 Omni", "Singularity", "Animate", "MOSS Image", "Fibo 2.0 Edit Turbo"]);+ expect(loadGeneratorTemplateSettings().templates.map(({ name }) => name)).toEqual(["Default", "First/Last Frame", "References", "FastH3 Omni", "Singularity", "Animate", "MOSS Image", "Fibo 2.0 Edit Turbo", "Fibo 2.0 Base"]);});it.each(["Minimax H3 Original", "My custom generator"])("migrates the saved %s template without changing its configuration", (name) => {@@ -215,7 +215,7 @@ describe("generator templates", () => {expect(settings.templates[2]).toEqual(minimaxFastTemplate());expect(settings.templates[3]).toEqual(minimaxSingularityTemplate());expect(settings.defaultTemplateId).toBe(template.id);- expect(settings.catalogVersion).toBe(14);+ expect(settings.catalogVersion).toBe(15);expect(loadGeneratorTemplateSettings()).toEqual(settings);saveGeneratorTemplateSettings({ ...settings, templates: [settings.templates[0]] });expect(loadGeneratorTemplateSettings().templates).toHaveLength(1);@@ -225,7 +225,7 @@ describe("generator templates", () => {const references = minimaxReferencesTemplate();references.paths.transformer = "D:/Models/custom.safetensors";localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [references], catalogVersion: 3 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([references, minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([references, minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);});it("adds Singularity to the previous catalog once while preserving saved templates", () => {@@ -234,9 +234,9 @@ describe("generator templates", () => {custom.paths.transformer = "D:/Models/custom.safetensors";localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [custom], defaultTemplateId: custom.id, catalogVersion: 4 }));const settings = loadGeneratorTemplateSettings();- expect(settings.templates).toEqual([expect.objectContaining(custom), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);+ expect(settings.templates).toEqual([expect.objectContaining(custom), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);expect(settings.defaultTemplateId).toBe(custom.id);- expect(settings.catalogVersion).toBe(14);+ expect(settings.catalogVersion).toBe(15);expect(loadGeneratorTemplateSettings()).toEqual(settings);saveGeneratorTemplateSettings({ ...settings, templates: [custom] });expect(loadGeneratorTemplateSettings().templates).toEqual([expect.objectContaining(custom)]);@@ -247,7 +247,7 @@ describe("generator templates", () => {template.defaultSteps = 8;template.paths.transformer = "D:/Models/singularity.safetensors";localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 4 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);});it("adds Turbo to saved Singularity once and preserves other adapters and settings", () => {@@ -257,7 +257,7 @@ describe("generator templates", () => {template.loras = [{ loraId: "custom", enabled: false, strength: 0.5 }];localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], defaultTemplateId: template.id, catalogVersion: 5 }));const settings = loadGeneratorTemplateSettings();- expect(settings.templates).toEqual([{ ...template, loras: [...template.loras, { loraId: TURBO_LORA.id, enabled: true, strength: 1 }] }, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);+ expect(settings.templates).toEqual([{ ...template, loras: [...template.loras, { loraId: TURBO_LORA.id, enabled: true, strength: 1 }] }, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);expect(settings.defaultTemplateId).toBe("");expect(loadGeneratorTemplateSettings()).toEqual(settings);saveGeneratorTemplateSettings({ ...settings, templates: [template] });@@ -268,7 +268,7 @@ describe("generator templates", () => {const template = minimaxSingularityTemplate();template.loras = [{ loraId: TURBO_LORA.id, enabled: false, strength: 0.3 }];localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 5 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);});it("adds FastH3 Omni with eight steps and its model URLs", () => {@@ -300,8 +300,8 @@ describe("generator templates", () => {}localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 8 }));const settings = loadGeneratorTemplateSettings();- expect(settings.templates).toEqual([minimaxFastTemplate(), mossImageTemplate(), fiboImageTemplate()]);- expect(settings.catalogVersion).toBe(14);+ expect(settings.templates).toEqual([minimaxFastTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);+ expect(settings.catalogVersion).toBe(15);expect(templateNeedsDownload(settings.templates[0])).toBe(true);expect(loadGeneratorTemplateSettings()).toEqual(settings);});@@ -316,8 +316,8 @@ describe("generator templates", () => {const otherPaths = { ...template.paths };localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 10 }));const settings = loadGeneratorTemplateSettings();- expect(settings.catalogVersion).toBe(14);- expect(settings.templates).toHaveLength(2);+ expect(settings.catalogVersion).toBe(15);+ expect(settings.templates).toHaveLength(3);expect(settings.templates[0]).toMatchObject({ id: template.id, name: "FastH3 Omni", defaultSteps: 8,paths: { ...otherPaths, transformer: minimaxFastTemplate().paths.transformer },sources: { transformer: [{ url: minimaxFastTemplate().paths.transformer, gpuModel: "RTX 5090", minVramGb: 24 }] } });@@ -344,7 +344,7 @@ describe("generator templates", () => {expect(migrated.paths.transformer).toBe(selection === "url" || selection === "downloaded" ? expectedUrl : previousPath);expect(migrated.name).toBe(template.name);expect(migrated.defaultSteps).toBe(12);- expect(settings.templates.slice(1)).toEqual([references, fast, fiboImageTemplate()]);+ expect(settings.templates.slice(1)).toEqual([references, fast, fiboImageTemplate(), fiboBaseTemplate()]);expect(loadGeneratorTemplateSettings()).toEqual(settings);});@@ -372,7 +372,7 @@ describe("generator templates", () => {expect(migrated.sources!.transformer).toContainEqual({ url: "https://example.com/custom.safetensors", gpuModel: "Custom GPU", minVramGb: 8 });expect(migrated.paths.transformer).toBe(selection === "custom" ? "D:/custom.safetensors" : selection === "cached omni" ? "D:/weights/omni.safetensors" : omniUrl);expect(settings.defaultTemplateId).toBe(selection === "custom" || selection === "cached omni" ? template.id : "");- expect(settings.templates.slice(1)).toEqual([original, references, fiboImageTemplate()]);+ expect(settings.templates.slice(1)).toEqual([original, references, fiboImageTemplate(), fiboBaseTemplate()]);expect(loadGeneratorTemplateSettings()).toEqual(settings);});@@ -383,11 +383,11 @@ describe("generator templates", () => {template.paths.transformer = "D:/custom/model.safetensors";template.sources!.transformer = [{ url: "https://example.com/custom.safetensors", downloadedPath: template.paths.transformer, gpuModel: "", minVramGb: 0 }];localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 10 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([template, fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, fiboImageTemplate(), fiboBaseTemplate()]);const other = createGeneratorTemplate("Custom");localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [other], defaultTemplateId: other.id, catalogVersion: 10 }));const settings = loadGeneratorTemplateSettings();- expect(settings.templates).toEqual([expect.objectContaining(other), fiboImageTemplate()]);+ expect(settings.templates).toEqual([expect.objectContaining(other), fiboImageTemplate(), fiboBaseTemplate()]);expect(settings.defaultTemplateId).toBe(other.id);});@@ -399,10 +399,10 @@ describe("generator templates", () => {template.sources = { ...template.sources, videoVae: [{ url: template.paths.videoVae, gpuModel: "", minVramGb: 0 }] };delete template.sources.transformer;localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 8 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([template, mossImageTemplate(), fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);const original = minimaxOriginalTemplate();localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [original], catalogVersion: 8 }));- expect(loadGeneratorTemplateSettings().templates).toEqual([original, mossImageTemplate(), fiboImageTemplate()]);+ expect(loadGeneratorTemplateSettings().templates).toEqual([original, mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()]);});it.each(["textEncoder", "transformer"] as const)("upgrades saved Minimax %s variants once and preserves downloaded weights", (field) => {@@ -412,7 +412,7 @@ describe("generator templates", () => {template.paths[field] = downloadedPath;localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 1 }));const settings = loadGeneratorTemplateSettings();- expect(settings.catalogVersion).toBe(14);+ expect(settings.catalogVersion).toBe(15);expect(settings.templates[0].paths[field]).toBe(downloadedPath);expect(settings.templates[0].sources![field]).toEqual(minimaxOriginalTemplate().sources![field]!.map((source, index) =>index === 0 ? { ...source, downloadedPath } : source));@@ -427,7 +427,7 @@ describe("generator templates", () => {expect(loadGeneratorTemplateSettings().templates[0].sources![field]).toEqual(template.sources![field]);const custom = createGeneratorTemplate();localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [custom], catalogVersion: 1 }));- expect(loadGeneratorTemplateSettings().templates.map(({ id }) => id)).toEqual([custom.id, "minimax-h3-references", "minimax-h3-fast", "minimax-h3-singularity", "viggle-animate", "moss-image", "fibo2-edit-turbo"]);+ expect(loadGeneratorTemplateSettings().templates.map(({ id }) => id)).toEqual([custom.id, "minimax-h3-references", "minimax-h3-fast", "minimax-h3-singularity", "viggle-animate", "moss-image", "fibo2-edit-turbo", "fibo2-base"]);});it.each(["url", "downloaded", "original", "custom", "cached original"])("removes the incompatible encoder from saved templates using %s", (selection) => {@@ -447,7 +447,7 @@ describe("generator templates", () => {localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], defaultTemplateId: template.id, catalogVersion: 2 }));const settings = loadGeneratorTemplateSettings();const migrated = settings.templates[0];- expect(settings.catalogVersion).toBe(14);+ expect(settings.catalogVersion).toBe(15);expect(migrated.sources!.textEncoder).toEqual([{ url: originalUrl, gpuModel: "", minVramGb: 0, ...(selection === "cached original" ? { downloadedPath: cachedOriginal } : {}) },custom,@@ -522,3 +522,28 @@ describe("machine prompt LLM settings", () => {});});});++it("adds Base once and persists per-template editing through runtime options", () => {+ const edit = fiboImageTemplate();+ edit.defaultSteps = 8;+ saveGeneratorTemplateSettings({ templates: [edit], defaultTemplateId: "", catalogVersion: 14 });+ const migrated = loadGeneratorTemplateSettings();+ expect(migrated.templates).toEqual([edit, fiboBaseTemplate()]);+ expect(loadGeneratorTemplateSettings()).toEqual(migrated);+ const base = migrated.templates[1];+ expect(base.name).toBe("Fibo 2.0 Base");+ expect(base.paths.transformer).toBe("https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/diffusion_models/fibo2_dev_int8_convrot.safetensors");+ expect(base.sources!.transformer![0].url).toBe(base.paths.transformer);+ expect(base.paths.textEncoder).toBe(edit.paths.textEncoder);+ expect(base.paths.videoVae).toBe(edit.paths.videoVae);+ expect(templateSupportsEditing(base)).toBe(false);+ expect(templateSupportsOutpainting(base)).toBe(false);+ expect(templateSupportsOutpainting(edit)).toBe(true);+ expect(templateSupportsEditing({ ...edit, editingModel: false })).toBe(false);+ expect(templateSupportsEditing({ ...mossImageTemplate(), editingModel: true })).toBe(false);+ expect(templateSupportsEditing({ ...edit, editingModel: undefined })).toBe(true);+ const provider = engineProviderSetting(base.paths, undefined, base.attention, [], "prompt", [], false, base.sources, base);+ expect(provider.options.editingModel).toBe(false);+ saveGeneratorTemplateSettings({ ...migrated, templates: [{ ...edit, editingModel: false }] });+ expect(loadGeneratorTemplateSettings().templates).toEqual([{ ...edit, editingModel: false }]);+});diff --git a/src/lib/settings.ts b/src/lib/settings.tsindex 2d91a18..9644857 100644--- a/src/lib/settings.ts+++ b/src/lib/settings.ts@@ -78,12 +78,19 @@ export const FIBO_MODEL_TYPE = "fibo2";export const templateSupportsVideo = (template: Pick<GeneratorTemplate, "modelType">): boolean => generatorModel(template.modelType).videoGeneration;export const templateSupportsImages = (template: Pick<GeneratorTemplate, "modelType" | "mode">): boolean => generatorModel(template.modelType).imageGeneration && template.mode !== "animate";+export const templateSupportsEditing = (template: Pick<GeneratorTemplate, "modelType" | "editingModel" | "mode">): boolean =>+ templateSupportsImages(template) && generatorModel(template.modelType).imageEditing && template.editingModel !== false;+export const templateSupportsOutpainting = (template: Pick<GeneratorTemplate, "modelType" | "editingModel" | "mode">): boolean =>+ templateSupportsEditing(template) && generatorModel(template.modelType).imageOutpainting;+export interface GeneratorTemplate extends SigmaShifts {id: string;name: string;/** Stable model-family identifier, independent of template name and mode.* Open to new identifiers as other model families are added. */modelType: string;+ /** Whether these weights support editing; omitted legacy values use the model capability. */+ editingModel?: boolean;defaultSteps: number;attention: AttentionMode;motionCache?: boolean;@@ -230,6 +237,7 @@ export function createGeneratorTemplate(name = "New template", modelType = MINIMid: `generator-template-${crypto.randomUUID()}`,name,modelType,+ editingModel: generatorModel(modelType).imageEditing,defaultSteps: modelType === MOSS_MODEL_TYPE ? 50 : modelType === FIBO_MODEL_TYPE ? 4 : DEFAULT_GENERATION_STEPS,attention: generatorModel(modelType).cudaOnly ? "flash2" : "sage2",paths: copyPaths(EMPTY_ENGINE_SETTINGS),@@ -246,7 +254,7 @@ export function mossImageTemplate(): GeneratorTemplate {audioVae: "",};const sources = Object.fromEntries(Object.entries(paths).filter(([, url]) => url).map(([id, url]) => [id, [{ url, gpuModel: "", minVramGb: 0 }]]));- return { id: "moss-image", name: "MOSS Image", modelType: MOSS_MODEL_TYPE, defaultSteps: 50, attention: "flash2", paths, sources };+ return { id: "moss-image", name: "MOSS Image", modelType: MOSS_MODEL_TYPE, editingModel: false, defaultSteps: 50, attention: "flash2", paths, sources };}export function fiboImageTemplate(): GeneratorTemplate {@@ -257,7 +265,15 @@ export function fiboImageTemplate(): GeneratorTemplate {videoVae: `${root}vae/flux2-vae.safetensors`, tokenizer: "", audioVae: "",};const sources = Object.fromEntries(Object.entries(paths).filter(([, url]) => url).map(([id, url]) => [id, [{ url, gpuModel: "", minVramGb: 0 }]]));- return { id: "fibo2-edit-turbo", name: "Fibo 2.0 Edit Turbo", modelType: FIBO_MODEL_TYPE, defaultSteps: 4, attention: "flash2", paths, sources };+ return { id: "fibo2-edit-turbo", name: "Fibo 2.0 Edit Turbo", modelType: FIBO_MODEL_TYPE, editingModel: true, defaultSteps: 4, attention: "flash2", paths, sources };+}++export function fiboBaseTemplate(): GeneratorTemplate {+ const template = fiboImageTemplate();+ const transformer = "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/diffusion_models/fibo2_dev_int8_convrot.safetensors";+ return { ...template, id: "fibo2-base", name: "Fibo 2.0 Base", editingModel: false,+ paths: { ...template.paths, transformer },+ sources: { ...template.sources, transformer: [{ url: transformer, gpuModel: "", minVramGb: 0 }] } };}const MINIMAX_REF2VA_W4A8_URL = "https://huggingface.co/koongrizzly/MiniMax_H3_int4_W4A8_ConvRot_Pruned/resolve/main/diffusion_models/minimax_h3_ref2va_hybrid_b20-49_pruned_w4a8_mixed.safetensors";@@ -331,9 +347,9 @@ export function viggleAnimateTemplate(): GeneratorTemplate {}const initialTemplateSettings = (paths = EMPTY_ENGINE_SETTINGS): GeneratorTemplateSettings => ({- templates: [{ id: "default", name: "Default", modelType: MINIMAX_H3_MODEL_TYPE, defaultSteps: DEFAULT_GENERATION_STEPS, attention: "sage2", paths: copyPaths(paths) }, minimaxOriginalTemplate(), minimaxReferencesTemplate(), minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()],+ templates: [{ id: "default", name: "Default", modelType: MINIMAX_H3_MODEL_TYPE, defaultSteps: DEFAULT_GENERATION_STEPS, attention: "sage2", paths: copyPaths(paths) }, minimaxOriginalTemplate(), minimaxReferencesTemplate(), minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate(), fiboBaseTemplate()],defaultTemplateId: "default",- catalogVersion: 14,+ catalogVersion: 15,});const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings | null => {@@ -382,6 +398,7 @@ const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings |...(typeof file.downloadedPath === "string" && file.downloadedPath.trim() && !isDownloadUrl(file.downloadedPath) ? { downloadedPath: file.downloadedPath } : {}) }];}) : [];return [{ id, name, modelType, defaultSteps, attention, paths, sources,+ ...(typeof candidate.editingModel === "boolean" ? { editingModel: candidate.editingModel } : {}),...(isSigmaShift(candidate.videoSigmaShift) ? { videoSigmaShift: candidate.videoSigmaShift } : {}),...(isSigmaShift(candidate.audioSigmaShift) ? { audioSigmaShift: candidate.audioSigmaShift } : {}),...(typeof candidate.motionCache === "boolean" ? { motionCache: candidate.motionCache } : {}),@@ -395,7 +412,7 @@ const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings |templates,defaultTemplateId: templates.find((template) => template.id === requestedDefault && templateUsable(template))?.id?? templates.find(templateUsable)?.id ?? "",- catalogVersion: typeof record.catalogVersion === "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].includes(record.catalogVersion) ? record.catalogVersion : 0,+ catalogVersion: typeof record.catalogVersion === "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].includes(record.catalogVersion) ? record.catalogVersion : 0,};};@@ -583,6 +600,12 @@ export function loadGeneratorTemplateSettings(): GeneratorTemplateSettings {normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 14 })!;localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));}+ if ((normalized.catalogVersion ?? 0) < 15) {+ const template = fiboBaseTemplate();+ if (!normalized.templates.some(({ id }) => id === template.id)) normalized.templates.push(template);+ normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 15 })!;+ localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));+ }return normalized;}}@@ -641,12 +664,13 @@ export function saveEngineSettings(settings: EngineSettings): void {/** The `slopfab` provider setting these paths describe, with blanks dropped so* an unset field falls through to whatever the project (or the Rust default)* already had rather than overwriting it with "". */-export function engineProviderSetting(settings: EngineSettings, base?: ProviderSetting, attention = defaultGeneratorTemplate().attention, selection = defaultGeneratorTemplate().loras, mode = defaultGeneratorTemplate().mode, additionalSafetensors = defaultGeneratorTemplate().additionalSafetensors, motionCache = defaultGeneratorTemplate().motionCache ?? false, sources = defaultGeneratorTemplate().sources, shifts: SigmaShifts & { modelType?: string } = defaultGeneratorTemplate()): ProviderSetting {+export function engineProviderSetting(settings: EngineSettings, base?: ProviderSetting, attention = defaultGeneratorTemplate().attention, selection = defaultGeneratorTemplate().loras, mode = defaultGeneratorTemplate().mode, additionalSafetensors = defaultGeneratorTemplate().additionalSafetensors, motionCache = defaultGeneratorTemplate().motionCache ?? false, sources = defaultGeneratorTemplate().sources, shifts: SigmaShifts & { modelType?: string; editingModel?: boolean } = defaultGeneratorTemplate()): ProviderSetting {// A LAN worker receives URLs for weights it should download itself.const remote = remoteWorkerSelected();const options: ProviderSetting["options"] = { ...(base?.options ?? {}), attention, inferenceBackend: loadInferenceBackend() };const imageOnly = !generatorModel(shifts.modelType).videoGeneration;options.modelType = shifts.modelType ?? MINIMAX_H3_MODEL_TYPE;+ options.editingModel = templateSupportsEditing({ modelType: options.modelType, editingModel: shifts.editingModel, mode });// Always replace project-carried adapter paths with this machine's selection.delete options.loras;delete options.schedule;diff --git a/src/lib/slop.test.ts b/src/lib/slop.test.tsindex ca86fb4..f8dced4 100644--- a/src/lib/slop.test.ts+++ b/src/lib/slop.test.ts@@ -1,7 +1,7 @@// @vitest-environment jsdomimport { beforeEach, describe, expect, it, vi } from "vitest";import { importGeneratorSlop, MAX_SLOP_BYTES, mergeGeneratorSlop, parseGeneratorSlop, portableGenerator, serializeGeneratorSlop } from "./slop";-import { createGeneratorTemplate, mossImageTemplate, loadGeneratorTemplateSettings, minimaxOriginalTemplate, minimaxSingularityTemplate, saveGeneratorTemplateSettings, viggleAnimateTemplate } from "./settings";+import { createGeneratorTemplate, mossImageTemplate, fiboBaseTemplate, loadGeneratorTemplateSettings, minimaxOriginalTemplate, minimaxSingularityTemplate, saveGeneratorTemplateSettings, viggleAnimateTemplate } from "./settings";import { loadLoras, saveLoras, TURBO_LORA } from "./loras";beforeEach(() => { localStorage.clear(); vi.restoreAllMocks(); });@@ -123,3 +123,11 @@ describe("slop validation", () => {expect(loadGeneratorTemplateSettings()).toEqual(settings); expect(loadLoras()).toEqual(loras);});});++it("keeps the editing setting when sharing and importing Base", () => {+ const base = fiboBaseTemplate();+ const data = parseGeneratorSlop(serializeGeneratorSlop([base]));+ const imported = mergeGeneratorSlop(data, { templates: [], defaultTemplateId: "" }, []).imported[0];+ expect(imported.editingModel).toBe(false);+ expect(imported.paths).toEqual(base.paths);+});diff --git a/src/lib/slop.ts b/src/lib/slop.tsindex 6b86e32..3103a33 100644--- a/src/lib/slop.ts+++ b/src/lib/slop.ts@@ -27,7 +27,7 @@ const portableLoraSchema = z.object({stepOverride: steps.optional(), samplingPreset: z.literal("dmad-4step").optional(),}).strict();export const portableGeneratorSchema = z.object({- name, modelType: name, defaultSteps: steps, attention: z.enum(["exact", "flash2", "sage2", "sol"]),+ name, modelType: name, editingModel: z.boolean().optional(), defaultSteps: steps, attention: z.enum(["exact", "flash2", "sage2", "sol"]),mode: z.enum(["prompt", "animate"]).default("prompt"), motionCache: z.boolean().default(false),sources: sourcesSchema,loras: z.array(portableLoraSchema).max(128).default([]),@@ -81,7 +81,7 @@ export function portableGenerator(template: GeneratorTemplate, library = loadLor...(lora.samplingPreset ? { samplingPreset: lora.samplingPreset } : {}) };});return validatedGenerator({- name: template.name, modelType: template.modelType, defaultSteps: template.defaultSteps, attention: template.attention,+ name: template.name, modelType: template.modelType, editingModel: template.editingModel, defaultSteps: template.defaultSteps, attention: template.attention,mode: template.mode ?? "prompt", motionCache: template.motionCache ?? false, sources, loras,additionalSafetensors: (template.additionalSafetensors ?? []).map((file) => ({ name: file.name, url: file.url, ...(file.role ? { role: file.role } : {}) })),}, template.name);@@ -122,7 +122,7 @@ export function mergeGeneratorSlop(document: GeneratorSlop, current: GeneratorTeconst paths = { ...EMPTY_ENGINE_SETTINGS };const usedLoraIds = new Set<string>();for (const field of ENGINE_PATH_FIELDS) paths[field.id] = data.sources[field.id]?.[0]?.url ?? "";- return { ...template, defaultSteps: data.defaultSteps, attention: data.attention, mode: data.mode, motionCache: data.motionCache,+ return { ...template, editingModel: data.editingModel, defaultSteps: data.defaultSteps, attention: data.attention, mode: data.mode, motionCache: data.motionCache,paths, sources: structuredClone(data.sources),additionalSafetensors: data.additionalSafetensors.map((file) => ({ ...file, id: `additional-${crypto.randomUUID()}` })),loras: data.loras.map((entry) => {diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.tsindex f566418..15a864c 100644--- a/src/lib/workQueue.test.ts+++ b/src/lib/workQueue.test.ts@@ -1,5 +1,5 @@// @vitest-environment jsdom-import { mossImageTemplate, fiboImageTemplate } from "./settings";+import { mossImageTemplate, fiboImageTemplate, fiboBaseTemplate } from "./settings";import { waitFor } from "@testing-library/react";import { listen } from "@tauri-apps/api/event";import { invoke } from "@tauri-apps/api/core";@@ -451,6 +451,29 @@ describe("image generation work", () => {await queue.cancel(queue.getSnapshot()[0].id);});+ it.each([false, true])("queues Fibo Zoom without duplicate references or H3 overrides (crop: %s)", async (crop) => {+ const { queue } = setup();+ const fibo = { ...fiboImageTemplate(), sources: {}, paths: { transformer: "fibo", textEncoder: "qwen", videoVae: "flux", tokenizer: "", audioVae: "" } };+ const record = imageProject();+ const source = { id: "source", name: "Source", kind: "image" as const, mimeType: "image/png", relativePath: "media/source.png", width: 128, height: 96, createdAt: record.config.createdAt };+ record.config.assets = [source];+ const session = queue.project(record);+ const options = { bounds: crop ? { x: 0, y: 0, width: 64, height: 64 } : { x: -32, y: -32, width: 192, height: 160 }, prompt: "Forest", steps: 4, seed: 1 };+ expect(() => queue.enqueueExtendImage(session, fiboBaseTemplate(), source.id, options)).toThrow(/supports image editing/);+ queue.enqueueExtendImage(session, fibo, source.id, options);+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledOnce());+ const [request, config] = vi.mocked(enqueueSlopfabGeneration).mock.calls[0];+ expect(config.providerSettings.slopfab.options.editingModel).toBe(true);+ expect(request.referencePaths).toEqual([]);+ expect(request.prompt).not.toMatch(/Picture|Source scene|Shot|overall_soundscape/);+ const edit = request.imageEdit!.edits[0];+ expect(edit.invertMask).toBe(false);+ expect(edit.outpaintLangevinSteps).toBeUndefined();+ if (crop) expect(edit.strength).toBe(0.65);+ else expect(edit.maskContours).toHaveLength(2);+ await queue.cancel(queue.getSnapshot()[0].id);+ });+it("routes Fibo source edits once without H3 prompt wrappers or duplicate references", async () => {const { queue, first } = setup();const fibo = { ...fiboImageTemplate(), sources: {}, paths: { transformer: "fibo", textEncoder: "qwen", videoVae: "flux", tokenizer: "", audioVae: "" } };@@ -462,6 +485,7 @@ describe("image generation work", () => {scene.steps = 4;return { ...current, imageScene: scene };});+ expect(() => queue.enqueueImage(session, fiboBaseTemplate())).toThrow(/does not support image editing/);queue.enqueueImage(session, fibo);await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledOnce());const [request, config] = vi.mocked(enqueueSlopfabGeneration).mock.calls[0];diff --git a/src/lib/workQueue.ts b/src/lib/workQueue.tsindex fd8a69c..ed188b0 100644--- a/src/lib/workQueue.ts+++ b/src/lib/workQueue.ts@@ -12,7 +12,7 @@ import { completeImageDraft, createTemplateImageDraft, imageFamilyRoot, imageGenimport type { ImageGenerationSnapshot, ProjectAsset } from "./project";import { outputDimensions } from "./export";import { projectItemPath, referenceDefinition, referenceImages, referenceRefmodInputs } from "./project";-import { generationSigmaShiftsWithLoras, engineProviderSetting, generatorModel, templateSupportsImages, templateSupportsVideo, type GeneratorTemplate } from "./settings";+import { generationSigmaShiftsWithLoras, engineProviderSetting, generatorModel, templateSupportsEditing, templateSupportsOutpainting, templateSupportsImages, templateSupportsVideo, type GeneratorTemplate } from "./settings";import { describeDiagnosticError, writeDiagnostic } from "./diagnostics";import { GenerationTimingEstimator, type CompletedGenerationTiming, type GenerationTimingProgress } from "./generationTiming";import { releaseRendered, saveGeneratedScene } from "./generatedVideo";@@ -275,7 +275,7 @@ export class WorkQueue {if (!templateSupportsImages(template)) throw new Error("Choose a prompt generator for images.");let current = session.getSnapshot().config;const scene = current.imageScene ?? createImageScene(current.brief.prompt);- if (!generatorModel(template.modelType).imageEditing && scene.rootType === "image") throw new Error(`${generatorModel(template.modelType).label} does not support image editing. Choose an editing generator.`);+ if (!templateSupportsEditing(template) && scene.rootType === "image") throw new Error(`${generatorModel(template.modelType).label} does not support image editing. Choose an editing generator.`);if (activeGenerationEffects(scene.generationEffects) && !generatorModel(template.modelType).generationEffects) throw new Error("This model does not support generation effects. Bypass or remove the effects, or choose another generator.");const edit = scene.rootType === "image" ? compileImageEdits(current, { modelType: template.modelType }) : null;if (!imageScenePrompt(scene)) throw new Error("Describe the image or add an object before generating.");@@ -336,7 +336,7 @@ export class WorkQueue {}enqueueExtendImage(session: ProjectSession, template: GeneratorTemplate, sourceId: string, options: ExtendOptions) {if (!isTauri()) throw new Error("Zoom requires the desktop app.");- if (!generatorModel(template.modelType).imageOutpainting) throw new Error("Choose a generator that supports image editing for Zoom.");+ if (!templateSupportsOutpainting(template)) throw new Error("Choose a generator that supports image editing for Zoom.");if (template.mode === "animate") throw new Error("Choose a prompt generator for Zoom.");const current = session.getSnapshot().config;const source = current.assets.find((asset) => asset.id === sourceId && asset.kind === "image" && !asset.imageDraft);@@ -347,12 +347,12 @@ export class WorkQueue {slopfab: engineProviderSetting(template.paths, current.providerSettings.slopfab, template.attention, template.loras, "prompt", template.additionalSafetensors, false, template.sources, template) } });const id = `extend-${crypto.randomUUID()}`;const sourceRelativePath = `cache/extend-images/${id}/canvas.png`;- const compiled = compileExtendImage(config, source, sourceRelativePath, options);+ const compiled = compileExtendImage(config, source, sourceRelativePath, options, template.modelType);// Outpainting uses the positioned canvas as context. Crop regeneration// also supplies the prepared crop as its composition reference.const referencePaths = compiled.references.flatMap((reference) => referenceImages(reference).map((image) => projectItemPath(session.record.folderPath, image)!));const regenerate = compiled.layout.mode === "regenerate";- if (regenerate) referencePaths.unshift(projectItemPath(session.record.folderPath, { relativePath: sourceRelativePath })!);+ if (regenerate && generatorModel(template.modelType).editImageReferences) referencePaths.unshift(projectItemPath(session.record.folderPath, { relativePath: sourceRelativePath })!);const resultName = `${regenerate ? "Regenerated" : "Extended"} - ${source.name}`;const request: SlopfabGenerationRequest = { jobId: id, stillImage: true, frames: 1, prompt: compiled.prompt,canvasWidth: compiled.layout.output.width, canvasHeight: compiled.layout.output.height, steps: generationStepsWithLoras(options.steps, config), seed: imageGenerationSeed(options.seed),