koishi-plugin-aka-ai-generator 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +13 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -474,6 +474,9 @@ var GptGodProvider = class {
474
474
  }
475
475
  return images;
476
476
  } catch (error) {
477
+ if (error?.message && (error.message.includes("内容被安全策略拦截") || error.message.includes("生成失败") || error.message.includes("处理失败"))) {
478
+ throw error;
479
+ }
477
480
  logger.error("GPTGod 图像编辑 API 调用失败", {
478
481
  message: error?.message || "未知错误",
479
482
  code: error?.code,
@@ -566,7 +569,7 @@ var Config = import_koishi.Schema.intersect([
566
569
  {
567
570
  commandName: "变写实",
568
571
  commandDescription: "以真实摄影风格重建主体",
569
- prompt: "请根据用户提供的图片,在保持主体身份、外观与姿态的前提下生成一张超写实的摄影作品。确保光影、皮肤质感、服饰纹理与背景环境都贴近真实世界,可以适度优化噪点与瑕疵,但不要改变主体特征或添加额外元素,整体效果需像专业摄影棚拍摄。",
572
+ prompt: "请根据用户提供的图片,在保持主体身份、外观与姿态的前提下生成一张超写实的摄影作品。采用Ultra-realistic 3D rendered风格,确保光影、皮肤质感、服饰纹理与背景环境都贴近真实世界。画面应呈现raw and natural的原始自然感,具有authentic film snapshot的真实胶片质感。使用strong contrast between light and dark营造强烈明暗对比,产生deep shadows深阴影效果。整体需具备tactile feel触感质感和simulated texture模拟纹理细节,可以适度优化噪点与瑕疵,但不要改变主体特征或添加额外元素,整体效果需像专业摄影棚拍摄的真实照片。",
570
573
  enabled: true
571
574
  },
572
575
  {
@@ -954,6 +957,9 @@ function apply(ctx, config) {
954
957
  } catch (error) {
955
958
  activeTasks.delete(userId);
956
959
  logger.error("图像处理失败", { userId, error });
960
+ if (error?.message && (error.message.includes("内容被安全策略拦截") || error.message.includes("生成失败") || error.message.includes("处理失败"))) {
961
+ return error.message;
962
+ }
957
963
  return "图像处理失败,请稍后重试";
958
964
  }
959
965
  }
@@ -1065,6 +1071,9 @@ Prompt: ${prompt}`);
1065
1071
  } catch (error) {
1066
1072
  activeTasks.delete(userId);
1067
1073
  logger.error("自定义图像处理失败", { userId, error });
1074
+ if (error?.message && (error.message.includes("内容被安全策略拦截") || error.message.includes("生成失败") || error.message.includes("处理失败"))) {
1075
+ return error.message;
1076
+ }
1068
1077
  return "图像处理失败,请稍后重试";
1069
1078
  }
1070
1079
  })(),
@@ -1161,6 +1170,9 @@ Prompt: ${prompt}`);
1161
1170
  } catch (error) {
1162
1171
  activeTasks.delete(userId);
1163
1172
  logger.error("图片合成失败", { userId, error });
1173
+ if (error?.message && (error.message.includes("内容被安全策略拦截") || error.message.includes("生成失败") || error.message.includes("处理失败"))) {
1174
+ return error.message;
1175
+ }
1164
1176
  return "图片合成失败,请稍后重试";
1165
1177
  }
1166
1178
  })(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-aka-ai-generator",
3
3
  "description": "自用AI生成插件(GPTGod & Yunwu)",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [