# -*- coding: utf-8 -*- """Seedream clean anchors: 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() QUALITY = """【质感红线(最高优先级)】干净的材质渲染:雪面/天空/雾气/水面/泥地均为大面积平滑渐变,禁止网格状假裂纹,禁止泥点颗粒噪,禁止脏斑与碎屑堆砌;细节只允许出现在结构上(车辙、石缝、砖缝、断矛、枯草),不允许出现在大面材质上;整体画面通透、干净、无死黑。 【镜头】电影级战争史诗质感,宽银幕构图,体积光,大气透视,胶片颗粒轻微,边缘暗角,16:9,2K。""" S03 = """空场景,没有任何人物、士兵、马匹、动物、旗帜、幡、旌旗、军旗、文字、牌匾文字、徽记、现代物品。参考图仅提供场景元素与材质色调,构图完全重新设计。 【画面】虎牢关下战场,千军踩踏后的泥雪战场:断矛与残盾成排斜插成“兵器林”,远处残墙与关隘压低地平线;战场中央一条被云隙天光照亮的空路,像刚被一骑冲开;烟尘与雾贴地滚动,冷青阴影+暖金高光,宏大、肃杀、留白,空无一人、无尸无血。""" + QUALITY S08 = """空场景,没有任何人物、士兵、马匹、动物、旗帜、幡、旌旗、军旗、文字、牌匾文字、徽记、现代物品。参考图仅提供场景元素与材质色调,构图完全重新设计。 【画面】下邳雨夜:夯土城墙与城门洞如黑色巨口,一道闪电劈开夜空照亮城墙轮廓;前景泥水如镜,倒映城门与远处火光,雨丝在逆光中呈银白细线;远处火光被雨幕压暗,冷青灰+残红点缀,宏大、绝望、收束感,空无一人、无旗无字。""" + QUALITY def submit(key, prompt, ref_id): payload = { "client_namespace": "lubu_pv_scene", "idempotency_key": key, "project_id": 30, "model_config_id": 62, "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": "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(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_v3_S03_seedream_20261027_v1", S03, 9051) submit("lubu_scene_v3_S08_seedream_20261027_v1", S08, 9056)