一次拍摄,四十张图,一个交付日。六个房间,每间两道工序,画面得看上去像同一天下午的同一套房。多数团队靠人手一张张改,交出去的东西出的不是审美问题:一面墙挪了半米,光从两个方向来,没人记得哪几张布置过。

这条流水线把房源当成文件夹,而非一张照片。第一道清空房间,第二道摆上家具,最后一道闸门决定哪些图能交付。

两道工序,不是一次编辑

清空删掉画面里真实存在的物件,布置加上房间里根本没有的物件。合并成一次请求,模型会重读整个场景:删椅子的同时顺手重画窗框,而重画过的窗框在房源里就是事实错误。

更新说明支持拆开做:GPT Image 2.5 更擅长只改你指定的部分,其余细节保持不变;API 能更新单个元素,同时保留主体、构图和周边的品牌处理。合起来就是一句话:写清改什么、不动什么。

API 帮不上忙的地方

三条已写明行为,决定提示词怎么写。

遮罩只是提示,不是几何。遮罩处理完全基于提示词,模型未必严格遵循形状,多张输入图时只作用于第一张。你没法靠涂掉一面墙保护它,只能靠命名,边界见遮罩编辑。

参考图保真度是自动的。input_fidelity 不要传,API 不接受修改,因为每张输入图都按高保真处理。这对房间是好事,对账单不是:带参考图的编辑消耗更多输入 token,官方未公布单张价格。

摆放会漂移。同一页文档提醒,模型在结构化或对版式敏感的构图里可能难以精确定位元素。家具浮空是已记录的行为,不是靠提示词能骂走的 bug。

第一道:把房间清空

清空提示词只有一个任务:拿走业主的东西,别动别的。先点名必须留下的四样,再按类别列删除项,而不是逐个列物件,这样同一段文字在第二间卧室也能用。

Interior photograph of a furnished room. Remove all personal and movable items: clothes, towels, toiletries, toys, pet items, kitchen clutter, small appliances, wall decorations, and any lettering on packaging. Keep the architecture exactly as photographed: wall lines, ceiling line, window frames, door frames, radiators, built-in wardrobes, flooring pattern and skirting boards must not move, resize or change material. Keep the original camera position and the direction and colour of the daylight. Fill the cleared areas with the same floor and wall surfaces they reveal. Photorealistic, same lens, same framing. No text, no logos, no watermarks, no people.

出图后按百分之百比例和原片对照。看踢脚线、窗格数量、删掉那把椅子底下的影子。残影是赶工清空最典型的破绽。

第二道:摆家具,不挪墙

虚拟布置把清空后的图作为参考图送回模型,壳体因此被锚住。描述单品和位置,别描述气氛:写“床靠着长墙”,不写“安静的北欧风卧室”。面料与配色怎么选,室内渲染流程讲得更细。

左侧是同一间房清空后的样子,右侧是布置后的样子,一面墙与一扇窗用虚线和挂锁标为固定不动

保持原片的机位高度。一米六拍的室内图按一米一的视高布置,读起来就是另一套房;买家先注意天花线,再注意沙发。

Using the cleared room as the reference, add furniture only. Place a queen bed with a plain headboard against the long wall, centred on that wall, with the bed base on the floor and a soft shadow beneath it. Add one low rug under the front two thirds of the bed, one bedside table on the window side with a small lamp, and one framed print above the headboard, centred. Keep the camera height, wall lines, window frames, flooring, skirting boards and daylight direction identical to the reference. Furniture must sit on the floor plane and respect the room's perspective. Neutral palette. No text, no logos, no people, no watermarks.

两种失误反复出现:单品比例不对,家具停在那扇支撑整张照片的窗前。和清空图并排看都很明显;只看布置图,两个都看不见。

两个例子:卧室与客厅

卧室是简单的一遍,因为锚点清楚。

Add a double bed against the wall opposite the window, leaving 60 cm of floor visible on each side of the bed. Keep the window wall completely clear. Add one rug and one small plant in the far corner. Same camera height, same light direction, same wall colour.

客厅是难的一遍:可选布局更多,模型喜欢拿一个大件塞满画面中央。

Add a three-seat sofa against the left wall, facing the window, with its back legs on the floor and 40 cm of gap behind it. Add a low coffee table in front of the sofa, aligned to its centre, and leave the walkway from the door to the window empty. Keep the floor visible between all pieces. Same camera height, same light direction.

真正要量的是通道。走不进去的房间,就算说不出原因,看的人也别扭。

按房源批量,不按单图

请求只是小头,账目才是产品:房源一个文件夹,文件名可预测,清单记录每张图来自哪张原片、用了哪版提示词。尺寸走四条已公布的约束,1536×1024 满足横向室内图。

import base64
import hashlib
import json
import pathlib

from openai import OpenAI

client = OpenAI()
listing = pathlib.Path("listings/4821-maple")
out = listing / "staged"
out.mkdir(parents=True, exist_ok=True)

CLEAR = pathlib.Path("prompts/clear.txt").read_text()
STAGE = pathlib.Path("prompts/stage.txt").read_text()
VERSION = hashlib.sha256(STAGE.encode()).hexdigest()[:12]
MANIFEST = listing / "manifest.jsonl"

for raw in sorted((listing / "raw").glob("*.jpg")):
    room = raw.stem
    with raw.open("rb") as handle:
        cleared = client.images.edit(
            model="gpt-image-2.5-flare",
            image=handle,
            prompt=CLEAR,
            size="1536x1024",
            quality="high",
            output_format="webp",
            output_compression=90,
        )
    cleared_path = out / f"{room}-cleared.webp"
    cleared_path.write_bytes(base64.b64decode(cleared.data[0].b64_json))

    with cleared_path.open("rb") as handle:
        staged = client.images.edit(
            model="gpt-image-2.5-flare",
            image=handle,
            prompt=STAGE,
            size="1536x1024",
            quality="high",
            output_format="webp",
            output_compression=90,
        )
    staged_path = out / f"{room}-staged.webp"
    staged_path.write_bytes(base64.b64decode(staged.data[0].b64_json))

    entry = {"room": room, "source": raw.name, "staged": staged_path.name, "prompt_version": VERSION}
    with MANIFEST.open("a") as manifest:
        manifest.write(json.dumps(entry) + "\n")

两条规矩让批次靠得住。送进去的永远是清空文件,不是原片,否则布置会把刚清掉的杂物加回来。再存提示词哈希:三月有人问卧室为什么变了,哈希指出是哪版措辞。

最后一道交付闸门

C2PA 元数据和隐形水印只能证明这是模型生成的图,不能告诉买家房间现实施空。那句话来自交付表,逐张写。

import csv
import pathlib

from PIL import Image

listing = pathlib.Path("listings/4821-maple")
rows = []

for staged in sorted((listing / "staged").glob("*-staged.webp")):
    with Image.open(staged) as img:
        w, h = img.size
        assert w % 16 == 0 and h % 16 == 0, (staged.name, w, h)
        assert 655_360 <= w * h <= 8_294_400, (staged.name, w * h)
    cleared = staged.with_name(staged.name.replace("-staged", "-cleared"))
    assert cleared.exists(), f"no cleared frame for {staged.name}"
    rows.append(
        {
            "file": staged.name,
            "staged": "yes",
            "disclosure": "Virtually staged. Furniture is not present in the property.",
            "approved_by": "",
        }
    )

with (listing / "delivery.csv").open("w", newline="") as handle:
    writer = csv.DictWriter(handle, fieldnames=rows[0].keys())
    writer.writeheader()
    writer.writerows(rows)

最后一列故意留空。写上名字,意味着有人看过这张图并接受了披露文本,这是唯一没法自动化的列。

步骤输入不得改变失败信号
清空原始图墙、窗、地面、光线残留影子、多出的门洞
布置清空图机位高度、壳体家具浮空、通道被堵
闸门两张图逐张披露文本缺清空文件、审核人为空
拒收moderation_blocked输入本身输入未改就重试

有一种错误要单独开分支。moderation_blocked 属用户可修正错误,文档写明输入未变时不得自动重试。先读 moderation_details.moderation_stage:input 指提示词或照片,output 指渲染结果,unknown 就先记日志再看。空房间广角最容易触发过滤,留一条人工队列,别写重试循环。

常见问题

为什么不能一次做完两道工序?

两道工序的不变量不同:清空删物件、保留建筑,布置加物件、也保留建筑。一段提示词做两件事,等于允许模型重新解释壳体。

清空后的图要交付吗?

通常不用。少数中介想要空房间做户型示意,多数客户从不展示。按客户定,写进清单。

能用遮罩保住一面墙吗?

只能近似。遮罩基于提示词,未必遵循精确形状;多张输入时只作用于第一张。用遮罩加偏置,用提示词点名留下什么。

房源流水线的好坏,看它拒绝交付什么:一面墙挪过的图、没有披露的布置图、对一张本来过不了的输入反复重试。