diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/mod.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/mod.rs index 6e8a0f6fa..5350db82d 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/mod.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/mod.rs @@ -1,4 +1,5 @@ mod area; +pub(crate) mod image_preprocess; mod model; mod persistence; mod prompt; diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs index 88a48d5f7..45096b14a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs @@ -15,7 +15,7 @@ struct RawEditItem { b64_json: String, } -pub(super) async fn raw_image_edit( +pub(super) async fn raw_extract( session: &PlatformSessionSnapshot, image_data_url: &str, prompt: &str, @@ -23,7 +23,7 @@ pub(super) async fn raw_image_edit( height: u32, ) -> Result { let started = Instant::now(); - let result = raw_image_edit_inner(session, image_data_url, prompt, width, height).await; + let result = raw_extract_inner(session, image_data_url, prompt, width, height).await; app_log!( "ui_separation.image_edit.timing outcome={} elapsed_ms={} width={} height={}", if result.is_ok() { "ok" } else { "error" }, @@ -34,7 +34,7 @@ pub(super) async fn raw_image_edit( result } -async fn raw_image_edit_inner( +async fn raw_extract_inner( session: &PlatformSessionSnapshot, image_data_url: &str, prompt: &str, diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs index 0a9a5c652..b6b245a8b 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/mod.rs @@ -1,6 +1,6 @@ mod binding; mod cut; -mod image_edit; +mod extract; mod patch; pub use patch::apply_batch_patch; @@ -128,7 +128,7 @@ pub(crate) async fn separate_ui_impl( tree_index, batch_index, batch.len(), prompt.chars().count(), batch.iter().map(|node| node.rework_count).sum::() ); - let processed_url = match image_edit::raw_image_edit( + let processed_url = match extract::raw_extract( &session, &source_url, &prompt, @@ -146,15 +146,20 @@ pub(crate) async fn separate_ui_impl( }; let processed_path = sidecar.join(format!("processed-{}.png", separation.bound.len())); if let Err(error) = - image_edit::write_processed_image(processed_url.clone(), processed_path.clone()) + extract::write_processed_image(processed_url.clone(), processed_path.clone()) .await { app_log!("ui_separation.error stage=processed_image_write tree_index={} batch_index={} error={error}", tree_index, batch_index); write_separation_state(&state_path, &separation)?; return Err(error); } - let binding = match binding::visual_binding(source_url.clone(), processed_url, &batch) - .await + let binding = match binding::visual_binding( + source_url.clone(), + processed_url, + sidecar.clone(), + &batch, + ) + .await { Ok(value) => value, Err(error) => {