全能创作闸门与多人物定妆收口
主页已填卖点跳过卖点确认;按图片内容创作不再重复问品牌品名;方案卡支撑改为 P0/P1/P2;多人物视频一次生成多张定妆图并在出片前校验数量;超管登录直进后台。
This commit is contained in:
@@ -2289,9 +2289,10 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
design_from_image = any(kw in clean_ans for kw in ("按图片", "设计品牌", "不用再问"))
|
||||
if design_from_image:
|
||||
memory["product_info_resolved"] = True
|
||||
memory["product_info_from_image"] = True
|
||||
continuation_instruction = (
|
||||
"用户要求直接根据图片内容设计品牌与品名推进创作。"
|
||||
"直接基于图片外观特征推进方案,不要重复追问品牌。"
|
||||
"直接基于图片外观特征推进方案,不要重复追问品牌品名,也不要再弹出品牌确认卡。"
|
||||
)
|
||||
elif is_incomplete_product_brand_answer(clean_ans):
|
||||
memory.pop("product_info_resolved", None)
|
||||
@@ -2374,25 +2375,35 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
appearance_prompt = f"{prev_prompt};按用户最新要求调整:{clean_text}"
|
||||
else:
|
||||
appearance_prompt = clean_text
|
||||
# 卸掉上一张平台定妆锁定,避免新旧角色叠在 pinned_refs 里
|
||||
old_model_id = str(memory_now.get("person_model_id") or "").strip()
|
||||
if old_model_id:
|
||||
# 卸掉上一批平台定妆锁定,避免新旧角色叠在 pinned_refs 里
|
||||
old_model_ids = {
|
||||
str(item).strip()
|
||||
for item in (memory_now.get("person_cast_model_ids") or [])
|
||||
if str(item).strip()
|
||||
}
|
||||
legacy_id = str(memory_now.get("person_model_id") or "").strip()
|
||||
if legacy_id:
|
||||
old_model_ids.add(legacy_id)
|
||||
if old_model_ids:
|
||||
conversation.pinned_refs = [
|
||||
ref for ref in (conversation.pinned_refs or [])
|
||||
if not (
|
||||
isinstance(ref, dict)
|
||||
and ref.get("type") in {"model", "character"}
|
||||
and str(ref.get("id") or "") == old_model_id
|
||||
and str(ref.get("id") or "") in old_model_ids
|
||||
)
|
||||
]
|
||||
memory_now["person_confirm_pending"] = False
|
||||
memory_now.pop("person_source_ready", None)
|
||||
memory_now.pop("person_model_id", None)
|
||||
memory_now.pop("person_cast_model_ids", None)
|
||||
memory_now.pop("person_cast_pending", None)
|
||||
memory_now.pop("person_cast_total", None)
|
||||
conversation.memory = memory_now
|
||||
conversation.save(update_fields=["memory", "pinned_refs", "updated_at"])
|
||||
try:
|
||||
user_msg = append_message(conversation, role="user", text=clean_text)
|
||||
generating = submit_generated_person_reference(
|
||||
generating_messages = submit_generated_person_reference(
|
||||
conversation=conversation,
|
||||
user=request.user,
|
||||
appearance_prompt=appearance_prompt,
|
||||
@@ -2402,7 +2413,10 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
"agent_status": conversation.agent_status,
|
||||
"messages": [
|
||||
CreationMessageSerializer(user_msg).data,
|
||||
CreationMessageSerializer(generating).data,
|
||||
*[
|
||||
CreationMessageSerializer(item).data
|
||||
for item in generating_messages
|
||||
],
|
||||
],
|
||||
}, status=202)
|
||||
except Exception:
|
||||
@@ -2648,7 +2662,7 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
if source == "platform_generate":
|
||||
person_prompt = str(answers.get("person_prompt") or "").strip()[:500]
|
||||
try:
|
||||
generating = submit_generated_person_reference(
|
||||
generating_messages = submit_generated_person_reference(
|
||||
conversation=conversation,
|
||||
user=request.user,
|
||||
appearance_prompt=person_prompt,
|
||||
@@ -2663,7 +2677,10 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
return JsonResponse({
|
||||
"conversation_id": str(conversation.id),
|
||||
"agent_status": conversation.agent_status,
|
||||
"messages": [CreationMessageSerializer(generating).data],
|
||||
"messages": [
|
||||
CreationMessageSerializer(item).data
|
||||
for item in generating_messages
|
||||
],
|
||||
}, status=202)
|
||||
|
||||
# 上传/模特库的人物立即进入实体锁定,不等 Celery turn 开始才保存。
|
||||
@@ -2711,9 +2728,10 @@ class CreationConversationViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
}, status=200)
|
||||
if design_from_image:
|
||||
memory["product_info_resolved"] = True
|
||||
memory["product_info_from_image"] = True
|
||||
continuation_instruction = (
|
||||
"用户要求直接根据图片内容设计品牌与品名推进创作。"
|
||||
"直接基于图片外观特征推进方案,不要重复追问品牌。"
|
||||
"直接基于图片外观特征推进方案,不要重复追问品牌品名,也不要再弹出品牌确认卡。"
|
||||
)
|
||||
else:
|
||||
memory["product_info_resolved"] = True
|
||||
|
||||
Reference in New Issue
Block a user