diff --git a/server-rs/crates/api-server/src/character_visual_assets.rs b/server-rs/crates/api-server/src/character_visual_assets.rs index e4f62bb33..2eaa89e74 100644 --- a/server-rs/crates/api-server/src/character_visual_assets.rs +++ b/server-rs/crates/api-server/src/character_visual_assets.rs @@ -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 { + // 中文注释:参考图存在时后端会走编辑端点,因此必须提交编辑模型而不是生成模型。 + 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,