From b9b4ebd38e911e944b05f79b7e697fbd70f63652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 11 Sep 2026 15:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=BA=E6=8F=90=E5=8F=96=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui_editor/commands/separation/mod.rs | 1 + .../commands/separation/workflow/extract.rs | 6 +++--- .../ui_editor/commands/separation/workflow/mod.rs | 15 ++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) 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) => {