# -*- coding: utf-8 -*- """Seedream-based clean-质感 scene anchor S01 v3 (keep v2 drama, clean surfaces).""" import json, ssl, pathlib, urllib.request, urllib.error BASE = "https://192.168.31.88:8042" CFG = pathlib.Path(r"C:\Users\admin\.zcode\cli\config.json") pat = json.loads(CFG.read_text(encoding="utf-8-sig"))["mcp"]["servers"]["sorb"]["env"]["SORB_PAT"] ctx = ssl._create_unverified_context() PROMPT = """空场景,没有任何人物、士兵、马匹、动物、旗帜、幡、旌旗、军旗、文字、牌匾文字、徽记、现代物品;16:9,2K。参考图仅提供场景元素与材质色调,构图完全重新设计,不复制参考图构图。 【画面】风暴刚停的虎牢关外古道:云层被撕开一道巨大的金色天光,汉代夯土关隘与城墙像巨兽伏在雪山之间,高耸压迫;前景是平整薄雪覆盖的古道车辙与少量枯草碎石,强引导线通向关隘;雪尘与雾在关隘前翻涌,体积光斜穿画面,冷青阴影+暖金高光,宏大、孤独、压迫,空无一人。 【质感红线(最高优先级)】干净的材质渲染:雪面/天空/雾气均为大面积平滑渐变,禁止网格状假裂纹,禁止泥点颗粒噪,禁止脏斑与碎屑堆砌;细节只允许出现在结构上(车辙、石缝、城砖缝、枯草),不允许出现在大面材质上;整体画面通透、干净、无死黑。 【镜头】电影级战争史诗质感,宽银幕构图,超低角度贴地广角,体积光,大气透视,浅景深背景虚化,胶片颗粒轻微,边缘暗角。""" payload = { "client_namespace": "lubu_pv_scene", "idempotency_key": "lubu_scene_v3_S01_seedream_20261027_v1", "project_id": 30, "model_config_id": 62, "task_type": "image", "references": [{"source_type": "media_asset", "id": 9048, "asset_type": "image", "role": "reference_image"}], "parameters": {"prompt": PROMPT, "aspect_ratio": "16:9", "image_size": "2K", "output_format": "png", "watermark": False}, } data = json.dumps(payload, ensure_ascii=False).encode("utf-8") req = urllib.request.Request(BASE + "/api/external/v1/tasks", data=data, method="POST", headers={"Authorization": "Bearer " + pat, "Content-Type": "application/json"}) try: with urllib.request.urlopen(req, context=ctx, timeout=120) as r: o = json.loads(r.read().decode("utf-8")) print("task_id=", o.get("task", {}).get("id"), "status=", o.get("task", {}).get("status")) except urllib.error.HTTPError as e: print("HTTP", e.code, e.read().decode("utf-8")[:700])