|
|
@@ -4896,6 +4896,18 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
|
|
|
if (is_string($extra_products)) $extra_products = json_decode($extra_products, true);
|
|
|
}
|
|
|
$user_anime_name = getProp($anime, 'anime_name');
|
|
|
+
|
|
|
+ // 处理提示词
|
|
|
+ if ($prompt && $extra_products) {
|
|
|
+ // 遍历extra_products,将prompt中的{product_name}替换为实际的product_name
|
|
|
+ foreach($extra_products as $item) {
|
|
|
+ $product_name = getProp($item, 'product_name');
|
|
|
+ if ($product_name) {
|
|
|
+ // 替换 {product_name} 为 product_name
|
|
|
+ $prompt = str_replace('{' . $product_name . '}', $product_name, $prompt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 处理文本模型
|
|
|
$model = getProp($data, 'model');
|
|
|
@@ -5663,6 +5675,18 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
|
|
|
}
|
|
|
$user_anime_name = getProp($anime, 'anime_name');
|
|
|
$prompt = getProp($data, 'prompt');
|
|
|
+
|
|
|
+ // 处理提示词
|
|
|
+ if ($prompt && $extra_products) {
|
|
|
+ // 遍历extra_products,将prompt中的{product_name}替换为实际的product_name
|
|
|
+ foreach($extra_products as $item) {
|
|
|
+ $product_name = getProp($item, 'product_name');
|
|
|
+ if ($product_name) {
|
|
|
+ // 替换 {product_name} 为 product_name
|
|
|
+ $prompt = str_replace('{' . $product_name . '}', $product_name, $prompt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 处理文本模型
|
|
|
$model = getProp($data, 'model');
|
|
|
@@ -6502,6 +6526,18 @@ Q版卡通风格,头大身小,造型圆润可爱,线条简单,色彩明
|
|
|
$extra_products = getProp($data, 'products', []);
|
|
|
if (is_string($extra_products)) $extra_products = json_decode($extra_products, true);
|
|
|
|
|
|
+ // 处理提示词
|
|
|
+ if ($prompt && $extra_products) {
|
|
|
+ // 遍历extra_products,将prompt中的{product_name}替换为实际的product_name
|
|
|
+ foreach($extra_products as $item) {
|
|
|
+ $product_name = getProp($item, 'product_name');
|
|
|
+ if ($product_name) {
|
|
|
+ // 替换 {product_name} 为 product_name
|
|
|
+ $prompt = str_replace('{' . $product_name . '}', $product_name, $prompt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 获取最后一集序号
|
|
|
$end_episode_sequence = getProp($anime, 'end_episode_sequence');
|
|
|
if ($end_episode_sequence && $episode_number > $end_episode_sequence) Utils::throwError("20003:总集数只有{$end_episode_sequence}集,不允许继续策划下一集!");
|