# -*- coding: utf-8 -*- """V2 epic scene anchors: S01 opening, S03 battlefield, S08 rain night.""" 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() COMMON = "空场景,没有任何人物、士兵、马匹、动物、旗帜、幡、旌旗、军旗、文字、牌匾文字、徽记、现代物品;16:9,4K。电影级战争史诗质感,宽银幕构图,强戏剧光影,体积光,云层光束,大气透视,前景压迫层,胶片颗粒,边缘暗角,画面通透无死黑。参考图仅提供场景元素与材质色调,构图完全重新设计,不复制参考图构图。" S01 = """以参考图1的虎牢关外古道、雪山、关隘元素与材质为基准,构图完全重新设计。风暴刚停,云层被撕开一道巨大的金色天光,虎牢关关隘像巨兽一样伏在雪山之间,高耸压迫;前景是破碎的冰面、枯石与古道车辙,强引导线通向关隘;雪尘与雾在关隘前翻涌,体积光斜穿,冷青阴影+暖金高光,画面宏大、孤独、压迫。空无一人。""" + COMMON S03 = """以参考图1的虎牢关下战场元素与材质为基准,构图完全重新设计。开阔战场,地面被千军踩踏成泥雪混杂的伤痕,断矛与残盾斜插成一片片“兵器林”,远处残墙与关隘压低地平线;战场中央留出一条被光照亮的空路,像刚被一骑冲开;烟尘与雾在地面滚动,云层裂开一道暖金光束照亮那条空路,冷青阴影+暖金高光,宏大、肃杀、留白。空无一人,无尸、无血。""" + COMMON S08 = """以参考图1的下邳雨夜城墙元素与材质为基准,构图完全重新设计。夜雨,城墙与城门洞像黑色巨口,前景泥水如镜倒映城门与远处火光,雨丝在逆光中发银白;一道闪电劈开夜空,照亮城墙轮廓和湿滑地面;远处火光被雨幕压暗,冷青灰+残红点缀,宏大、绝望、收束感。空无一人,无旗无字。""" + COMMON def submit(key, prompt, ref_id): payload = { "client_namespace": "lubu_pv_scene", "idempotency_key": key, "project_id": 30, "model_config_id": 86, "task_type": "image", "references": [{"source_type": "media_asset", "id": ref_id, "asset_type": "image", "role": "reference_image"}], "parameters": {"prompt": prompt, "aspect_ratio": "16:9", "image_size": "4K", "quality": "max", "output_format": "png", "n": 1, "moderation": "low"}, } 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(key, "task_id=", o.get("task", {}).get("id"), "status=", o.get("task", {}).get("status")) except urllib.error.HTTPError as e: print(key, "HTTP", e.code, e.read().decode("utf-8")[:600]) submit("lubu_scene_v2_S01_20261027_v1", S01, 9048) submit("lubu_scene_v2_S03_20261027_v1", S03, 9051) submit("lubu_scene_v2_S08_20261027_v1", S08, 9056)