파이프라인 state추가

This commit is contained in:
jaehwang committed 2026-09-08 10:34:33 +09:00
1 parent ee8b940dca
commit 2d4201ce9e
9 files changed
+69 -54

No files matched your search

+5 -2
View File
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from PIL import Image
from pydantic import BaseModel, Field
from pydantic import BaseModel, ConfigDict, Field
Rect = tuple[float, float, float, float]
@@ -17,9 +17,12 @@ class MaskSpec(BaseModel):
class HybridSpec(BaseModel):
# register는 BaseModel 속성과 겹쳐 이름을 바꾸고 alias로 원본 키를 받음
model_config = ConfigDict(populate_by_name=True)
clip: str | None = None
clip_crop: str | None = None # "x0,y0,w,h" — 9:16 캔버스에 얹힌 클립용
register: bool = False
register_frames: bool = Field(False, alias="register")
class LayerConfig(BaseModel):
+32
View File
@@ -0,0 +1,32 @@
"""DB 잡 레코드의 진행도로 쓰이는 파이프라인 단계 상태
실행 순서대로 선언됨
마지막 COMPLETED는 종료 표시
"""
from enum import StrEnum
class PosterAliveState(StrEnum):
DETECT = "detect"
NARRATION_TEXT = "narration_text"
MOTION = "motion"
TTS = "tts"
BGM = "bgm"
I2V = "i2v"
RENDER = "render"
COMPLETED = "completed"
class PlayreelState(StrEnum):
FETCH = "fetch"
SPLIT = "split"
UPSCALE = "upscale"
ANALYZE = "analyze"
MOTION = "motion"
NARRATION = "narration"
TTS = "tts"
BGM = "bgm"
I2V = "i2v"
HYBRID = "hybrid"
COMPOSE = "compose"
REVIEW = "review"
COMPLETED = "completed"
+1 -1
View File
@@ -289,7 +289,7 @@ def render_hybrid(poster: bytes | Path | Image.Image, clip: bytes | Path,
source = Image.open(poster if isinstance(poster, Path)
else io.BytesIO(poster)).convert("RGB")
masks = build_masks(source, config)
do_register = config.hybrid.register or config.mask.mode == "glyph"
do_register = config.hybrid.register_frames or config.mask.mode == "glyph"
proof_at = {round(step * DURATION * FPS / PROOF_COUNT) for step in range(PROOF_COUNT)}
proof_tiles: list[Image.Image] = []
+5 -12
View File
@@ -14,17 +14,10 @@ run "②-부속 캐스트" tests.playreel.test_extract_cast "$goods_id"
cat <<EOF
══ 게이트 ① fetch_confirm — 사람이 정해야 이어진다 ══
확인할 것
meta.json 공연명·장소·기간이 맞는지
sections/_sheet.jpg 섹션 태그가 맞는지 (실측 7/9 일치라 육안 검수가 필요하다)
cast.json source 가 failed 면 출연진을 사람이 채워야 한다
══ 게이트 ① fetch_confirm ══
meta.json 공연명·장소·기간
sections/_sheet.jpg 섹션 태그
cast.json source=failed 면 출연진을 채워야 한다
승인 후 — 게이트 ②까지 간다
uv run python -m tests.playreel.test_upscale_poster "$goods_id"
uv run python -m tests.playreel.test_analyze_poster "$goods_id"
══ 게이트 ② analysis_confirm ══
analysis.json 의 movable 을 사람이 켜고 끈다. review_grid.jpg 로 요소를 지목한다.
ip_risk 가 켜져 있으면 생성 모델이 거부할 수 있다.
다음: tests/run_playreel_after_gate1.sh $goods_id
EOF
+4 -5
View File
@@ -13,11 +13,10 @@ run "④ analyze" tests.playreel.test_analyze_poster "$goods_id"
cat <<EOF
══ 게이트 ② analysis_confirm — 사람이 정해야 이어진다 ══
확인할 것
analysis.json movable 을 켜고 끈다. 여기 승인이 i2v 지출을 확정한다
review_grid.jpg 격자로 요소 위치를 지목한다
══ 게이트 ② analysis_confirm ══
analysis.json movable 을 켜고 끈다
review_grid.jpg 요소 위치
ip_risk 켜져 있으면 생성 모델이 거부할 수 있다
⑤ motion 이후는 아직 서비스가 없다 (⑥ narration · ⑩ hybrid · ⑪ compose).
다음: tests/run_playreel_after_gate2.sh $goods_id [모션키,쉼표구분]
EOF
+2 -5
View File
@@ -13,12 +13,9 @@ run "⑥ narration" tests.playreel.test_narration_slots "$goods_id"
cat <<EOF
══ 게이트 ③ narration_confirm — 사람이 정해야 이어진다 ══
확인할 것
══ 게이트 ③ narration_confirm ══
narration.json 7문장. 캐스팅 스케줄 문장은 빼면 안 된다
캐스트를 못 읽었으면 4번 문장이 안내 문구로 대체돼 있다
i2v_prompt.txt 확정된 i2v 프롬프트
승인 후 — 게이트 ④까지 간다
tests/run_playreel_after_gate3.sh "$goods_id"
다음: tests/run_playreel_after_gate3.sh $goods_id
EOF
+5 -7
View File
@@ -14,12 +14,10 @@ run "⑨ i2v" tests.playreel.test_i2v "$goods_id"
cat <<EOF
══ 게이트 ④ clip_confirm — 사람이 정해야 이어진다 ══
확인할 것
clip.mp4 제목이 훼손되지 않았는지. regions가 없어 자동 게이트가 안 돌므로 눈으로 봐야 한다
i2v.json 쓴 크레딧과 게이트 상태
══ 게이트 ④ clip_confirm ══
clip.mp4 제목 훼손 여부. regions 가 없어 자동 게이트가 안 돈다
i2v.json 크레딧·게이트 상태
다시 만들려면 clip.mp4 를 지우고 ⑨를 다시 돌린다 — 그때만 크레딧이 다시 든다.
⑩ hybrid · ⑪ compose 는 아직 서비스가 없다.
다시 만들려면 clip.mp4 를 지운다.
다음: tests/run_playreel_after_gate4.sh $goods_id [variant]
EOF
+9 -9
View File
@@ -18,14 +18,14 @@ run "⑪ compose" tests.playreel.test_compose_long "$goods_id" "$variant"
cat <<EOF
══ 게이트 ⑤ final_confirm — 마지막 확인 ══
longcut_${variant}.mp4 를 보고 여섯 가지를 본다
첫 프레임이 포스터 원본인가
제목이 온전한가
상세페이지가 풀프레임으로 스크롤되는가
캐스팅 스케줄이 들어갔는가
엔드밴드에 로고·CTA·QR이 있는가
나레이션이 BGM에 묻히지 않는가
══ 게이트 ⑤ final_confirm ══
longcut_${variant}.mp4
첫 프레임 = 포스터 원본
제목 온전
상세페이지 풀프레임 스크롤
캐스팅 스케줄 포함
엔드밴드 로고·CTA·QR
나레이션이 BGM에 안 묻힘
다시 만들 때는 variant 를 바꾼다 — 덮어쓰기는 막혀 있다.
다시 만들 때는 variant 를 바꾼다.
EOF
+6 -13
View File
@@ -15,18 +15,11 @@ run "③ motion" tests.poster_alive.test_motion "$poster"
cat <<EOF
══ 검수 게이트 — 사람이 정해야 이어진다 ══
확인할 것
.narration.txt 나레이션 3문장 · 행사명이 슬로건과 바뀌지 않았는지 · metadata
.check.jpg 검출된 영역이 글자에 맞았는지
.motion.txt 움직일 요소. VLM이 0종을 골랐으면 여기서 사람이 넣어야 한다
══ 검수 게이트 ══
.narration.txt 3문장 · 행사명이 슬로건과 바뀌지 않았는지 · metadata
.check.jpg 검출 영역
.motion.txt 움직일 요소. 0종이면 사람이 넣는다
모션을 다시 정하려면
uv run python -m tests.poster_alive.test_motion "$poster" <모션키,쉼표구분>
승인 후 — 여기부터는 사람 개입 없이 끝까지 간다
uv run python -m tests.poster_alive.test_tts "$poster"
uv run python -m tests.poster_alive.test_bgm "$poster"
uv run python -m tests.poster_alive.test_i2v "$poster"
uv run python -m tests.poster_alive.test_render "$poster"
모션 재지정: uv run python -m tests.poster_alive.test_motion "$poster" <모션키,쉼표구분>
다음: tests/run_poster_alive_after_gate.sh "$poster"
EOF