e8b9da5bc3
- 修正阳台标准件prompt:两扇→三对6扇+物理依据(正投影/轴测两件) - 重生成阳台2件并核验;4标准件(卧室窗/厨卫窄窗/阳台正投影/阳台轴测)全合格 - 新增窗户字汇表(_build_parts_sheet.py 拼接3正投影件+中英标签) - 路径C组装prompt + codex完整prompt + codex Mac指南 - 工具:_gen_standard_parts.py / _run_pathc_fuse.py - 路径C首图(apiyi三图融合,阳台6扇一次对,风格统一无割裂)
50 lines
2.0 KiB
Python
50 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
标准件生图辅助(apiyi 通道,无风格前缀)。
|
|
从 prompts/标准件/<名>.txt 读 UTF-8 prompt,生成纯结构示意图到 生成结果/窗户标准件/。
|
|
|
|
为什么需要它:
|
|
- 避开 Windows shell 传中文 prompt 给 Python argv 的 GBK/UTF-8 乱码坑;
|
|
- 标准件是工程结构图(平涂色块、无光照),【不加】STYLE_SEED_EN(那是 cel-shaded 游戏风格,会冲突)。
|
|
|
|
Usage(用英文 key,避免中文 argv):
|
|
python _gen_standard_parts.py # 默认:front + axo(阳台两件)
|
|
python _gen_standard_parts.py front # 仅阳台正投影
|
|
python _gen_standard_parts.py axo # 仅阳台轴测
|
|
python _gen_standard_parts.py bedroom narrow # 卧室窗 + 厨卫窄窗
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
HERE = Path(__file__).resolve().parent # ai-art-research/tools/
|
|
RESEARCH = HERE.parent # ai-art-research/
|
|
sys.path.insert(0, str(HERE))
|
|
from image_gen import get_client, cmd_generate
|
|
|
|
# 英文 key → (prompt 文件名, 尺寸)
|
|
# 横向构图(宽立面/阳台)用 1536x1024;单个竖窗用 1024x1024
|
|
PARTS = {
|
|
"front": ("阳台窗-正投影", "1536x1024"),
|
|
"axo": ("阳台窗-轴测", "1536x1024"),
|
|
"bedroom": ("普通窗-卧室", "1024x1024"),
|
|
"narrow": ("窄窗-厨卫", "1024x1024"),
|
|
}
|
|
|
|
keys = sys.argv[1:] or ["front", "axo"]
|
|
client = get_client()
|
|
for k in keys:
|
|
if k not in PARTS:
|
|
print(f"❌ 未知标准件 key: {k} (可用: {' '.join(PARTS)})")
|
|
continue
|
|
name, size = PARTS[k]
|
|
pf = RESEARCH / "prompts" / "标准件" / f"{name}.txt"
|
|
if not pf.exists():
|
|
print(f"❌ prompt 文件不存在: {pf}")
|
|
continue
|
|
prompt = pf.read_text(encoding="utf-8")
|
|
print(f"\n{'='*60}\n=== 标准件 [{k}] {name} 尺寸 {size} ===\n{'='*60}")
|
|
cmd_generate(client, prompt, use_style=False, size=size,
|
|
quality="medium", model=None, subdir="窗户标准件")
|
|
print("\n✅ 全部完成")
|