Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Add Fibo 2.0 image editing

Bitti0e7bba5526e9
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 9f6b9aa..26d1da5 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -4,11 +4,13 @@ This alpha update adds Prompt video scenes, agent image drafts, Sol attention an
## What's new
-- **Lasso image edits.** Draw a freehand area beside the existing box tool, give it a prompt in the right panel, and select or move it from the canvas or Scene tree. Saved outlines become antialiased Slopfab masks for local and LAN generation, preserving pixels outside the selection. Bundled runtimes now use API 1.33; LAN workers require the matching update.
+- **Fibo 2.0 image editing.** Added an Edit Turbo generator with transformer, Qwen3-VL encoder and Flux2 VAE downloads. 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.
+
+- **Lasso image edits.** Draw a freehand area beside the existing box tool, give it a prompt in the right panel, and select or move it from the canvas or Scene tree. Saved outlines become antialiased Slopfab masks for local and LAN generation, preserving pixels outside the selection. Bundled runtimes now use API 1.34; LAN workers require the matching update.
- **FastH3 Omni.** Renamed First/Last Frame Fast and updated its transformer to the FastH3 Omni eight-step model. Existing bundled settings migrate automatically.
-- **Generator model pages.** Open MiniMax H3, MOSS or Other from Generator settings. Each model has its own generators and LoRAs; Other contains the existing extra weights. New generators use the selected model.
+- **Generator model pages.** Open MiniMax H3, MOSS, Fibo 2.0 or Other from Generator settings. Each model has its own generators and LoRAs; Other contains the existing extra weights. New generators use the selected model.
- **Image generation count.** Open the arrow beside Generate to queue up to 100 images with different seeds. Count applies to one click, resets afterward and is not saved in the project.
@@ -45,4 +47,4 @@ This alpha update adds Prompt video scenes, agent image drafts, Sol attention an
- Backdrop prompts describe a flat, constant color field in every shot, limit reference guidance to subject appearance, and use neutral studio styling when no look is specified.
- Scene type label tooltips now explain each scene type's behavior.
- Renamed Add reference to Reference browser and centered the agent send and stop buttons.
-- Updated the bundled Windows and Linux SlopFab runtimes to API 1.31 for MOSS, native LCS and earlier Zoom fixes. LAN worker protocol 11 carries generation effects and image CFG; update workers alongside the app.
+- Updated the bundled Windows and Linux SlopFab runtimes to API 1.34 for Fibo, MOSS, native LCS and image masks. LAN worker protocol 14 carries Fibo image-only model configuration; update workers alongside the app.
diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.md
index 1d13ed7..82b3d30 100644
--- a/docs/slopfab-compatibility.md
+++ b/docs/slopfab-compatibility.md
@@ -11,7 +11,7 @@ are omitted from generation requests and video render fingerprints.
Effects are saved with scenes, image drafts and generation snapshots. The
native core validates ranges and model capabilities before generation. The
-shared model catalog enables LCS for MiniMax H3 and disables it for MOSS.
+shared model catalog enables LCS for MiniMax H3 and disables it for MOSS and Fibo.
These are sampling effects, separate from timeline postprocessing. They use
SlopFab's native implementation of the approach described by
[ComfyUI-LCS](https://github.com/facok/ComfyUI-LCS), without running ComfyUI.
@@ -35,7 +35,7 @@ workers from silently dropping them. Each worker calibrates and caches its
own VAE. Update workers alongside the desktop app. A runtime missing the LCS
exports reports an explicit upgrade error.
-Both bundled libraries are built from SlopFab commit `274ce2e` (API 1.31.0)
+The original LCS integration used SlopFab commit `274ce2e` (API 1.31.0)
with FFmpeg disabled. Windows and Linux C API and embedded-tokenizer checks
pass, including the previously failing malformed LCS settings checks. Slopus
checks cover UI authoring, project persistence, request snapshots, worker
@@ -45,7 +45,7 @@ with model weights were not evaluated in this integration.
## MOSS image generation (API 1.30+)
-The bundled Windows and Linux libraries now expose SlopFab API 1.31.0, including
+The bundled Windows and Linux libraries expose SlopFab API 1.34.0, including
the MOSS model-family setter introduced in 1.30. Both builds disable FFmpeg.
MOSS uses CUDA/Flash attention, the image VAE slot, and a separate Qwen3.5
tokenizer file. It returns one RGB frame through the existing image save path.
@@ -467,3 +467,35 @@ continuation and still images. Preparation tests use small local fixtures to
check embedding, idempotence, missing assets, busy model files, older DLLs and
download-record updates. These tests do not run a full model inference;
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 `782397a`
+(API 1.34.0), built with FFmpeg disabled. LAN protocol 14 requires updated workers.
+
+The `fibo2` model uses the Edit Turbo transformer, Qwen3-VL 4B text encoder and
+Flux2 VAE. The tokenizer is embedded, and no audio VAE is needed. The generator
+uses CUDA with Flash attention and four steps by default.
+
+Use a source image with whole-image, box or lasso edits, or cite one to four image
+references in an image prompt. Source edits pass the source only through the
+image-edit API, without duplicating it as a reference. Plain instructions and
+optional structured edit JSON pass through without H3 prompt sections. Lasso
+outlines use the same native masks as H3, including compound contours.
+
+Shared model capabilities disable video, text-only generation, extra references
+on source edits, Zoom, character sheets, LoRAs/refmods, MotionCache, CFG, LCS and
+H3 sampling overrides. Native request validation enforces the same constraints
+for local and LAN jobs.
+
+Validation includes native whole-image/mask planning on both bundled libraries
+and a Windows CUDA four-step masked generation with the real Fibo weights,
+checking finite RGB output, exact unselected pixels and cancellation.
+
+The Linux build needs to retain Fibo's `render_text` object from the generation
+archive, which is referenced by the CUDA archive later in the link. This bundle
+was relinked with `-Wl,-z,defs` and
+`-Wl,-u,_ZN7slopfab4fibo11render_textERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE`.
+Without that retention, the upstream static archive order leaves an unresolved
+symbol in the shared library. Linux plain instructions work; optional structured
+`text_render` glyph images still require Windows in this Slopfab version.
diff --git a/lib/slopfab/libslopfab.so b/lib/slopfab/libslopfab.so
index 2b82d66..acc0dc9 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:a4af83cdbff1338920eabd8549f6cd00580a904961f6571e70d3d08268c92f19
-size 21386536
+oid sha256:f6e79b432eaa46f4211ee7a89d1628208501564077df2bdc50a1b3073dee5a37
+size 21744880
diff --git a/lib/slopfab/slopfab.dll b/lib/slopfab/slopfab.dll
index 1d5f20a..52ec23d 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:f436c4329979e518df5c5537c12adcc01a1b20961668257d8b4558881912108f
-size 18571776
+oid sha256:21c854abc280a36c427f41ab425847a8dd96d5a3f7de0a1ef187cfcbeeeb566e
+size 18846720
diff --git a/src-tauri/core/src/models.rs b/src-tauri/core/src/models.rs
index 0ae8ee1..af3e833 100644
--- a/src-tauri/core/src/models.rs
+++ b/src-tauri/core/src/models.rs
@@ -9,6 +9,13 @@ pub struct GeneratorFeatures {
pub video_generation: bool,
pub image_editing: bool,
pub image_references: bool,
+ pub image_outpainting: bool,
+ pub requires_image_input: bool,
+ pub edit_image_references: bool,
+ pub max_image_references: usize,
+ pub refmods: bool,
+ pub sigma_shifts: bool,
+ pub cuda_only: bool,
pub loras: bool,
pub motion_cache: bool,
pub generation_effects: bool,
diff --git a/src-tauri/core/src/slopfab/config.rs b/src-tauri/core/src/slopfab/config.rs
index 3b5c7be..d3a8a17 100644
--- a/src-tauri/core/src/slopfab/config.rs
+++ b/src-tauri/core/src/slopfab/config.rs
@@ -135,6 +135,35 @@ impl Configuration {
if !features.image_editing && request.image_edit.is_some() {
return Err(format!("{} 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));
+ }
+ if request.still_image && features.image_references && request.reference_paths.len() > features.max_image_references {
+ return Err(format!("{} supports at most {} reference images.", features.label, features.max_image_references));
+ }
+ if !features.refmods && (!request.refmods.is_empty() || request.image_edit.as_ref().is_some_and(|edit| edit.edits.iter().any(|step| step.refmods.as_ref().is_some_and(|items| !items.is_empty())))) {
+ return Err(format!("{} does not support refmods.", features.label));
+ }
+ if let Some(edit) = &request.image_edit {
+ 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 !features.image_outpainting && edit.edits.iter().any(|step| step.invert_mask) {
+ return Err(format!("{} does not support Zoom or outpainting.", features.label));
+ }
+ }
+ if !features.sigma_shifts {
+ let shifts = self.sigma_shifts.as_ref().map_err(Clone::clone)?;
+ if [shifts.video, shifts.audio, shifts.video_override, shifts.audio_override, request.video_sigma_shift, request.audio_sigma_shift].iter().any(Option::is_some)
+ || request.audio_steps.is_some() || self.sampling_preset.as_ref().map_err(Clone::clone)?.is_some() {
+ return Err(format!("{} uses its own sampling schedule without H3 overrides.", features.label));
+ }
+ }
+ if self.model_type == "fibo2" && (self.animate || request.latent_upscale || request.latent_bridge.is_some()
+ || request.continuation_path.is_some() || request.continuation_relative_path.is_some() || request.save_latents_path.is_some()
+ || self.attention != "flash2") {
+ return Err("Fibo requires Flash attention and image inputs, without H3 video or latent features.".into());
+ }
if !features.image_references && (!request.reference_paths.is_empty() || !request.refmods.is_empty()) {
return Err(format!("{} does not support image references or refmods.", features.label));
}
diff --git a/src-tauri/core/src/slopfab/ffi/raw/mod.rs b/src-tauri/core/src/slopfab/ffi/raw/mod.rs
index 2cabace..b5a9a01 100644
--- a/src-tauri/core/src/slopfab/ffi/raw/mod.rs
+++ b/src-tauri/core/src/slopfab/ffi/raw/mod.rs
@@ -602,7 +602,7 @@ impl Api {
self.error(unsafe { set(r, scale, negative.as_ptr(), skip_layers.as_ptr(), 1) })
}
pub fn set_model_family(&self, r: *mut Request, family: &str) -> Result<(), String> {
- let set = self.set_model_family.ok_or("MOSS requires SlopFab API 1.30 or newer. Update the runtime on the machine running generation.")?;
+ let set = self.set_model_family.ok_or("This model requires a newer SlopFab runtime. Update the machine running generation.")?;
let value = CString::new(family).map_err(|_| "Invalid model family.")?;
self.error(unsafe { set(r, value.as_ptr()) })
}
diff --git a/src-tauri/core/src/slopfab/h3.rs b/src-tauri/core/src/slopfab/h3.rs
index 1916d72..98104c4 100644
--- a/src-tauri/core/src/slopfab/h3.rs
+++ b/src-tauri/core/src/slopfab/h3.rs
@@ -1,4 +1,4 @@
-//! H3 and Animate request recipes for the SlopFab backend.
+//! Model request recipes for the SlopFab backend.
use super::{
config::{Configuration, SamplingPreset},
ffi::{self, RequestHandle},
@@ -18,11 +18,11 @@ pub(super) fn configure_request(
references: &ReferenceVideos,
) -> Result<(), String> {
configuration.validate_inputs(request)?;
- if configuration.model_type == "moss" {
+ if crate::models::generator_features(&configuration.model_type).cuda_only {
if platform == ComputePlatform::Vulkan {
- return Err("MOSS requires CUDA. Select a CUDA backend or worker.".into());
+ return Err(format!("{} requires CUDA. Select a CUDA backend or worker.", crate::models::generator_features(&configuration.model_type).label));
}
- api.set_model_family(handle, "moss")?;
+ api.set_model_family(handle, &configuration.model_type)?;
}
if configuration.attention == "sol" && platform == ComputePlatform::Vulkan {
return Err("Sol attention requires CUDA. Select a CUDA GPU or worker, or choose another attention mode in Settings.".into());
@@ -58,7 +58,7 @@ pub(super) fn configure_request(
request.frames
};
api.set_frames(handle, frames)?;
- if request.still_image && configuration.model_type != "moss" {
+ if request.still_image && !matches!(configuration.model_type.as_str(), "moss" | "fibo2") {
api.set_still_image(handle)?;
}
let video_steps = configuration.generation_steps(request.steps)?;
diff --git a/src-tauri/core/src/slopfab/status.rs b/src-tauri/core/src/slopfab/status.rs
index a5efe6b..aece519 100644
--- a/src-tauri/core/src/slopfab/status.rs
+++ b/src-tauri/core/src/slopfab/status.rs
@@ -6,7 +6,7 @@ fn model_statuses(configuration: &Configuration, available: impl Fn(&Path) -> bo
let mut models = configuration
.models
.iter()
- .filter(|(id, _, _)| configuration.model_type != "moss" || *id != 4)
+ .filter(|(id, _, _)| crate::models::generator_features(&configuration.model_type).video_generation || *id != 4)
.filter(|(id, _, _)| !configuration.animate || (*id != 1 && *id != 2))
.map(|(_, id, path)| ModelStatus {
id,
diff --git a/src-tauri/core/src/slopfab/tests.rs b/src-tauri/core/src/slopfab/tests.rs
index 085a03c..d7e6095 100644
--- a/src-tauri/core/src/slopfab/tests.rs
+++ b/src-tauri/core/src/slopfab/tests.rs
@@ -1594,3 +1594,71 @@ fn lasso_masks_survive_worker_serialization_and_reach_native_requests() {
assert!(validate_generation_controls(&request).is_err());
}
}
+
+#[test]
+fn fibo_planning_and_execution_requests_keep_the_image_family_and_masks() {
+ let mut configuration = Configuration::from_settings(&BTreeMap::new());
+ configuration.model_type = "fibo2".into();
+ configuration.attention = "flash2";
+ let api = ffi::Api::load(&configuration.dll_path).unwrap();
+ for mask in [false, true] {
+ 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,
+ "imageEdit":{"sourceRelativePath":"source.png", "edits":[{
+ "prompt":"Make the object blue", "x":0, "y":0, "width":64, "height":96, "feather":0
+ }]}
+ })).unwrap();
+ if mask {
+ 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 },
+ ]);
+ }
+ 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();
+ configure_request(&api, &handle, &request, &configuration, ComputePlatform::Cuda13, purpose, &ReferenceVideos::default()).unwrap();
+ let plan = api.resolve(&handle).unwrap();
+ assert_eq!((plan.canvas_width, plan.canvas_height, plan.aligned_frames, plan.num_model_evaluations), (64, 96, 1, 4));
+ let description = api.describe(&handle).unwrap();
+ assert!(description.contains("Fibo"), "{description}");
+ assert!(configure_request(&api, &handle, &request, &configuration, ComputePlatform::Vulkan, purpose, &ReferenceVideos::default()).unwrap_err().contains("requires CUDA"));
+ }
+ }
+}
+
+#[test]
+fn fibo_validates_image_inputs_and_rejects_unsupported_h3_controls() {
+ let mut configuration = Configuration::from_settings(&BTreeMap::new());
+ configuration.model_type = "fibo2".into();
+ configuration.attention = "flash2";
+ let mut request = GenerationRequest { still_image: true, frames: 1, steps: 4, prompt: "Make it blue".into(), canvas_width: 512, canvas_height: 512, ..Default::default() };
+ assert!(configuration.validate_inputs(&request).unwrap_err().contains("requires a source image"));
+ request.reference_paths = vec!["image.png".into(); 4];
+ configuration.validate_inputs(&request).unwrap();
+ request.reference_paths.push("extra.png".into());
+ assert!(configuration.validate_inputs(&request).unwrap_err().contains("at most 4"));
+ request.reference_paths.truncate(1);
+ for (name, value, message) in [
+ ("guidanceScale", serde_json::json!(3), "CFG"),
+ ("generationEffects", serde_json::json!({"sharpness":{"strength":1}}), "generation effects"),
+ ("stillImage", serde_json::json!(false), "video generation"),
+ ("videoSigmaShift", serde_json::json!(3), "sampling schedule"),
+ ("latentUpscale", serde_json::json!(true), "latent features"),
+ ] {
+ let mut json = serde_json::to_value(&request).unwrap();
+ json[name] = value;
+ let invalid = serde_json::from_value(json).unwrap();
+ assert!(configuration.validate_inputs(&invalid).unwrap_err().contains(message), "{name}");
+ }
+ request.image_edit = Some(serde_json::from_value(serde_json::json!({"sourceRelativePath":"source.png", "edits":[{
+ "prompt":"Make it blue", "x":0, "y":0, "width":512, "height":512
+ }]})).unwrap());
+ assert!(configuration.validate_inputs(&request).unwrap_err().contains("without additional image references"));
+ request.reference_paths.clear();
+ configuration.validate_inputs(&request).unwrap();
+ request.image_edit.as_mut().unwrap().edits[0].invert_mask = true;
+ assert!(configuration.validate_inputs(&request).unwrap_err().contains("outpainting"));
+}
diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rs
index 94bd743..295a879 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.
+// v14 adds Fibo model routing, validation and image-only weights.
// v13 carries compound lasso masks; older workers would discard holes and splits.
// v12 carries lasso image masks; older workers would silently edit the box.
// v11 carries image CFG; older workers would silently discard the scale.
@@ -19,7 +20,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 = 13;
+pub const PROTOCOL_VERSION: u32 = 14;
/// 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.rs
index f9b83f9..acd0755 100644
--- a/src-tauri/src/agent/generators.rs
+++ b/src-tauri/src/agent/generators.rs
@@ -261,8 +261,15 @@ pub(crate) fn prepare(
return Err("A new generator needs a name.".into());
}
if let Some(model) = &patch.model_type {
- if model != "minimax-h3" {
- return Err("Only the minimax-h3 model family is currently supported.".into());
+ if !["minimax-h3", "moss", "fibo2"].contains(&model.as_str()) {
+ return Err("Unsupported generator model family.".into());
+ }
+ if model != "minimax-h3" && (add || template["modelType"] != model.as_str()) {
+ template["defaultSteps"] = json!(if model == "fibo2" { 4 } else { 50 });
+ template["attention"] = json!("flash2");
+ template["mode"] = json!("prompt");
+ template["motionCache"] = json!(false);
+ template["loras"] = json!([]);
}
template["modelType"] = json!(model);
}
@@ -343,8 +350,8 @@ pub(crate) fn prepare(
return Err("Download the generator's weights and additional files before making it the default.".into());
}
for role in ["transformer", "textEncoder", "videoVae", "audioVae", "tokenizer"] {
- let moss = template["modelType"] == "moss";
- if (moss && role == "audioVae") || (!moss && role == "tokenizer") { continue; }
+ let features = slopus_core::models::generator_features(template["modelType"].as_str().unwrap_or("minimax-h3"));
+ if (!features.video_generation && role == "audioVae") || (template["modelType"] != "moss" && role == "tokenizer") { continue; }
if role == "textEncoder" && template["mode"] == "animate" {
continue;
}
diff --git a/src-tauri/src/agent/tests_generators.rs b/src-tauri/src/agent/tests_generators.rs
index d53230f..db578a8 100644
--- a/src-tauri/src/agent/tests_generators.rs
+++ b/src-tauri/src/agent/tests_generators.rs
@@ -317,3 +317,19 @@ fn inspect_weights_and_edit_generators(scope: AgentScope) {
if scope == AgentScope::Settings { assert!(!project_file.exists()); }
else { assert_eq!(fs::read_to_string(project_file).unwrap(), fixture); }
}
+
+#[test]
+fn fibo_generator_uses_image_defaults_and_needs_no_audio_or_tokenizer() {
+ let dir = tempfile::tempdir().unwrap();
+ let weights = dir.path().join("weights.safetensors");
+ tensor_file(&weights, "weight");
+ let add = command(json!({"op":"generator.add", "id":"fibo", "makeDefault":true,
+ "settings":{"name":"Fibo", "modelType":"fibo2", "paths":{
+ "transformer":weights, "textEncoder":weights, "videoVae":weights
+ }}}));
+ let result = prepare(&GeneratorContext::default(), &[add]).unwrap();
+ assert_eq!(result.settings["defaultTemplateId"], "fibo");
+ let template = &result.settings["templates"][0];
+ assert_eq!(template["defaultSteps"], 4);
+ assert_eq!(template["attention"], "flash2");
+}
diff --git a/src/components/SettingsView.test.tsx b/src/components/SettingsView.test.tsx
index 8675682..24bd7c0 100644
--- a/src/components/SettingsView.test.tsx
+++ b/src/components/SettingsView.test.tsx
@@ -77,7 +77,7 @@ describe("the settings screen", () => {
saveLoras([{ id: "future-adapter", name: "MOSS adapter", modelType: "moss", path: "D:/moss-adapter.safetensors" }]);
open(null);
const models = screen.getByRole("list", { name: "Generator models" });
- expect(within(models).getAllByRole("button").map((button) => button.getAttribute("aria-label"))).toEqual(["MiniMax H3", "MOSS", "Other"]);
+ expect(within(models).getAllByRole("button").map((button) => button.getAttribute("aria-label"))).toEqual(["MiniMax H3", "MOSS", "Fibo 2.0", "Other"]);
expect(screen.queryByRole("button", { name: "Edit Default generator" })).toBeNull();
fireEvent.click(within(models).getByRole("button", { name: "MiniMax H3" }));
expect(screen.getByRole("button", { name: "Edit Default generator" })).toBeTruthy();
@@ -136,6 +136,17 @@ describe("the settings screen", () => {
expect(screen.getByRole("list", { name: "Other weights" })).toBeTruthy();
});
+ 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" }));
+ expect(combo("Generator model").getAttribute("data-value")).toBe("fibo2");
+ expect(combo("Generator attention").getAttribute("data-value")).toBe("flash2");
+ expect(screen.getByRole("button", { name: "More options for Image VAE weights" })).toBeTruthy();
+ expect(screen.queryByRole("button", { name: "More options for Audio VAE weights" })).toBeNull();
+ expect(screen.queryByRole("combobox", { name: "Generator mode" })).toBeNull();
+ expect(screen.queryByRole("switch", { name: "Enable MotionCache" })).toBeNull();
+ });
+
it("groups MOSS under its model and edits its image-only weight setup", () => {
open("MOSS");
expect(screen.getByRole("heading", { level: 1, name: "MOSS" })).toBeTruthy();
diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsx
index 4a3df44..ebed5a9 100644
--- a/src/components/SettingsView.tsx
+++ b/src/components/SettingsView.tsx
@@ -25,7 +25,7 @@ import { retryWeightDownload } from "../lib/weightDownloads";
import { getQueuedWeightDownloads, cancelWeightDownload, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, subscribeWeightDownloads, updateWeightPath, weightDownloadProgress, type DownloadState } from "../lib/weightDownloads";
import { CHECKING_PROVIDERS, chooseEnginePath, getAgentModels, getEngineStatus, type ProviderStatus, type ModelStatus, type SlopfabStatus } from "../lib/runtime";
import {
- EMPTY_ENGINE_SETTINGS, generatorPathFields, generatorModel, GENERATOR_MODELS, MOSS_MODEL_TYPE,
+ EMPTY_ENGINE_SETTINGS, generatorPathFields, generatorModel, GENERATOR_MODELS, MOSS_MODEL_TYPE, FIBO_MODEL_TYPE,
createGeneratorTemplate, defaultGeneratorTemplate,
isEndpointProviderConfigured, loadAgentEndpointSettings,
loadGeneratorTemplateSettings, saveAgentEndpointSettings, saveGeneratorTemplateSettings,
@@ -578,7 +578,7 @@ 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 ? { mode: "prompt", attention: "flash2", defaultSteps: 50, motionCache: false, loras: [], audioSigmaShift: undefined } : {}) })} />
+ ]} 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 } : {}) } : {}) })} />
</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" })}
@@ -592,8 +592,8 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBar
</SettingsCard>
</SettingsGroup>
- <SettingsGroup heading="Sampling">
- {(["videoSigmaShift", "audioSigmaShift"] as const).filter((key) => selectedTemplate.modelType !== MOSS_MODEL_TYPE || key !== "audioSigmaShift").map((key) => {
+ {generatorModel(selectedTemplate.modelType).sigmaShifts && <SettingsGroup heading="Sampling">
+ {(["videoSigmaShift", "audioSigmaShift"] as const).filter((key) => generatorModel(selectedTemplate.modelType).sigmaShifts && (generatorModel(selectedTemplate.modelType).videoGeneration || key !== "audioSigmaShift")).map((key) => {
const label = `${key === "videoSigmaShift" ? selectedTemplate.modelType === MOSS_MODEL_TYPE ? "Image" : "Video" : "Audio"} sigma shift`;
const fallback = selectedTemplate.modelType === MOSS_MODEL_TYPE ? 5 : key === "audioSigmaShift" ? DEFAULT_AUDIO_SIGMA_SHIFT : selectedTemplate.mode === "animate" ? 3 : DEFAULT_VIDEO_SIGMA_SHIFT;
return <SettingsCard key={key} icon={<Steps20 />} header={label} description="Default for this generator. Scene values and active LoRA overrides take priority. Leave blank for the model default.">
@@ -604,12 +604,12 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBar
}} />
</SettingsCard>;
})}
- </SettingsGroup>
+ </SettingsGroup>}
<SettingsGroup heading="Performance">
<SettingsCard icon={<Gauge20 />} header="Attention" description={selectedTemplate.attention === "sol" ? "Sol attention requires a CUDA GPU on the machine running generation." : undefined}>
<ComboBox aria-label="Generator attention" value={selectedTemplate.attention} onChange={(value) => updateTemplate({ attention: value as AttentionMode })}
- options={selectedTemplate.modelType === MOSS_MODEL_TYPE ? [{ value: "flash2", label: "Flash attention" }] : [{ value: "exact", label: "Exact attention" }, { value: "flash2", label: "Flash attention" }, { value: "sage2", label: "Sage attention" }, { value: "sol", label: "Sol attention" }]} />
+ options={generatorModel(selectedTemplate.modelType).cudaOnly ? [{ value: "flash2", label: "Flash attention" }] : [{ value: "exact", label: "Exact attention" }, { value: "flash2", label: "Flash attention" }, { value: "sage2", label: "Sage attention" }, { value: "sol", label: "Sol attention" }]} />
</SettingsCard>
{generatorModel(selectedTemplate.modelType).motionCache && <SettingsCard icon={<Flash20 />} header="Enable MotionCache" description={<span id="motion-cache-help">{selectedTemplate.mode === "animate" ? "Unavailable in Animate mode" : "Reuses similar denoising results to reduce computation. May affect detail and motion."}</span>}>
<ToggleSwitch aria-label="Enable MotionCache" aria-describedby="motion-cache-help"
@@ -642,7 +642,7 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBar
<ReferenceIconSetting templates={templateSettings} />
<div className="settings-card-list" role="list" aria-label="Generator models">
{[...new Set([...GENERATOR_MODELS.map(({ value }) => value), ...templateSettings.templates.map(({ modelType }) => modelType)]), "other"].map((model) =>
- <OpenableCard key={model} icon={model === "other" ? <ModelFile20 /> : model === MOSS_MODEL_TYPE ? <Image20 /> : <Video20 />} header={modelPageLabel(model)}
+ <OpenableCard key={model} icon={model === "other" ? <ModelFile20 /> : !generatorModel(model).videoGeneration ? <Image20 /> : <Video20 />} header={modelPageLabel(model)}
openLabel={modelPageLabel(model)} openRef={`model:${model}`} description={model === "other" ? "Other weights" : "Generators and LoRAs"} onOpen={() => setModelPage(model)} />)}
</div>
</> : modelPage === "other" ? <OtherWeightsSettings desktop={desktop} /> : <>
diff --git a/src/components/workspace/ImageEditor.test.tsx b/src/components/workspace/ImageEditor.test.tsx
index a32da21..6cdc8dd 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, defaultGeneratorTemplate, saveGeneratorTemplateSettings } from "../../lib/settings";
+import { createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, defaultGeneratorTemplate, saveGeneratorTemplateSettings } from "../../lib/settings";
import { createImageEditScene, createImageScene, imageScenePrompt } from "../../lib/imageScene";
import type { WorkItem } from "../../lib/workQueue";
import { compileImageEdits } from "../../lib/imageEditing";
@@ -61,6 +61,31 @@ it.each(["queued", "generating"] as const)("shows a separate empty %s entry with
expect(current().assets[0]).toEqual(original);
});
+it("requires image input for Fibo, enables editing tools and disables unsupported templates", () => {
+ vi.spyOn(persistence, "isTauri").mockReturnValue(true);
+ const fibo = { ...fiboImageTemplate(), sources: {}, paths: { transformer: "fibo", textEncoder: "qwen", videoVae: "flux", tokenizer: "", audioVae: "" } };
+ saveGeneratorTemplateSettings({ templates: [fibo], defaultTemplateId: fibo.id, catalogVersion: 14 });
+ const initial = parseProjectConfig(fixture);
+ initial.imageScene = createImageScene("Make the sky blue");
+ setup(initial);
+ expect(screen.getByRole("combobox", { name: "Generator" })).toHaveTextContent("Fibo 2.0 Edit Turbo");
+ expect(screen.getByRole("button", { name: "Generate" })).toBeDisabled();
+ expect(screen.getByRole("status")).toHaveTextContent("requires one to 4 image references");
+ 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 the sky blue";
+ setup(initial);
+ expect(screen.getByRole("button", { name: "Generate" })).toBeEnabled();
+ expect(screen.getByRole("radio", { name: "Edit Box" })).toBeEnabled();
+ 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: "Character sheet" })).toBeDisabled();
+});
+
it("offers MOSS for new images and disables editing and reference templates", () => {
vi.spyOn(persistence, "isTauri").mockReturnValue(true);
const moss = { ...mossImageTemplate(), sources: {}, paths: { transformer: "moss", textEncoder: "qwen", videoVae: "flux", tokenizer: "tokenizer.json", audioVae: "" } };
diff --git a/src/components/workspace/ImageEditor.tsx b/src/components/workspace/ImageEditor.tsx
index 2f67e3d..e48f53d 100644
--- a/src/components/workspace/ImageEditor.tsx
+++ b/src/components/workspace/ImageEditor.tsx
@@ -73,11 +73,6 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
const generatedImage = config.assets.find((asset) => asset.id === scene.outputAssetId && !asset.imageDraft && asset.imageGeneration);
const recordedSeed = generatedImage?.imageGeneration?.usedSeed ?? generatedImage?.imageGeneration?.scene.seed;
const usedSeed = recordedSeed !== undefined && recordedSeed >= 0 ? recordedSeed : undefined;
- const editPlan = useMemo(() => {
- if (!imageRoot) return null;
- try { return { ...compileImageEdits(config), error: null }; }
- catch (reason) { return { edits: [], error: String(reason instanceof Error ? reason.message : reason) }; }
- }, [config, imageRoot]);
const [selection, setSelection] = useState(root.id);
const selected = scene.nodes.find((node) => node.id === selection) ?? root;
const [collapsed, setCollapsed] = useState(new Set<string>());
@@ -105,9 +100,20 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
const imageTemplates = templates.templates.filter(templateSupportsImages);
const template = imageTemplates.find((candidate) => candidate.id === templateId) ?? imageTemplates.find(templateUsable) ?? imageTemplates[0];
const model = generatorModel(template?.modelType);
+ const editPlan = useMemo(() => {
+ if (!imageRoot) return null;
+ try { return { ...compileImageEdits(config, { modelType: template?.modelType }), error: null }; }
+ catch (reason) { return { edits: [], error: String(reason instanceof Error ? reason.message : reason) }; }
+ }, [config, imageRoot, template?.modelType]);
+ const inputBlocked = useMemo(() => {
+ if (imageRoot || !model.requiresImageInput) return null;
+ try { 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 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 referencesBlocked = !model.imageReferences ? `${model.label} does not support reference images. Choose a reference generator.` : null;
+ const referencesBlocked = !model.characterSheets ? `${model.label} does not support character sheets. Choose a character sheet generator.` : null;
const isMiniMaxH3 = !template || template.modelType === MINIMAX_H3_MODEL_TYPE;
const onChange = (update: ConfigUpdate) => changeConfig((current) => {
const next = typeof update === "function" ? update(current) : update;
@@ -585,9 +591,9 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
// A chip for a video or audio reference names it; one deleted says so.
const missingReference = (id: string) => config.references.find((reference) => reference.id === id)?.name ?? "Deleted reference";
const templateInspector = Boolean((extendMode && output && extendOptions) || (output && templateSourceId === output.id) || (runningTemplate && templateSource));
- const generateDisabled = active ? work.cancelling || work.status === "encoding" : Boolean(effectsBlocked) || Boolean(templateSnapshot && output?.imageDraft) || !isTauri() || !template || !templateUsable(template) || (imageRoot ? Boolean(editingBlocked || editPlan?.error) : !imageScenePrompt(scene));
+ const generateDisabled = active ? work.cancelling || work.status === "encoding" : Boolean(inputBlocked || effectsBlocked) || Boolean(templateSnapshot && output?.imageDraft) || !isTauri() || !template || !templateUsable(template) || (imageRoot ? Boolean(editingBlocked || editPlan?.error) : !imageScenePrompt(scene));
const generateButton = <div className={`image-generation-controls${active ? "" : " image-generation-controls--split"}`}>
- <button type="button" className="primary-button image-generate-button" data-tooltip={effectsBlocked ?? (imageRoot ? editingBlocked : null) ?? editPlan?.error ?? undefined}
+ <button type="button" className="primary-button image-generate-button" data-tooltip={inputBlocked ?? effectsBlocked ?? (imageRoot ? editingBlocked : null) ?? editPlan?.error ?? undefined}
disabled={generateDisabled || (!active && !validCount)} onClick={() => {
if (active) { attempt(() => onCancel(work.id)); return; }
setGenerationCount("1"); setGenerationOptionsOpen(false);
@@ -667,7 +673,7 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
disabled={!output || (!output.relativePath && !output.sourcePath)}
onClick={(event) => templateMenu.open(event.currentTarget, [{ label: "Character sheet", icon: <Image16 />, disabled: Boolean(referencesBlocked),
onSelect: () => { setExtendSourceId(null); setTemplateSourceId(output!.id); },
- }, { label: "Zoom", icon: <Boxes16 />, disabled: Boolean(editingBlocked) || !output?.width || !output?.height || Boolean(active),
+ }, { label: "Zoom", icon: <Boxes16 />, disabled: Boolean(outpaintingBlocked) || !output?.width || !output?.height || Boolean(active),
onSelect: () => {
setTemplateSourceId(null); setExtendSourceId(output!.id);
setExtendOptions({ bounds: initialExtendBounds(output!.width!, output!.height!), prompt: "", steps: template?.defaultSteps ?? 20, seed: -1 });
@@ -762,7 +768,7 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
{boxes && scene.nodes.filter((node) => node.box).map((node) => { const box = pointer.current?.id === node.id && draftBox ? draftBox : node.box!; return <span key={node.id} className="image-box-label" style={{ left: `${box.x / 10}%`, top: `${box.y / 10}%` }}>{node.name}</span>; })}
</div></div>}
{(error || work?.error) && <InfoBar className="image-error" severity="error" title="Couldn’t update the image" message={error ?? work?.error ?? ""} onClose={error ? () => setError(null) : undefined} />}
- <div className="image-status" role="status">{active && <ProgressBar value={work.progress * 100} aria-label="Image generation progress" />}<span>{active ? work.detail : extendMode && extendOptions ? `Zoom: ${extendSize?.width ?? "-"} \u00d7 ${extendSize?.height ?? "-"} px` : templateSnapshot ? `${templateSnapshot.kind === "extend" ? "Zoom" : "Character sheet"} · ${width} × ${height} px` : imageRoot ? editingBlocked ?? editPlan?.error ?? `${width} × ${height} · ${editPlan?.edits.length} edits in hierarchy order` : !isTauri() ? "Image generation is available in the desktop app." : `${width} × ${height}${isMiniMaxH3 ? "" : " · Placement boxes guide the prompt"}`}</span></div>
+ <div className="image-status" role="status">{active && <ProgressBar value={work.progress * 100} aria-label="Image generation progress" />}<span>{active ? work.detail : extendMode && extendOptions ? `Zoom: ${extendSize?.width ?? "-"} \u00d7 ${extendSize?.height ?? "-"} px` : templateSnapshot ? `${templateSnapshot.kind === "extend" ? "Zoom" : "Character sheet"} · ${width} × ${height} px` : imageRoot ? editingBlocked ?? editPlan?.error ?? `${width} × ${height} · ${editPlan?.edits.length} edits in hierarchy order` : inputBlocked ?? (!isTauri() ? "Image generation is available in the desktop app." : `${width} × ${height}${isMiniMaxH3 ? "" : " · Placement boxes guide the prompt"}`)}</span></div>
<ImageBar ref={imageResults} workItems={workItems} images={images} selectedId={scene.outputAssetId} folderPath={folderPath} onSelect={selectImage}
onMenu={(id, x, y, inFamily) => { setContextMenu(null); setImageMenu({ id, x, y, inFamily, source: "bar" }); }} />
</section>
@@ -770,7 +776,7 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
{extendMode && output && extendOptions ? <ExtendSettings config={config} source={output} options={extendOptions} onChange={setExtendOptions}
onResolutionChange={(resolution) => onChange((current) => ({ ...current, imageSettings: { ...imageSettings(current), resolution } }))}
references={promptReferences} missingLabel={missingReference} busy={Boolean(active)}
- disabledReason={editingBlocked ?? (!isTauri() ? "Template execution is available in the desktop app." : !onGenerateExtend || !template || !templateUsable(template) ? "Choose a downloaded generator to execute this template." : null)}
+ disabledReason={outpaintingBlocked ?? (!isTauri() ? "Template execution is available in the desktop app." : !onGenerateExtend || !template || !templateUsable(template) ? "Choose a downloaded generator to execute this template." : null)}
onExecute={() => attempt(() => onGenerateExtend?.(template!, output.id, extendOptions))} onClose={() => setExtendSourceId(null)}
/> : output && templateSourceId === output.id ? <CharacterSheetSettings
config={config} source={output} references={promptReferences} missingLabel={missingReference} defaultSteps={template?.defaultSteps ?? 20} busy={Boolean(active)}
@@ -842,7 +848,7 @@ export function ImageEditor({ config, folderPath, onChange: changeConfig, onGene
</PropSection>}
</div>
<div className="inspector-actions">
- {debugEnabled && <button type="button" className="secondary-button debug-prompt__toggle" aria-haspopup="dialog" onClick={() => attempt(() => setDebugPrompt(imageRoot ? imageEditDebugPrompt(compileImageEdits(config).edits) : compileImagePrompt(config, { modelType: template?.modelType }).prompt))}>Debug prompt</button>}
+ {debugEnabled && <button type="button" className="secondary-button debug-prompt__toggle" aria-haspopup="dialog" onClick={() => attempt(() => setDebugPrompt(imageRoot ? imageEditDebugPrompt(compileImageEdits(config, { modelType: template?.modelType }).edits) : compileImagePrompt(config, { modelType: template?.modelType }).prompt))}>Debug prompt</button>}
{(!extendMode || active) && generateButton}
</div>
</aside>}
diff --git a/src/lib/generatorModels.json b/src/lib/generatorModels.json
index c8edb2a..d9a638b 100644
--- a/src/lib/generatorModels.json
+++ b/src/lib/generatorModels.json
@@ -9,7 +9,15 @@
"loras": true,
"motionCache": true,
"generationEffects": true,
- "cfg": null
+ "cfg": null,
+ "imageOutpainting": true,
+ "characterSheets": true,
+ "requiresImageInput": false,
+ "editImageReferences": true,
+ "maxImageReferences": 9,
+ "refmods": true,
+ "sigmaShifts": true,
+ "cudaOnly": false
},
"moss": {
"label": "MOSS Image",
@@ -23,6 +31,34 @@
"generationEffects": false,
"cfg": {
"default": 3
- }
+ },
+ "imageOutpainting": false,
+ "characterSheets": false,
+ "requiresImageInput": false,
+ "editImageReferences": false,
+ "maxImageReferences": 0,
+ "refmods": false,
+ "sigmaShifts": true,
+ "cudaOnly": true
+ },
+ "fibo2": {
+ "label": "Fibo 2.0",
+ "description": "Image editing with source or reference images on CUDA",
+ "imageGeneration": true,
+ "videoGeneration": false,
+ "imageEditing": true,
+ "imageReferences": true,
+ "loras": false,
+ "motionCache": false,
+ "generationEffects": false,
+ "cfg": null,
+ "imageOutpainting": false,
+ "characterSheets": false,
+ "requiresImageInput": true,
+ "editImageReferences": false,
+ "maxImageReferences": 4,
+ "refmods": false,
+ "sigmaShifts": false,
+ "cudaOnly": true
}
}
diff --git a/src/lib/imageEditing.test.ts b/src/lib/imageEditing.test.ts
index 5ee955c..a6cb627 100644
--- a/src/lib/imageEditing.test.ts
+++ b/src/lib/imageEditing.test.ts
@@ -122,3 +122,17 @@ it("disables feathering for a full-canvas edit box at the selected resolution",
config.imageScene.nodes[1].box!.width = 500;
expect(compileImageEdits(config).edits[0].feather).toBeUndefined();
});
+
+it("uses plain Fibo edit instructions, preserves structured JSON and rejects extra pictures", () => {
+ const config = parseProjectConfig(fixture);
+ config.imageScene = createImageEditScene({ name: "Source", relativePath: "media/source.png", width: 512, height: 512 });
+ const compile = () => compileImageEdits(config, { modelType: "fibo2" });
+ config.imageScene.nodes[0].description = "Make the sky blue";
+ expect(compile().edits[0]).toMatchObject({ prompt: "Make the sky blue.", references: [], feather: 0 });
+ const json = '{"edit_instruction":"Make the sky blue","structured_caption":{"sky":"Blue"}}';
+ config.imageScene.nodes[0].description = json;
+ expect(compile().edits[0].prompt).toBe(json);
+ config.references = [{ id: "extra", kind: "image", name: "Extra", relativePath: "references/extra.png", description: "", intendedUse: [], createdAt: config.createdAt }];
+ config.imageScene.nodes[0].description = "Use @[ref:extra]";
+ expect(compile).toThrow(/source image only/);
+});
diff --git a/src/lib/imageEditing.ts b/src/lib/imageEditing.ts
index 54b5c85..4e7ea90 100644
--- a/src/lib/imageEditing.ts
+++ b/src/lib/imageEditing.ts
@@ -1,3 +1,4 @@
+import { FIBO_MODEL_TYPE } from "./settings";
import { imageSettings } from "./imageSettings";
import { createImageEditScene, createImageScene, imageLassoContours, imageSourceSchema, type ImageNode, type ImageScene, type ImageSource, type ImagePoint } from "./imageScene";
import { compileImagePrompt } from "./imagePrompt";
@@ -29,7 +30,7 @@ export function imageEditSize(source: Pick<ImageSource, "width" | "height">, sho
export function imageEditOutputSize(scene: ImageScene) {
return scene.outputSize ?? imageEditSize(scene.sourceImage!);
}
-export function compileImageEdits(config: ProjectConfig): { source: ImageSource; edits: (ImageEditStep & { references: ProjectReference[] })[] } {
+export function compileImageEdits(config: ProjectConfig, options: { modelType?: string } = {}): { source: ImageSource; edits: (ImageEditStep & { references: ProjectReference[] })[] } {
const scene = config.imageScene!;
const source = scene.sourceImage;
if (!source) throw new Error("Open an image before adding edits.");
@@ -46,10 +47,10 @@ export function compileImageEdits(config: ProjectConfig): { source: ImageSource;
const y = Math.min(size.height - 1, Math.floor(node.box.y * size.height / 1000));
const right = Math.min(size.width, Math.ceil((node.box.x + node.box.width) * size.width / 1000));
const bottom = Math.min(size.height, Math.ceil((node.box.y + node.box.height) * size.height / 1000));
- const description = ["The edited keyframe corresponds to <Picture 1> with the following change. Preserve the composition and any previously completed edits.", node.description,
+ const description = [options.modelType === FIBO_MODEL_TYPE ? "" : "The edited keyframe corresponds to <Picture 1> with the following change. Preserve the composition and any previously completed edits.", node.description,
node.text ? `Render the exact text "${node.text}".` : ""].filter(Boolean).join(" ");
const editScene = { ...createImageScene(description), rootType: "image" as const, sourceImage: source, referenceIds: [] };
- const compiled = compileImagePrompt({ ...config, imageSettings: { ...imageSettings(config), defaultLook: null }, imageScene: editScene });
+ const compiled = compileImagePrompt({ ...config, imageSettings: { ...imageSettings(config), defaultLook: null }, imageScene: editScene }, options);
// A full-canvas edit has no surrounding source to blend into at its edges.
const wholeImage = x === 0 && y === 0 && right === size.width && bottom === size.height;
const contours = imageLassoContours(node).map((points) => points.map(({ x, y }) => ({ x: x * size.width / 1000, y: y * size.height / 1000 })));
diff --git a/src/lib/imagePrompt.test.ts b/src/lib/imagePrompt.test.ts
index cacdf9b..770b15b 100644
--- a/src/lib/imagePrompt.test.ts
+++ b/src/lib/imagePrompt.test.ts
@@ -169,3 +169,16 @@ describe("MiniMax H3 still-image prompts", () => {
expect(() => compileImagePrompt(config)).toThrow("the prompt cites the video reference 'Clip'");
});
});
+
+ it("compiles Fibo reference instructions without H3 wrappers and requires one to four images", () => {
+ const config = photo();
+ const compile = () => compileImagePrompt(config, { modelType: "fibo2" });
+ expect(compile).toThrow(/requires one to 4 image references/);
+ config.references = Array.from({ length: 5 }, (_, i) => ({ id: `ref${i}`, name: `Photo ${i}`, kind: "image" as const, description: "", relativePath: `references/${i}.png`, intendedUse: [], createdAt: config.createdAt }));
+ config.imageScene!.nodes[0].description = "Put @[ref:ref1] beside @[ref:ref0]";
+ expect(compile().references.map(({ id }) => id)).toEqual(["ref1", "ref0"]);
+ expect(compile().prompt).toContain("Photo 1 (image 1) beside Photo 0 (image 2)");
+ expect(compile().prompt).not.toMatch(/Shot|Picture|overall_soundscape|subject_definitions/);
+ config.imageScene!.nodes[0].description = config.references.map(({ id }) => `@[ref:${id}]`).join(" ");
+ expect(compile).toThrow(/requires one to 4/);
+});
diff --git a/src/lib/imagePrompt.ts b/src/lib/imagePrompt.ts
index 3c938ef..849629e 100644
--- a/src/lib/imagePrompt.ts
+++ b/src/lib/imagePrompt.ts
@@ -1,4 +1,4 @@
-import { MOSS_MODEL_TYPE, generatorModel } from "./settings";
+import { FIBO_MODEL_TYPE, MOSS_MODEL_TYPE, generatorModel } from "./settings";
import { imageSettings } from "./imageSettings";
import { createImageScene, imageScenePromptParts, imageScenePromptText } from "./imageScene";
import { actionReferenceIds, activeReferenceRefmods, isVideoReference, referenceDefinition, referenceImages, splitActionText, type ProjectConfig } from "./project";
@@ -20,6 +20,23 @@ export function compileImagePrompt(config: ProjectConfig, options: { modelType?:
if (!model.imageReferences && references.some((reference) => referenceImages(reference).length || activeReferenceRefmods(reference).length)) {
throw new Error(`${model.label} does not support reference images or refmods. Choose a reference generator.`);
}
+ if (options.modelType === FIBO_MODEL_TYPE) {
+ const pictures = references.flatMap(referenceImages);
+ if (references.some((reference) => activeReferenceRefmods(reference).length)) throw new Error("Fibo 2.0 does not support refmods.");
+ if (scene.rootType === "image" && pictures.length) throw new Error("Fibo edits use the source image only. Remove additional image references from this edit prompt.");
+ if (scene.rootType !== "image" && (!pictures.length || pictures.length > model.maxImageReferences)) throw new Error(`Fibo 2.0 requires one to ${model.maxImageReferences} image references. Cite them in the prompt or open an image to edit.`);
+ const parts = imageScenePromptParts(scene);
+ const rootPrompt = scene.nodes.find((node) => node.kind === "root")?.description.trim() ?? "";
+ // Preserve optional structured edit JSON verbatim instead of adding prose punctuation.
+ const structured = rootPrompt.startsWith("{") && scene.nodes.length === 1 && !scene.background.trim() && scene.style.mode === "none";
+ const authored = structured ? rootPrompt : parts ? [parts.style, parts.composition].filter(Boolean).join("\n") : "";
+ let imageIndex = 0;
+ const descriptions = new Map(references.map((reference) => {
+ const numbers = referenceImages(reference).map(() => `image ${++imageIndex}`);
+ return [reference.id, `${reference.name}${numbers.length ? ` (${numbers.join(", ")})` : ""}${referenceDefinition(reference) ? `: ${referenceDefinition(reference)}` : ""}`];
+ }));
+ return { prompt: splitActionText(authored).map((part) => part.kind === "text" ? part.value : descriptions.get(part.value)!).join(""), references };
+ }
if (options.modelType === MOSS_MODEL_TYPE) {
const look = SHOT_TAG_GROUPS.find((group) => group.id === "visualStyle")?.options.find((option) => option.id === imageSettings(config).defaultLook)?.label;
const parts = imageScenePromptParts(scene, look);
diff --git a/src/lib/referenceIconSettings.test.ts b/src/lib/referenceIconSettings.test.ts
index 655da55..99f97a4 100644
--- a/src/lib/referenceIconSettings.test.ts
+++ b/src/lib/referenceIconSettings.test.ts
@@ -46,3 +46,8 @@ it("honors a disabled choice for the session when storage cannot be written", ()
saveReferenceIconAutomation("ask");
}
});
+
+it("excludes image-editing-only Fibo from automatic text reference icons", () => {
+ const fibo = createGeneratorTemplate("Fibo", "fibo2");
+ expect(referenceIconGenerator({ templates: [fibo], defaultTemplateId: fibo.id })).toBeUndefined();
+});
diff --git a/src/lib/referenceIconSettings.ts b/src/lib/referenceIconSettings.ts
index ae500e0..8d98258 100644
--- a/src/lib/referenceIconSettings.ts
+++ b/src/lib/referenceIconSettings.ts
@@ -1,4 +1,4 @@
-import { loadGeneratorTemplateSettings, templateUsable, templateSupportsImages, type GeneratorTemplateSettings } from "./settings";
+import { loadGeneratorTemplateSettings, generatorModel, templateUsable, templateSupportsImages, type GeneratorTemplateSettings } from "./settings";
export type ReferenceIconAutomation = "ask" | "enabled" | "disabled";
@@ -47,7 +47,7 @@ export function saveReferenceIconGeneratorId(id: string) {
}
export function availableReferenceIconGenerators(settings: GeneratorTemplateSettings) {
- return settings.templates.filter((template) => templateSupportsImages(template) && templateUsable(template));
+ return settings.templates.filter((template) => templateSupportsImages(template) && !generatorModel(template.modelType).requiresImageInput && templateUsable(template));
}
export function referenceIconGenerator(settings = loadGeneratorTemplateSettings(), id = loadReferenceIconGeneratorId()) {
diff --git a/src/lib/settings.test.ts b/src/lib/settings.test.ts
index b135a9a..0838c22 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,
- createGeneratorTemplate, mossImageTemplate, defaultGeneratorTemplate, generatorPathFields, templateSupportsVideo,
+ createGeneratorTemplate, mossImageTemplate, fiboImageTemplate, defaultGeneratorTemplate, generatorPathFields, templateSupportsVideo,
engineProviderSetting,
loadInferenceBackend,
saveInferenceBackend,
@@ -25,11 +25,39 @@ import {
describe("generator templates", () => {
beforeEach(() => localStorage.clear());
+ it("adds Fibo once without replacing custom settings or restoring a removed template", () => {
+ 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.defaultTemplateId).toBe(custom.id);
+ expect(loadGeneratorTemplateSettings()).toEqual(migrated);
+ saveGeneratorTemplateSettings({ ...migrated, templates: [custom] });
+ expect(loadGeneratorTemplateSettings().templates).toHaveLength(1);
+ });
+
+ it("configures Fibo with three weights, embedded tokenizer and four Flash steps", () => {
+ const fibo = fiboImageTemplate();
+ expect(createGeneratorTemplate("Fibo", "fibo2")).toMatchObject({ defaultSteps: 4, attention: "flash2" });
+ expect(fibo.paths).toEqual({
+ transformer: "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/diffusion_models/fibo2_edit_turbo_int8_convrot.safetensors",
+ textEncoder: "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/text_encoders/qwen3vl_4b_int8_convrot.safetensors",
+ videoVae: "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/vae/flux2-vae.safetensors", audioVae: "", tokenizer: "",
+ });
+ expect(generatorPathFields(fibo).filter(({ required }) => required).map(({ id }) => id)).toEqual(["transformer", "textEncoder", "videoVae"]);
+ expect(templateSupportsVideo(fibo)).toBe(false);
+ const paths = { ...fibo.paths, transformer: "transformer", textEncoder: "qwen", videoVae: "flux" };
+ const provider = engineProviderSetting(paths, { enabled: true, model: null, options: { tokenizer: "old-tokenizer", audioVae: "old-audio" } }, fibo.attention, [], "prompt", [], false, fibo.sources, fibo);
+ expect(provider.options).toMatchObject({ modelType: "fibo2", attention: "flash2", transformer: "transformer", textEncoder: "qwen", videoVae: "flux" });
+ expect(provider.options).not.toHaveProperty("audioVae");
+ expect(provider.options).not.toHaveProperty("tokenizer");
+ });
+
it("adds MOSS once, preserving local templates, defaults and catalog removal", () => {
const custom = createGeneratorTemplate("Custom");
saveGeneratorTemplateSettings({ templates: [custom], defaultTemplateId: custom.id, catalogVersion: 9 });
const migrated = loadGeneratorTemplateSettings();
- expect(migrated.templates).toEqual([expect.objectContaining(custom), mossImageTemplate()]);
+ expect(migrated.templates).toEqual([expect.objectContaining(custom), mossImageTemplate(), fiboImageTemplate()]);
expect(migrated.defaultTemplateId).toBe(custom.id);
expect(loadGeneratorTemplateSettings()).toEqual(migrated);
saveGeneratorTemplateSettings({ ...migrated, templates: [custom] });
@@ -53,7 +81,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) => template.id !== "moss-image").every((template) => template.modelType === "minimax-h3")).toBe(true);
+ expect(loadGeneratorTemplateSettings().templates.filter((template) => ! ["moss-image", "fibo2-edit-turbo"].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,
@@ -84,7 +112,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(7);
+ expect(settings.templates).toHaveLength(8);
expect(settings.templates[1].name).toBe("First/Last Frame");
expect(settings.templates[0]).toMatchObject({
id: "default",
@@ -152,7 +180,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"]);
+ expect(loadGeneratorTemplateSettings().templates.map(({ name }) => name)).toEqual(["Default", "First/Last Frame", "References", "FastH3 Omni", "Singularity", "Animate", "MOSS Image", "Fibo 2.0 Edit Turbo"]);
});
it.each(["Minimax H3 Original", "My custom generator"])("migrates the saved %s template without changing its configuration", (name) => {
@@ -169,7 +197,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(13);
+ expect(settings.catalogVersion).toBe(14);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
saveGeneratorTemplateSettings({ ...settings, templates: [settings.templates[0]] });
expect(loadGeneratorTemplateSettings().templates).toHaveLength(1);
@@ -179,7 +207,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()]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([references, minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);
});
it("adds Singularity to the previous catalog once while preserving saved templates", () => {
@@ -188,9 +216,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()]);
+ expect(settings.templates).toEqual([expect.objectContaining(custom), minimaxSingularityTemplate(), viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);
expect(settings.defaultTemplateId).toBe(custom.id);
- expect(settings.catalogVersion).toBe(13);
+ expect(settings.catalogVersion).toBe(14);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
saveGeneratorTemplateSettings({ ...settings, templates: [custom] });
expect(loadGeneratorTemplateSettings().templates).toEqual([expect.objectContaining(custom)]);
@@ -201,7 +229,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()]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);
});
it("adds Turbo to saved Singularity once and preserves other adapters and settings", () => {
@@ -211,7 +239,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()]);
+ expect(settings.templates).toEqual([{ ...template, loras: [...template.loras, { loraId: TURBO_LORA.id, enabled: true, strength: 1 }] }, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);
expect(settings.defaultTemplateId).toBe("");
expect(loadGeneratorTemplateSettings()).toEqual(settings);
saveGeneratorTemplateSettings({ ...settings, templates: [template] });
@@ -222,7 +250,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()]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate(), mossImageTemplate(), fiboImageTemplate()]);
});
it("adds FastH3 Omni with eight steps and its model URLs", () => {
@@ -254,8 +282,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()]);
- expect(settings.catalogVersion).toBe(13);
+ expect(settings.templates).toEqual([minimaxFastTemplate(), mossImageTemplate(), fiboImageTemplate()]);
+ expect(settings.catalogVersion).toBe(14);
expect(templateNeedsDownload(settings.templates[0])).toBe(true);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
});
@@ -270,8 +298,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(13);
- expect(settings.templates).toHaveLength(1);
+ expect(settings.catalogVersion).toBe(14);
+ expect(settings.templates).toHaveLength(2);
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 }] } });
@@ -298,7 +326,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]);
+ expect(settings.templates.slice(1)).toEqual([references, fast, fiboImageTemplate()]);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
});
@@ -326,7 +354,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]);
+ expect(settings.templates.slice(1)).toEqual([original, references, fiboImageTemplate()]);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
});
@@ -337,11 +365,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]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, fiboImageTemplate()]);
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)]);
+ expect(settings.templates).toEqual([expect.objectContaining(other), fiboImageTemplate()]);
expect(settings.defaultTemplateId).toBe(other.id);
});
@@ -353,10 +381,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()]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([template, mossImageTemplate(), fiboImageTemplate()]);
const original = minimaxOriginalTemplate();
localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [original], catalogVersion: 8 }));
- expect(loadGeneratorTemplateSettings().templates).toEqual([original, mossImageTemplate()]);
+ expect(loadGeneratorTemplateSettings().templates).toEqual([original, mossImageTemplate(), fiboImageTemplate()]);
});
it.each(["textEncoder", "transformer"] as const)("upgrades saved Minimax %s variants once and preserves downloaded weights", (field) => {
@@ -366,7 +394,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(13);
+ expect(settings.catalogVersion).toBe(14);
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));
@@ -381,7 +409,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"]);
+ 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"]);
});
it.each(["url", "downloaded", "original", "custom", "cached original"])("removes the incompatible encoder from saved templates using %s", (selection) => {
@@ -401,7 +429,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(13);
+ expect(settings.catalogVersion).toBe(14);
expect(migrated.sources!.textEncoder).toEqual([
{ url: originalUrl, gpuModel: "", minVramGb: 0, ...(selection === "cached original" ? { downloadedPath: cachedOriginal } : {}) },
custom,
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
index b0975ca..86e039c 100644
--- a/src/lib/settings.ts
+++ b/src/lib/settings.ts
@@ -74,6 +74,7 @@ function migratedStorageItem(key: string, legacyKey: string): string | null {
export const MINIMAX_H3_MODEL_TYPE = "minimax-h3";
export const MOSS_MODEL_TYPE = "moss";
+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";
@@ -111,10 +112,10 @@ export interface WeightSource {
}
export function generatorPathFields(template: Pick<GeneratorTemplate, "mode"> & { modelType?: string }): EnginePathField[] {
- if (template.modelType === MOSS_MODEL_TYPE) return ENGINE_PATH_FIELDS.filter(({ id }) => id !== "audioVae").map((field) => {
+ if (template.modelType === MOSS_MODEL_TYPE || template.modelType === FIBO_MODEL_TYPE) return ENGINE_PATH_FIELDS.filter(({ id }) => id !== "audioVae").map((field) => {
if (field.id === "transformer") return { ...field, hint: "The main model that turns your description into an image." };
if (field.id === "videoVae") return { ...field, label: "Image VAE weights", hint: "Decodes the model's internal picture into an image." };
- if (field.id === "tokenizer") return { ...field, required: true, directory: false, extensions: ["json"], hint: "The Qwen3.5 tokenizer JSON used by MOSS." };
+ if (field.id === "tokenizer" && template.modelType === MOSS_MODEL_TYPE) return { ...field, required: true, directory: false, extensions: ["json"], hint: "The Qwen3.5 tokenizer JSON used by MOSS." };
return field;
});
return template.mode === "animate"
@@ -229,8 +230,8 @@ export function createGeneratorTemplate(name = "New template", modelType = MINIM
id: `generator-template-${crypto.randomUUID()}`,
name,
modelType,
- defaultSteps: modelType === MOSS_MODEL_TYPE ? 50 : DEFAULT_GENERATION_STEPS,
- attention: modelType === MOSS_MODEL_TYPE ? "flash2" : "sage2",
+ 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),
};
}
@@ -248,6 +249,17 @@ export function mossImageTemplate(): GeneratorTemplate {
return { id: "moss-image", name: "MOSS Image", modelType: MOSS_MODEL_TYPE, defaultSteps: 50, attention: "flash2", paths, sources };
}
+export function fiboImageTemplate(): GeneratorTemplate {
+ const root = "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/";
+ const paths: EngineSettings = {
+ transformer: `${root}diffusion_models/fibo2_edit_turbo_int8_convrot.safetensors`,
+ textEncoder: `${root}text_encoders/qwen3vl_4b_int8_convrot.safetensors`,
+ 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 };
+}
+
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";
const MINIMAX_FL2VA_W4A8_URL = "https://huggingface.co/Winnougan/MiniMax-H3-INT4_Convrot_ComfyUI/resolve/main/minimax_h3_fl2va_pruned-w4a8_convrot_pruned.safetensors";
@@ -319,9 +331,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()],
+ 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()],
defaultTemplateId: "default",
- catalogVersion: 13,
+ catalogVersion: 14,
});
const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings | null => {
@@ -383,7 +395,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].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].includes(record.catalogVersion) ? record.catalogVersion : 0,
};
};
@@ -565,6 +577,12 @@ export function loadGeneratorTemplateSettings(): GeneratorTemplateSettings {
normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 13 })!;
localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));
}
+ if ((normalized.catalogVersion ?? 0) < 14) {
+ const template = fiboImageTemplate();
+ if (!normalized.templates.some(({ id }) => id === template.id)) normalized.templates.push(template);
+ normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 14 })!;
+ localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));
+ }
return normalized;
}
}
@@ -620,7 +638,7 @@ export function engineProviderSetting(settings: EngineSettings, base?: ProviderS
// A LAN worker receives URLs for weights it should download itself.
const remote = remoteWorkerSelected();
const options: ProviderSetting["options"] = { ...(base?.options ?? {}), attention, inferenceBackend: loadInferenceBackend() };
- const moss = shifts.modelType === MOSS_MODEL_TYPE;
+ const imageOnly = !generatorModel(shifts.modelType).videoGeneration;
options.modelType = shifts.modelType ?? MINIMAX_H3_MODEL_TYPE;
// Always replace project-carried adapter paths with this machine's selection.
delete options.loras;
@@ -641,7 +659,7 @@ export function engineProviderSetting(settings: EngineSettings, base?: ProviderS
if (latentUpscaler) options.latentUpscaler = latentUpscaler;
if (remote && sources) {
options.workerWeightSources = JSON.stringify(Object.fromEntries(Object.entries(sources)
- .filter(([role, entries]) => entries?.length && !(moss && role === "audioVae") && !(mode === "animate" && (role === "textEncoder" || role === "tokenizer")))
+ .filter(([role, entries]) => entries?.length && !(imageOnly && role === "audioVae") && !(mode === "animate" && (role === "textEncoder" || role === "tokenizer")))
.map(([role, entries]) => [role, entries!.map(({ url, gpuModel, minVramGb }) => ({ url, gpuModel, minVramGb }))])));
}
if (motionCache && mode !== "animate") options.motionCache = true;
@@ -664,13 +682,13 @@ export function engineProviderSetting(settings: EngineSettings, base?: ProviderS
delete options.motionCache;
}
for (const field of ENGINE_PATH_FIELDS) {
- if ((moss && field.id === "audioVae") || (mode === "animate" && (field.id === "textEncoder" || field.id === "tokenizer"))) {
+ if ((imageOnly && field.id === "audioVae") || (mode === "animate" && (field.id === "textEncoder" || field.id === "tokenizer"))) {
delete options[field.id];
continue;
}
const value = remote ? workerWeight(settings[field.id].trim(), sources?.[field.id]) : settings[field.id].trim();
if (value && (remote || !isDownloadUrl(value))) options[field.id] = value;
- else if (isDownloadUrl(value)) delete options[field.id];
+ else if (isDownloadUrl(value) || shifts.modelType === FIBO_MODEL_TYPE && field.id === "tokenizer") delete options[field.id];
}
return { enabled: base?.enabled ?? true, model: base?.model ?? null, options };
}
diff --git a/src/lib/weightDownloads.test.ts b/src/lib/weightDownloads.test.ts
index 16ce70a..6684664 100644
--- a/src/lib/weightDownloads.test.ts
+++ b/src/lib/weightDownloads.test.ts
@@ -4,7 +4,7 @@ import { cancelWeightDownload, downloadLora, prepareLora, removeLora, refreshDow
import { DMAD_LORA, LIGHTX2V_TURBO_LORA, loadLoras, saveLoras, TAOMATE_LORA, TURBO_LORA, VIGGLE_ANIMATE_LORA } from "./loras";
import { beforeEach, expect, it, vi } from "vitest";
import { chooseWeightSource, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, updateWeightPath, weightDownloadProgress, type DownloadState } from "./weightDownloads";
-import { ANIMATE_CONDITIONING_URL, mossImageTemplate, engineProviderSetting, createGeneratorTemplate, defaultGeneratorTemplate, isDownloadUrl, loadGeneratorTemplateSettings, minimaxOriginalTemplate, minimaxSingularityTemplate, saveGeneratorTemplateSettings, templateNeedsDownload, type WeightSource } from "./settings";
+import { ANIMATE_CONDITIONING_URL, mossImageTemplate, fiboImageTemplate, engineProviderSetting, createGeneratorTemplate, defaultGeneratorTemplate, isDownloadUrl, loadGeneratorTemplateSettings, minimaxOriginalTemplate, minimaxSingularityTemplate, saveGeneratorTemplateSettings, templateNeedsDownload, type WeightSource } from "./settings";
vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn() }));
vi.mock("@tauri-apps/api/event", () => ({ listen: vi.fn(async () => () => undefined) }));
@@ -13,6 +13,18 @@ const files = new Set<string>();
const source = (url: string, gpuModel = "", minVramGb = 0): WeightSource => ({ url, gpuModel, minVramGb });
const saved = () => loadGeneratorTemplateSettings().templates.find((template) => template.id === "minimax-h3-original")!;
+it("downloads only Fibo's three image weights and marks the generator ready", async () => {
+ const fibo = fiboImageTemplate();
+ await downloadTemplateWeights(fibo.id);
+ const urls = vi.mocked(invoke).mock.calls.filter(([command]) => command === "download_weight").map(([, args]) => (args as { url: string }).url);
+ expect(urls.sort()).toEqual(Object.values(fibo.paths).filter(Boolean).sort());
+ expect(urls).toHaveLength(3);
+ const downloaded = loadGeneratorTemplateSettings().templates.find(({ id }) => id === fibo.id)!;
+ expect(templateNeedsDownload(downloaded)).toBe(false);
+ expect(downloaded.paths.tokenizer).toBe("");
+ expect(downloaded.paths.audioVae).toBe("");
+});
+
it("downloads the MOSS weights and tokenizer without audio or adapters", async () => {
const moss = mossImageTemplate();
await downloadTemplateWeights(moss.id);
diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.ts
index a98edc0..aabf46b 100644
--- a/src/lib/workQueue.test.ts
+++ b/src/lib/workQueue.test.ts
@@ -1,5 +1,5 @@
// @vitest-environment jsdom
-import { mossImageTemplate } from "./settings";
+import { mossImageTemplate, fiboImageTemplate } from "./settings";
import { waitFor } from "@testing-library/react";
import { listen } from "@tauri-apps/api/event";
import { invoke } from "@tauri-apps/api/core";
@@ -434,6 +434,30 @@ describe("image generation work", () => {
expect(queue.getSnapshot()).toHaveLength(0);
});
+ 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: "" } };
+ expect(() => queue.enqueue(first, [submission(first)], fibo)).toThrow(/supports video/);
+ const session = queue.project(imageProject());
+ expect(() => queue.enqueueImage(session, fibo)).toThrow(/requires one to 4/);
+ session.update((current) => {
+ const scene = createImageEditScene({ name: "Source", relativePath: "media/source.png", width: 512, height: 512 });
+ scene.nodes[0].description = "Make the sky blue";
+ scene.steps = 4;
+ return { ...current, imageScene: scene };
+ });
+ queue.enqueueImage(session, fibo);
+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledOnce());
+ const [request, config] = vi.mocked(enqueueSlopfabGeneration).mock.calls[0];
+ expect(request).toMatchObject({ stillImage: true, frames: 1, steps: 4, referencePaths: [],
+ imageEdit: { sourceRelativePath: "media/source.png", edits: [{ prompt: "Make the sky blue.", referencePaths: [], feather: 0 }] } });
+ expect(request.guidanceScale).toBeUndefined();
+ expect(config.providerSettings.slopfab.options).toMatchObject({ modelType: "fibo2", attention: "flash2" });
+ expect(config.providerSettings.slopfab.options).not.toHaveProperty("audioVae");
+ expect(config.providerSettings.slopfab.options).not.toHaveProperty("tokenizer");
+ await queue.cancel(queue.getSnapshot()[0].id);
+ });
+
it("routes MOSS text-to-image requests and refuses video and editing work", async () => {
const { queue, first } = setup();
const moss = { ...mossImageTemplate(), sources: {}, paths: { transformer: "moss", textEncoder: "qwen", videoVae: "flux", tokenizer: "tokenizer.json", audioVae: "" } };
diff --git a/src/lib/workQueue.ts b/src/lib/workQueue.ts
index 33cbec2..e61f52a 100644
--- a/src/lib/workQueue.ts
+++ b/src/lib/workQueue.ts
@@ -277,7 +277,7 @@ export class WorkQueue {
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 (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) : null;
+ 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.");
const projectKey = projectQueueKey(session.record);
if (this.items.some((item) => item.projectKey === projectKey && item.kind === "image" && (item.imageDraftId ?? item.imageAssetId) === scene.outputAssetId && isWorkActive(item))) return;
@@ -303,7 +303,7 @@ export class WorkQueue {
current = session.getSnapshot().config;
}
const referencePaths = (selected: typeof references) => [
- ...(edit ? [projectItemPath(session.record.folderPath, edit.source)!] : []),
+ ...(edit && generatorModel(template.modelType).editImageReferences ? [projectItemPath(session.record.folderPath, edit.source)!] : []),
...selected.flatMap((reference) => referenceImages(reference).map((image) => projectItemPath(session.record.folderPath, image)!)),
];
let seed = imageGenerationSeed(scene.seed);
@@ -335,7 +335,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).imageEditing) throw new Error("Choose a generator that supports image editing for Zoom.");
+ if (!generatorModel(template.modelType).imageOutpainting) 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);
@@ -376,7 +376,7 @@ export class WorkQueue {
}
enqueueCharacterSheet(session: ProjectSession, template: GeneratorTemplate, sourceId: string, options?: CharacterSheetOptions) {
if (!isTauri()) throw new Error("Character sheet generation requires the desktop app.");
- if (!generatorModel(template.modelType).imageReferences) throw new Error("Choose a generator that supports image references for character sheets.");
+ if (!generatorModel(template.modelType).characterSheets) throw new Error("Choose a generator that supports image references for character sheets.");
if (template.mode === "animate") throw new Error("Choose a prompt generator for the character sheet.");
const current = session.getSnapshot().config;
const source = current.assets.find((asset) => asset.id === sourceId && asset.kind === "image");