重命名图片编辑为提取模块并更新相关调用绘制流程
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
mod area;
|
||||
pub(crate) mod image_preprocess;
|
||||
mod model;
|
||||
mod persistence;
|
||||
mod prompt;
|
||||
|
||||
+3
-3
@@ -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,
|
||||
|
||||
+10
-5
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user