diff --git a/api/app/core/models/embedding.py b/api/app/core/models/embedding.py index 9ccf53de..3269e1d0 100644 --- a/api/app/core/models/embedding.py +++ b/api/app/core/models/embedding.py @@ -90,7 +90,7 @@ class RedBearEmbeddings(Embeddings): input=contents, **kwargs ) - return [item.embedding for item in response.data] + return [response.data.embedding] async def aembed_multimodal( self, diff --git a/api/app/core/models/generation.py b/api/app/core/models/generation.py index 98b23fbf..b6388d3f 100644 --- a/api/app/core/models/generation.py +++ b/api/app/core/models/generation.py @@ -64,7 +64,6 @@ class RedBearImageGenerator: prompt: 提示词 image: 参考图片URL或URL列表(图文生图/多图融合) size: 图片尺寸,支持 "2K", "2048x2048", "1920x1080" 等(至少3686400像素) - n: 生成数量 output_format: 输出格式,如 "png", "jpg" response_format: 返回格式,"url" 或 "b64_json" watermark: 是否添加水印 diff --git a/api/app/services/generation_service.py b/api/app/services/generation_service.py index e7800ef6..2505793c 100644 --- a/api/app/services/generation_service.py +++ b/api/app/services/generation_service.py @@ -25,8 +25,7 @@ class GenerationService: self, model_config_id: str, prompt: str, - size: Optional[str] = "1024x1024", - n: int = 1, + size: Optional[str] = "2k", **kwargs ) -> Dict[str, Any]: """ @@ -36,7 +35,6 @@ class GenerationService: model_config_id: 模型配置ID prompt: 提示词 size: 图片尺寸 - n: 生成数量 **kwargs: 其他参数 Returns: @@ -69,7 +67,7 @@ class GenerationService: # 生成图片 generator = RedBearImageGenerator(config) - result = await generator.agenerate(prompt, size, n, **kwargs) + result = await generator.agenerate(prompt, size, **kwargs) return result