重命名图片编辑为提取模块并更新相关调用绘制流程
Project CI / Repository checks (pull_request) Failing after 16s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Native shell tests (pull_request) Failing after 4m22s
Project CI / Frontend tests (pull_request) Successful in 11m36s

This commit is contained in:
2026-09-11 15:18:05 +08:00
parent 8f680ef376
commit b9b4ebd38e
3 changed files with 14 additions and 8 deletions
@@ -1,4 +1,5 @@
mod area;
pub(crate) mod image_preprocess;
mod model;
mod persistence;
mod prompt;
@@ -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<String, String> {
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,
@@ -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::<u32>()
);
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) => {