Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
from .custom import MAX_ACTION_CHARS, build_custom_prompt
from .jump import JUMP_PHASES, build_jump_prompt
from .presets import ACTION_PRESETS, ActionPreset
from .view_sheet import VIEW_SHEET_PROMPT_VERSION, build_view_sheet_prompt
from .view_sheet import (
VIEW_SHEET_PROMPT_VERSION,
build_view_sheet_prompt,
master_pose_clause,
pixel_art_clause,
)
from .walk import build_walk_prompt

# 改动本包任何一个 build_*_prompt 的输出(包括 prompts/*.md 模板)都必须连带把这个
Expand All @@ -25,4 +30,6 @@
"PROMPT_VERSION",
"VIEW_SHEET_PROMPT_VERSION",
"build_view_sheet_prompt",
"master_pose_clause",
"pixel_art_clause",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
西 / 西北 / 西南生产路径水平翻转后上传,不调模型 —— 这三节仍保留,避免执行器误调时
落到空提示词。

正文只写正向计数句。构图约束(单主体、全身、灰底)放在 `## framing`,不抄进每个朝向。
朝向节的三件套(Required view / Body / Visibility)来自 PerfectPixel Studio 的
`facingDescs`。正文只写正向计数句。构图约束放在 `## framing`,定妆构图放在
`## master`。

## identity

```text
This is an image-to-image task. The attached image is the confirmed FRONT-VIEW character master.
Preserve that identity exactly: the same face, hairstyle, body proportions, outfit, colors,
accessories, and silhouette. Change only the camera azimuth around the same standing figure.
It supplies identity only: the same face, hairstyle, body proportions, outfit, colors,
accessories, and silhouette. Facing direction lock (overrides any other facing or view
instruction in this prompt): redraw that identical standing figure at the facing lock below.
Hold that viewing angle for the whole figure. Never drift back toward a front view and never
mirror the character. Left and right of the outfit stay on their own sides of the body.
Same idle pose, same scale, same costume, same character.
```

Expand All @@ -31,6 +36,35 @@ flat even lighting, plain light-gray background. Exactly one character is in the
and the whole body stays inside the frame.
```

## master

定妆 `/generation/image` 用。站立参考,不是动作条带。灰底仍由执行器那句
Plain light-gray 负责,不写洋红。

```text
Before drawing, identify and keep the subject's hairstyle, hair color, eye color, outfit
layers, accessories, weapon or signature prop, and dominant colors. Relaxed idle standing
pose, feet level, weight balanced, arms relaxed and readable. A single figure, head to feet,
vertically centered, occupying about three quarters of the canvas height with breathing room
on every side. Almost flat 2D game-sprite view.
```

## pixel

像素项目才拼这一节。措辞全是正面约束:静态图通路没有 negative_prompt。
来源是 PerfectPixel Studio 的 sprite / low-res 合同,适配本管线:身份锁正视母版,
灰底由 framing 负责,逻辑分辨率由项目精灵尺寸负责,不要写 16×16 / 纯白底 / 洋红。

```text
TRUE pixel art on a square grid, like a 32-64px game sprite enlarged on the canvas.
Each cell of the grid holds one flat solid color. Use a palette of six to eight solid colors;
when a reference image is attached, match that image's colors. Chunky square pixels aligned
to the grid, a clean dark 1px outline around the silhouette, solid tone clusters, at most one
highlight step and one shadow step. Compact torso, clear head shape, simple arms and legs.
Faces stay a flat color plane with readable eyes and mouth. The subject is centered with
empty margin on all sides. Every important shape stays readable at thumbnail size.
```

## elevation.side

```text
Expand All @@ -54,63 +88,77 @@ orthographic, no vanishing point.
## south

```text
Front view, camera on the south, zero-degree azimuth. The character faces the viewer:
the face, chest, and both shoulders are square to the camera, both eyes visible,
the left and right sides of the outfit matching the master.
Facing direction lock: front view, camera on the south, zero-degree azimuth, camera directly
in front at eye level. Body orientation: the character faces the viewer directly.
Visibility: full face visible, eyes and mouth, both arms and both legs fully visible and
symmetric.
```

## east

```text
Right-side profile, camera on the east, ninety-degree azimuth. The character faces right:
a true side view, one eye, the right shoulder and right arm toward the camera,
the left side of the body hidden, the same standing pose as the front master.
Facing direction lock: right-side profile view, camera on the east, ninety-degree azimuth,
camera at the character's right side, perpendicular to the body, strictly 2D profile.
Body orientation: the character faces toward the RIGHT edge of the canvas.
Visibility: true side view, right profile of the face only, one eye and one ear; right arm
and right leg prominent, left limbs fully hidden behind the body.
```

## north

```text
Back view, camera on the north, one-hundred-eighty-degree azimuth. The character faces away:
the back of the head, the back, and both shoulder blades visible, the face hidden,
left and right reversed from the front master, the same standing pose.
Facing direction lock: back view, camera on the north, one-hundred-eighty-degree azimuth,
camera positioned directly behind the character. Body orientation: the character faces away
from the viewer. Visibility: face completely hidden, only the back of the head and hair
visible; back of the outfit, both arms and legs seen from behind.
```

## west

```text
Left-side profile, camera on the west, two-hundred-seventy-degree azimuth. The character
faces left: a true side view, one eye, the left shoulder toward the camera,
the same standing pose as the front master.
Facing direction lock: left-side profile view, camera on the west, two-hundred-seventy-degree
azimuth, camera at the character's left side, perpendicular to the body, strictly 2D profile.
Body orientation: the character faces toward the LEFT edge of the canvas.
Visibility: true side view, left profile of the face only, one eye and one ear; left arm
and left leg prominent, right limbs fully hidden behind the body.
```

## south_east

```text
Three-quarter front view to the right, camera on the south-east, forty-five-degree azimuth.
The face and the right side are both visible, the left side receding, the same standing pose
as the front master.
Facing direction lock: three-quarter front-right view, camera on the south-east,
forty-five-degree azimuth, camera at front-right, rotated about forty-five degrees from
straight ahead. Body orientation: the character is turned about forty-five degrees to the
right, mostly facing the viewer. Visibility: three-quarter face with both eyes visible,
right side emphasized; right arm and leg fully visible, left side partially visible.
```

## north_east

```text
Three-quarter back view to the right, camera on the north-east, one-hundred-thirty-five-degree
azimuth. The back and the right side are both visible, the face mostly hidden,
the same standing pose as the front master.
Facing direction lock: three-quarter back-right view, camera on the north-east,
one-hundred-thirty-five-degree azimuth, camera behind and to the right.
Body orientation: the character is turned away from the viewer, showing the back-right side.
Visibility: face hidden except a hint of the right jaw; back and right shoulder prominent,
right arm and leg visible from behind.
```

## south_west

```text
Three-quarter front view to the left, camera on the south-west, three-hundred-fifteen-degree
azimuth. The face and the left side are both visible, the right side receding,
the same standing pose as the front master.
Facing direction lock: three-quarter front-left view, camera on the south-west,
three-hundred-fifteen-degree azimuth, camera at front-left.
Body orientation: the character is turned about forty-five degrees to the left, mostly
facing the viewer. Visibility: three-quarter face with both eyes visible, left side
emphasized; left arm and leg fully visible, right side partially visible.
```

## north_west

```text
Three-quarter back view to the left, camera on the north-west, two-hundred-twenty-five-degree
azimuth. The back and the left side are both visible, the face mostly hidden,
the same standing pose as the front master.
Facing direction lock: three-quarter back-left view, camera on the north-west,
two-hundred-twenty-five-degree azimuth, camera behind and to the left.
Body orientation: the character is turned away from the viewer, showing the back-left side.
Visibility: face hidden except a hint of the left jaw; back and left shoulder prominent,
left arm and leg visible from behind.
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,41 @@

from windup_ai_engine.prompt._md import load_section

__all__ = ["VIEW_SHEET_PROMPT_VERSION", "build_view_sheet_prompt"]
__all__ = [
"VIEW_SHEET_PROMPT_VERSION",
"build_view_sheet_prompt",
"master_pose_clause",
"pixel_art_clause",
]

_DOC = "view_sheet.md"
VIEW_SHEET_PROMPT_VERSION = "v1"
VIEW_SHEET_PROMPT_VERSION = "v4"


def pixel_art_clause() -> str:
"""像素项目的网格 / 限色约束。定妆与 sheet 图生图共用,避免两处各写一版。"""
return load_section(_DOC, "pixel")


def master_pose_clause() -> str:
"""定妆站立构图。sheet 图生图不拼这一节,身份与机位已在 identity / 朝向节。"""
return load_section(_DOC, "master")


def build_view_sheet_prompt(
direction: ActionDirection | str,
*,
view: CharacterView | str = CharacterView.TOP_DOWN,
extra: str = "",
stylize: str = "none",
feedback: str = "",
) -> str:
"""拼一条从正视母版转出 ``direction`` 的图生图提示词。

``direction`` / ``view`` 都过一遍枚举构造:非法值要炸,不能静默落到某一朝向。
``extra`` 是调用方补的站姿或画风短句,可空;身份与机位以模板为准。
``stylize`` 为 ``pixel`` 时追加网格限色约束;项目画风短语仍不进这条提示词。
``feedback`` 是上一轮 QC 的英文修正,可空;拼在末尾,不替换身份 / 机位节。
"""

azimuth = ActionDirection(direction)
Expand All @@ -38,7 +57,12 @@ def build_view_sheet_prompt(
load_section(_DOC, f"elevation.{perspective.value}"),
load_section(_DOC, "framing"),
]
if stylize == "pixel":
parts.append(pixel_art_clause())
extra_text = extra.strip()
if extra_text:
parts.append(extra_text)
feedback_text = feedback.strip()
if feedback_text:
parts.append(feedback_text)
return " ".join(parts)
Loading
Loading