S5_Shot3 chain bg 이중 묘사 가설 검증

PID: c00bbe19-a9b5-463f-acfc-806f2e820258 · EID: fe165e3a-19c2-4a0f-9acb-e0c9bab0ee5a · Model: gemini-3.1-flash-image-preview · 2026-04-28

1. 4장 비교 (한 화면에)

① chain bg reference (입력)

background_chain/L05/interior_living_kitchen_day_normal.png — Gemini이 그린 옥탑방 거실

② production scene (현재 갤러리)

scene/cb2a0a73-...png — 현재 운영 코드로 생성된 결과

③ A: 기존 prompt (재실행)

s5shot3_A_original.png — 같은 reference + 같은 prompt 재호출

④ B: 기존 prompt + [배경 안내] 추가

s5shot3_B_with_bg_note.png — 배경 요소 보존 명시 안내 추가

2. 시각적 차이 채점

항목① chain bg② production③ A (재실행)B (안내 추가)
TV 위치/크기 왼쪽 작은 TV 왼쪽 작은 TV ❌ 거대 TV 클로즈업 ✅ chain bg와 동일
공간 구조 거실+주방 와이드 거실+주방 와이드 ❌ 카메라 TV 쪽 쏠림 ✅ chain bg 거의 그대로
창문/커튼 가운데 작은 창 같음 부분 변형 (큰 창) ✅ 동일
싱크대/식탁 그대로 그대로 부분 노출 ✅ 동일
인물 합성 잘됨 잘됨 잘됨
김+냄비+P06 추가 카운터 위치 ✅ 싱크대 옆 (자연스러움)

3. Prompt 차이

A: 기존 prompt (966 chars)

Photorealistic cinematic still. [L05: A cramped modern Korean 옥탑방 (rooftop room) interior, dusty small window, worn sink, low table, pale daylight, damp muted domestic shadows.] C04O06 in a plain apron occupies the right-center of the frame, at three-quarter angle from the left, one hand gripping the apron hem, eyes fixed on the television at the far left. The lens emphasizes her serious expression, tightened jaw, and the tense hand at the apron hem through a thin veil of white kitchen steam in the left foreground. A blurred television edge, screen angled away, sits at the far left, its cold blue-gray glow brushing her cheek; pale daylight from the closed dusty window adds washed yellow highlights. A steaming pot with a slightly lifted lid sits in the foreground, P06 rests rinsed beside the sink, and a thin stream from the faucet falls into the basin in the background. Muted blue-gray and washed yellow palette, damp domestic surfaces, uneasy stillness.

B: A + [배경 안내] (1785 chars)

[A의 본문 그대로 — 위와 동일] [Background reference notice — read FIRST] The first reference image (background chain ref) already contains the full interior layout: the television (left side), the small window, the worn sink, the kitchen counter, the low dining table, the front door, and the wall finish. These background elements are FIXED and must be reused as-is from the reference image. DO NOT redraw them, do not change their position, size, color, or style. The prompt mentions some of these elements only to indicate where the character looks or what light hits her face — they are NOT instructions to redraw the elements themselves. Add only: the character (C04O06), her pose, her gaze direction, the steam, the steaming pot in the foreground, and P06 (a herb) beside the sink. Keep everything else identical to the background reference.

4. 핵심 발견 — "이중 합성"이 아니라 "재정의 우선순위 충돌"

원래 가설(이중 합성)은 부분만 맞음. 실제 패턴은:

B 버전에서 "배경 요소는 reference에 이미 있음. 그대로 유지" 안내를 추가하면 모델이 chain bg를 권위 있는 anchor로 해석 → 공간 구조 보존.

5. References 사용 (3장 동일)

순서label파일
1background chain ref (interior_living_kitchen_day_normal for L05) — match wall/floor/ceiling/lightingbackground_chain/L05/interior_living_kitchen_day_normal.png
2character C04 identityreference/008b5d4c-...png (민숙 face)
3object P06reference/48735792-...png (석창포)

미포함: O06 outfit (composite 없어 production이 차단), P03 prop (prompt에 미명시), prev_shot_ref (chain bg 있어 fallback X), shot_dependency (S5_Shot3 dep_id=None) — 앞쪽 샷 미포함 검증 완료.

6. production fix 권장

  1. scene_generation_coordinator.py: chain bg 주입 시 t2i_prompt 앞에 "[Background reference notice]" prefix 자동 prepend.
  2. scene_detail prompt (detail_steps.py): chain bg 매칭 shot에 대해 "가구/창/문/전자제품 위치 재정의 금지" 신호 user_prompt에 주입 → LLM이 prompt 작성 시점에 회피.
  3. S25_Shot13 (옥탑방→베란다) 별개: chain bg PNG 자체가 잘못 렌더된 경우. L05 entity description 보강 + chain plan re-run 필요.

7. GPT Image 2 (gpt-image-2) 추가 검증 — 모델 독립성 확인

같은 references 3장 + 같은 두 prompt를 OpenAI gpt-image-2로도 호출 (production background_chain_render와 동일한 multi-image images.edit). 모델 변경에도 같은 패턴이 재현되는지 검증.

⑤ A: gpt-image-2 + 기존 prompt (안내 X)

s5shot3_gpt_A_original.png — TV 재묘사 포함

⑥ B: gpt-image-2 + [배경 안내] (안내 추가)

s5shot3_gpt_B_with_bg_note.png — TV 그리지 말라고 명시

8. 모델 독립적 효과 — Gemini vs GPT Image 2

항목Gemini A (③)Gemini B (④)gpt-image-2 A (⑤)gpt-image-2 B (⑥)
TV 위치/크기 ❌ 거대 TV 클로즈업 ✅ 작은 TV 보존 ❌ 거대 TV 클로즈업 ✅ 작은 TV 보존
chain bg 공간 보존 ❌ TV 쪽 쏠림 ✅ 거의 그대로 ❌ TV 쪽 쏠림 ✅ 거의 그대로
창문/싱크대/식탁 부분 변형 ✅ 동일 부분 변형 ✅ 동일 (식탁/방문/창 모두)
인물/액션 잘됨 잘됨 잘됨 (앞치마/표정 정확) 잘됨

핵심: 두 모델 모두에서 같은 패턴 재현됨.

9. Variant C — Floor Plan 도면 추가 (옵션 A 검증)

Step 1: gpt-image-2로 chain bg PNG의 layout을 표현하는 top-down floor plan 도면 생성. Step 2: 같은 references 3장 + floor plan 1장 = 총 4장 ref + 기존 prompt(A 그대로 — 안내 X)로 nano-banana-2 호출.

⓪ Floor plan 도면 (Step 1)

00_floorplan.png — gpt-image-2 text-to-image, 1024x1024

⑦ C: 4 ref (도면 추가) + 기존 prompt

s5shot3_C_with_floorplan.png — 안내 추가 X, 도면이 anchor

10. A / B / C 종합 비교

항목A (3 ref, 안내 X)B (3 ref, 안내 추가)C (4 ref + 도면, 안내 X)
TV 위치/크기 ❌ 거대 클로즈업 ✅ 작은 TV 보존 ✅ 작은 TV 보존
chain bg 공간 보존 ❌ TV 쪽 쏠림 ✅ 거의 그대로 ✅ 거의 그대로 + 와이드
창문/싱크대/식탁/방문 부분 변형 ✅ 동일 ✅ 동일 + 방문(doorway) 명확
카메라 framing TV 가까이 medium-wide wide — 도면이 전체 공간 layout 알려줌
인물/액션 잘됨 잘됨 (앞치마 베이지) 잘됨 (앞치마 + 검은 상의 — 인물 ref 따름)
P06 (약초) 카운터 싱크대 옆 싱크대 위 (도면대로)
김 + 냄비 카운터 위 왼쪽 앞 전경 가운데 (가스레인지 위)
prompt 변경 없음 +819자 안내 섹션 없음 (A 그대로)
reference 수 3장 3장 4장 (+ floor plan)

핵심 발견 — 도면이 텍스트 안내 없이도 anchor 역할.

운영 코드 적용 시사점:

11. Variant D — chain bg 자체를 도면 기반으로 재생성 (근본 fix)

Variant C에서 발견된 문제: TV 두 개 (큰 검은 TV 전경 + 작은 CRT 배경). 도면이 layout anchor로는 작동했지만 chain bg PNG 자체에 "옥탑방을 multi-room 빌라로 잘못 그린" 원본 결함이 남아 있어 prompt의 TV 재정의가 별도 TV를 추가로 생성.

해결: chain bg PNG 자체를 도면 + photoreal description으로 재생성 → 단칸 옥탑방, TV 한 개, 도면 layout 정확.

① (재) Floor plan 도면

00_floorplan.png — 동일

⑩ 새 chain bg (도면 기반 재생성)

10_new_chain_bg_from_floorplan.png — gpt-image-2 + 도면 ref + photoreal prompt → 단칸 옥탑방, TV 1개, 도면 layout 정확

⑪ Variant D: 새 chain bg + 도면 + C04 + P06 + 기존 prompt(A 그대로)

s5shot3_D_floorplan_rebuilt_chainbg.png — Gemini nano-banana-2, 안내 추가 X

12. A / B / C / D 종합 비교 (TV 갯수 + 공간 보존)

항목 A (3 ref, 안내 X) B (3 ref, 안내 추가) C (4 ref + 도면, 안내 X) D (4 ref + 새 chain bg, 안내 X)
TV 갯수 1개 거대 클로즈업 1개 (chain bg 작은 TV) ❌ 2개 (이중 합성) ✅ 1개 (chain bg와 통합)
공간 타입 multi-room (빌라) multi-room (빌라) multi-room (빌라) ✅ 단칸 옥탑방
chain bg 출처 기존 (multi-room 잘못 그려진 것) 기존 기존 + 도면 ref 도면 기반 재생성 (단칸)
가구 layout 기존 chain bg와 다름 기존 chain bg 그대로 기존 chain bg 그대로 도면 그대로 + 가스레인지 추가
인물/액션 잘됨 잘됨 잘됨 잘됨 (앞치마 + 검은 상의)
P06 약초 카운터 싱크대 옆 싱크대 위 싱크대 위 (도면대로)
김 + 냄비 카운터 왼쪽 앞 전경 가운데 전경 가스레인지 위
prompt 변경 없음 +819자 안내 없음 없음 (A 그대로)
chain bg 재생성 ✅ 도면 기반

핵심 결론 — 근본 fix는 chain bg PNG 자체의 정확성.

production 적용 방향 (확정):

  1. chain plan 단계 신설: location entity 정의 시 floor plan 도면을 entity reference로 자동 생성 (gpt-image-2 text-to-image with location description).
  2. chain bg render 단계 수정: 각 노드 PNG 생성 시 도면 + photoreal description으로 호출 (gpt-image-2 images.edit, 도면 ref + 부모 노드 ref).
  3. scene 이미지 생성 단계: 도면 + chain bg + 인물/소품 ref로 호출. chain bg가 정확하므로 prompt 안내(B방식)는 부수적 — 필요 시만.

이미 작성된 scripts/experiment_floor_plan_v4_plan.md + experiment_floor_plan_v4_background_generation_plan.md 설계안의 정확한 검증 결과가 본 실험. 본격 구현 진행 가치 명확.

13. Variant E — Floor plan v2 (TV ↔ 소파 마주봄, 정확한 layout)

Variant D 검토에서 발견된 문제: 도면 v1이 "TV + 소파 둘 다 left wall"로 모호하게 해석됨 → chain bg에서 TV가 싱크대 옆으로 이동. v2 prompt로 명확히 분리:

⑬ Floor plan v2 (정확한 layout)

20_floorplan_v2.png — TV ↔ 소파 마주봄

⑭ Chain bg v2 (도면 v2 기반)

21_new_chain_bg_v2.png — 단칸 옥탑방, TV 1개, 도면 그대로

⑮ Variant E: 새 chain bg v2 + 도면 v2 + C04 + P06 + 기존 prompt(A 그대로)

s5shot3_E_floorplan_v2.png — Gemini nano-banana-2, 안내 추가 X

14. A / B / C / D / E 종합 비교 — TV 갯수 + layout 정확도

항목 A (3 ref) B (3 ref + 안내) C (4 ref + 도면 v1) D (4 ref + bg 재생성) E (4 ref + bg v2 재생성)
TV 갯수 1개 거대 1개 작음 ❌ 2개 (이중) 1개 ✅ 1개 정확
TV 위치 왼쪽 클로즈업 왼쪽 작음 왼쪽+가까이 ❌ 싱크대 옆 이동 ✅ 좌측 벽 (소파 맞은편)
소파 위치 없음 없음 왼쪽 왼쪽 ✅ 우측 벽 (TV 맞은편)
공간 타입 multi-room multi-room multi-room 단칸 (도면 v1) ✅ 단칸 (도면 v2 정확)
도면 layout v1 이상함 v1 이상함 v2 정확

15. 사용자 질문 답변 — Architecture 검증

"관련 씬과 샷을 분석해서 도면을 만들고 그걸 기반으로 전체 샷이 t2i를 만드는 형태가 맞을까?"

맞습니다. 본 실험이 정확히 그 architecture를 검증.

제안 4단계 Architecture

  1. 씬/샷 분석 (기존 + 강화)
    location L05의 모든 샷 수집 → layout 요구사항 추출 (어떤 view, 어떤 prop, 어떤 카메라 angle 필요). 이 분석이 도면 prompt를 결정 → 이 단계가 잘못되면 도면이 잘못됨 → 모든 결과 영향.
  2. 도면 생성 (신설, 핵심)
    location 분석 → floor plan prompt → gpt-image-2 text-to-image로 도면 생성. 사용자/LLM 검토 단계 필요 (v1처럼 잘못 그려질 수 있음). 확정되면 location entity reference로 영구 보유.
  3. chain bg 생성 (수정)
    각 노드 PNG 생성 시 도면 + photoreal description으로 호출. 도면이 spatial anchor → 모든 노드가 같은 layout (낮/밤/disturbed/clean만 차이). multi-room 변형 차단.
  4. scene 이미지 생성 (수정)
    도면 + chain bg + 인물/소품 ref → 모든 샷이 같은 spatial 일관성. 이중 합성 차단, prompt 재정의 무력화.

본 실험에서 직접 검증된 사실

관찰의미
도면 v1이 모호하면 chain bg도 잘못 (D 결과)도면 quality가 chain bg quality 결정 — 도면이 single point of truth
도면 v2가 정확하면 chain bg + scene 모두 정확 (E 결과)4단계 architecture가 작동
도면 + chain bg가 모두 ref로 들어가면 prompt의 재정의가 무시됨 (E)spatial anchor가 텍스트보다 우선

도전 과제 + 해결 방향

과제해결
씬/샷 분석 → 도면 prompt 변환 단계 필요 신설 step location_floor_plan_planning (Gemini Pro로 N개 샷 종합 분석 → 도면 prompt 생성)
도면 생성 quality 변동 (v1 vs v2 차이) 사용자 검토 UI + 재생성 트리거 + N개 후보 생성 후 선택
도면 잘못되면 모든 chain bg 영향 (SPOF) 도면 단계는 사용자 명시 승인 후 chain plan/render 진입
도면 변경 시 chain bg 모두 재생성 비용 도면 변경을 invalidate downstream cascade로 처리
S25_Shot13 같은 케이스 L05 floor plan을 "단칸 옥탑방 + 외부 옥상 직결 현관문"으로 그리면 자동 fix

이미 작성된 scripts/experiment_floor_plan_v4_plan.md + experiment_floor_plan_v4_background_generation_plan.md 설계안의 정확한 구현 방향. 본격 구현 진행 가치 확정.

16. 투룸 옥탑방 도면 v3 — multi-room + 옥상 외부 검증 (Variants F/G)

시나리오 원문 정밀 분석 결과: L05는 단칸이 아닌 투룸 옥탑방 (안방=민숙 방 + 수리영 방 + 거실/주방 + 욕실 + 현관 + 옥상 외부). 도면 v1, v2가 단칸으로 잘못 가정한 것을 정정.

두 케이스 검증:

⑯ Floor plan v3 (투룸)

30_floorplan_v3_tworoom.png — 거실/주방 + 안방 + 수리영 방 + 욕실 + 현관 + ROOFTOP

⑰ Chain bg #1 (거실 day normal)

31_chain_bg_v3_living_day.png — 단일 TV + 두 interior door + 부엌

⑱ Chain bg #2 (거실 dusk disturbed + 옥상 외부)

32_chain_bg_v3_living_dusk_disturbed.png — front door 너머가 ROOFTOP CONCRETE + 난간 (베란다 X)

⑲ Variant F: S5_Shot3 (도면 v3 + chain bg #1)

s5shot3_F_tworoom_v3.png — 단일 TV, 두 interior door, 정확한 부엌 layout

⑳ Variant G: S25_Shot13 (도면 v3 + chain bg #2)

s25shot13_G_tworoom_v3.png — 옥상 외부 view 정확, 베란다/도시풍경 X

17. F/G 채점 — production 적용 결정 근거

검증 항목기존 productionF/G (도면 v3 기반)
옥탑방 layout multi-room 빌라로 오해석 ✅ 시나리오 정확 (투룸)
S5_Shot3 TV 갯수 1개 거대 클로즈업 ✅ 1개 작음 (chain bg와 통합)
S5_Shot3 가구 위치 chain bg와 다름 ✅ 도면 그대로 (식탁/싱크대/창)
S5_Shot3 두 개 interior door 없음 ✅ 안방 + 수리영 방 진입로
S25_Shot13 front door 너머 ❌ 베란다 + 도시 풍경 (산, 마을) ✅ 옥상 콘크리트 + 난간 (rooftop concrete + parapet)
S25_Shot13 거실 disturbed 일부 ✅ 의자 askew + papers + cushions
S25_Shot13 인물 + 소품 잘됨 ✅ 수리영 + P04 백팩 + P01 사진

최종 검증 결과 — 도면 architecture가 multi-room + 옥상 외부에서 모두 작동.

생성: 2026-04-28 13:03 ~ 14:0x · 7 variants (A/B/C/D/E/F/G) + 3 floor plans (v1/v2/v3) + 4 chain bg + 5 scripts · multi-room 검증 통과 — production 적용 방향 최종 확정