feat: refine money printer comfy template mode

This commit is contained in:
boos
2026-06-06 03:09:08 +08:00
parent 2b836b3e1e
commit e72e323313
4 changed files with 144 additions and 21 deletions
+20 -1
View File
@@ -126,6 +126,7 @@ async fn resolve_auth(headers: &HeaderMap, state: &AppState) -> Result<MoneyPrin
async fn status(State(state): State<AppState>, headers: HeaderMap) -> AppResult<Json<Value>> {
let auth = resolve_auth(&headers, &state).await?;
let cloud_backend = state.config.comfyui.uses_cloud_backend();
Ok(Json(json!({
"success": true,
"mode": "boosapi-native",
@@ -142,6 +143,15 @@ async fn status(State(state): State<AppState>, headers: HeaderMap) -> AppResult<
"enabled": state.config.comfyui.uses_native_backend(),
"backend": format!("{:?}", state.config.comfyui.backend).to_ascii_lowercase(),
"baseUrl": state.config.comfyui.target_base_url()
},
"builtinCloudTemplate": {
"enabled": cloud_backend,
"label": "内置 Cloud Seedance 文生视频",
"nodeType": "ByteDanceTextToVideoNode",
"model": "seedance-1-0-lite-t2v-250428",
"duration": { "min": 3, "max": 12, "default": 5 },
"resolutions": ["480p", "720p", "1080p"],
"ratios": ["9:16", "16:9", "1:1", "4:3", "3:4", "21:9"]
}
})))
}
@@ -904,9 +914,18 @@ fn repair_bytedance_video_nodes(prompt: &mut Value) {
}
if inputs
.get("resolution")
.is_some_and(|value| !matches!(value.as_str(), Some("480p" | "720p" | "1080p")))
.is_some_and(|value| {
let normalized = value.as_str().unwrap_or_default().trim().to_ascii_lowercase();
!matches!(normalized.as_str(), "480p" | "720p" | "1080p")
})
{
inputs.insert("resolution".to_string(), json!("480p"));
} else if let Some(normalized) = inputs
.get("resolution")
.and_then(Value::as_str)
.map(|value| value.trim().to_ascii_lowercase())
{
inputs.insert("resolution".to_string(), json!(normalized));
}
if inputs
.get("aspect_ratio")