스타일링 1차 기능 추가
This commit is contained in:
1 parent
3555fa05a2
commit
2140f7d5c8
12 files changed
+531
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"""스타일링 ① — 포스터에 인쇄된 글자 판독 응답 스키마
|
||||
|
||||
이미지 생성 모델이 한글을 다시 그리며 자모를 바꾸므로(맥주축제 → 백주축제)
|
||||
읽기 잘하는 모델에 먼저 읽히고 그 문자열을 생성 프롬프트에 못 박는다.
|
||||
"""
|
||||
from pydantic import BaseModel
|
||||
|
||||
MAX_EXTRA_LINES = 3
|
||||
|
||||
|
||||
class PosterTextAnswer(BaseModel):
|
||||
title: str
|
||||
slogan: str
|
||||
date: str
|
||||
time: str
|
||||
place: str
|
||||
extra: list[str]
|
||||
@@ -0,0 +1,21 @@
|
||||
"""스타일링 ② — 레퍼런스 화풍 분석 응답 스키마
|
||||
|
||||
무드 형용사는 픽셀로 번역되지 않아 팔레트·조명·질감·타이포·구도 다섯을 요구한다.
|
||||
짧게 나오면 다섯 중 빠진 것이 있다는 뜻이라 통과시키지 않는다.
|
||||
"""
|
||||
from pydantic import BaseModel, field_validator
|
||||
|
||||
MIN_STYLE_PROMPT_CHARS = 200
|
||||
|
||||
|
||||
class StylePromptAnswer(BaseModel):
|
||||
style_prompt: str
|
||||
|
||||
@field_validator("style_prompt")
|
||||
@classmethod
|
||||
def must_cover_five_elements(cls, style_prompt: str) -> str:
|
||||
text = style_prompt.strip()
|
||||
if len(text) < MIN_STYLE_PROMPT_CHARS:
|
||||
raise ValueError(f"style_prompt가 {len(text)}자로 너무 짧음 "
|
||||
f"({MIN_STYLE_PROMPT_CHARS}자 이상) — 5요소가 다 안 나옴")
|
||||
return text
|
||||
Reference in new issue
Block a user