按参考图选择角色主形象的 provider 模型

角色主形象带参考图时走后端编辑端点,模型改用 gpt-image-2.5-sunburst-c

无参考图生成继续使用 gpt-image-2.5-flare-c
This commit is contained in:
2026-09-19 13:37:55 +08:00
parent 8924bf335e
commit 5ce267ae85
@@ -36,8 +36,8 @@ use crate::{
},
http_error::AppError,
openai_image_generation::{
DownloadedOpenAiImage, GPT_IMAGE_2_5_BUSINESS_NAME, GPT_IMAGE_2_5_GENERATION_MODEL,
OpenAiImageSettings, build_openai_image_http_client,
DownloadedOpenAiImage, GPT_IMAGE_2_5_BUSINESS_NAME, GPT_IMAGE_2_5_EDIT_MODEL,
GPT_IMAGE_2_5_GENERATION_MODEL, OpenAiImageSettings, build_openai_image_http_client,
create_openai_image_generation_with_model, require_openai_image_settings,
},
platform_errors::map_oss_error,
@@ -946,10 +946,16 @@ async fn create_character_visual_generation_once(
candidate_count: u32,
reference_images: &[String],
) -> Result<GeneratedCharacterVisuals, AppError> {
// 中文注释:参考图存在时后端会走编辑端点,因此必须提交编辑模型而不是生成模型。
let provider_model = if reference_images.is_empty() {
GPT_IMAGE_2_5_GENERATION_MODEL
} else {
GPT_IMAGE_2_5_EDIT_MODEL
};
let generated = create_openai_image_generation_with_model(
http_client,
settings,
GPT_IMAGE_2_5_GENERATION_MODEL,
provider_model,
prompt,
Some(build_character_visual_negative_prompt().as_str()),
size,