"""Task#6 端到端真跑：3套正交配图。建真实task(product_id=1倍分子素颜霜)。
image_count=2 → 每套2张(hook+product_closeup特写) ×3套 = 6张。
验:①strategy=A/B/C各2张 ②尺寸1024×1536 ③品牌词进特写图 ④三套图真不同。"""
import sys
sys.path.insert(0, "/app")

from app.core.database import SessionLocal
from app.models.task import GenerationTask
from app.constants.enums import TaskStatus

db = SessionLocal()
t = GenerationTask(
    workspace_id=3, product_id=1, operator_id=3,
    theme="伪素颜·黄黑皮提亮·3套正交",
    text_count=1, image_count=2, track="ai",
    need_product_image=True, status=TaskStatus.PENDING,
)
db.add(t); db.commit(); db.refresh(t)
task_id = t.id
print(f"建task成功 task_id={task_id} image_count=2 (期望3套×2=6张)")
db.close()

from app.workers.tasks import run_generation_pipeline
print(f"=== 同步执行 run_generation_pipeline({task_id}) ===")
result = run_generation_pipeline.apply(args=[task_id]).get()
print(f"=== 结果: {result} ===")
