Centrally manage multiple cover styles. Each style has its own dual-ratio base and visual contract; presenter identities and actions are reused as shared assets. Currently registered 实战风格。
Input contract
A main title must be obtained. The following optional parameters are accepted:
style: style name or alias; if unspecified, use the registry'sdefault_style。subtitle: subtitle; if omitted, leave the subtitle area blank and do not fabricate conclusions.tag: top-left label, defaultAI 实测。highlight: phrases to emphasize; may be passed multiple times.gesture: action preset, defaultzhengzuo(sitting upright).reference_cover: any reference cover; when provided, enter "reference cover with person and text replacement" mode.identity_image: project digital human/real-person identity frame; required in reference cover mode.avatar_video: original digital human master; used when an identity frame needs to be captured on site.output_dir: user-specified path takes priority.
By default, output both 3:4 and 4:3. Reduce output only when the user explicitly wants only one ratio.
Style and action routing
- Read
references/style-registry.json。 - Match the style name spoken by the user against
display_name, slug, andaliases. - When the user does not specify a style, use
default_style. If the reference image clearly requires another registered style, prioritize respecting the reference image. - Read the registered item's
reference_doc, and load only the detailed visual contract of the selected style. - Read
assets/shared/gestures/registry.jsonand the corresponding action'smanifest.json; styles reference actions only viadefault_gestureandallowed_gestures, and do not store action definitions repeatedly. - Unregistered new styles or actions must not be pretended to already exist; establish asset packages according to the "add style" and "add action" processes respectively.
Production workflow
-
Determine whether to use "registered style" or "reference cover with person and text replacement"; choose the title, subtitle, label, and emphasized phrases.
-
Use the built-in
view_imageto view the base, identity image, action image, and style reference image returned by the script. -
Run
scripts/build_prompt.pyto generate the prompt and absolute reference image path for each ratio. For example:python3 scripts/build_prompt.py \ --style shizhan \ --title '史上最强国产开源模型,Kimi K3完全实测!' \ --subtitle '真实项目全流程挑战|综合能力超过 Opus' \ --highlight 'Kimi K3' \ --highlight '完全实测' -
Use the built-in
imagegencapability, callingimage_genonce separately for each ratio. It is forbidden to mechanically crop one ratio into another ratio. -
Pass the reference images strictly in the order returned by the script: the ratio base is responsible for the overall composition, the shared identity image is responsible for the face, hairstyle, and black T-shirt, and the shared action image is responsible only for the pose; if the action manifest provides a ratio composition reference, then the next image is responsible for the person's position, size, and visible range; the last style reference image is responsible for visual calibration. The action manifest's precise composition rules take priority over the general person range in the style.
-
After output, inspect each image one by one. When there is a text error, perform only one targeted "text-only correction" edit, and restate that the identity, action, composition, background, and color remain unchanged.
-
When the user specifies a directory, save to that directory. When it belongs to an existing video project, save to the project's
封面/, and engineering intermediate products must not enter成片/。 -
Run
scripts/validate_cover.pyto check the dual ratios and basic clarity, then complete manual visual quality inspection.
Replace person and text based on reference cover
When the user requests "crop my digital human to replace the person in the image," "adapt this cover to the current project," or an equivalent action:
-
Prioritize capturing frames from the project's original HeyGen/avatar master, not from the final render with circular mask, subtitles, or other UI. Only use the final render when the original master cannot be found, and record the degradation.
-
Run the candidate frame script and use
view_imageto view the contact sheet:python3 scripts/extract_avatar_frames.py <avatar-master.mp4> \ --out-dir <项目>/封面/avatar-reference -
Select frames with a clear face, complete hair, natural expression, and no mid-blink state. The identity frame controls only the face, hairstyle, skin tone, and clothing; the reference cover controls only the background, materials, color scheme, and editing hierarchy.
-
Run the reference cover mode:
python3 scripts/build_prompt.py \ --reference-cover <参考封面.png> \ --identity-image <选中的数字人帧.png> \ --title $'深度测评\nQwen3.8 最新实测' \ --subtitle '三个真实项目|能玩、能交互、能验收' \ --highlight 'Qwen3.8' \ --highlight '最新实测' -
Pass images in the order returned by the script: Image 1 serves only as a style/layout reference, and Image 2 is the sole character identity reference. Must not inherit Image 1's person, glasses, clothing, title, or pseudo-text.
-
3:4 and 4:3 must each be invoked once with
image_genand rearranged independently; mechanically cropping a vertical version into a horizontal one is prohibited. -
Check the character identity, all text, short-side resolution, and exact ratio; save the final image to the project
封面/, keep identity candidate frames in the project archive, and do not include them in成片/。
shared assets
- Black T identity:
assets/shared/avatar/black-t-identity.png - Master gesture registry:
assets/shared/gestures/registry.json - Default gesture "sitting upright" asset pack:
assets/shared/gestures/zhengzuo/ - Alternative gesture "shrug" asset pack:
assets/shared/gestures/tanshou/ - Gesture spec:
references/gesture-presets.md
The identity image controls the face, hairstyle, skin tone, and clothing. The gesture asset pack independently stores the reference image, aliases, usage, restrictions, ratio compatibility, and composition rules; the gesture image can only control the pose and must not override the identity image's control over the face. The ratio composition reference only controls the character's position, size, and upper-body visibility range, and must not copy the old text within it.
Current style
shizhan | practical style
- Style contract:
references/style-shizhan.md - 3:4 base:
assets/styles/shizhan/base/base-clean-3x4.png - 4:3 base:
assets/styles/shizhan/base/base-clean-4x3.png - 3:4 reference:
assets/styles/shizhan/style-reference/style-reference-3x4.png - 4:3 reference:
assets/styles/shizhan/style-reference/style-reference-4x3.png
New style
New <style-slug> complete all steps when:
- In
assets/styles/<style-slug>/base/place an independent 3:4 and 4:3 blank base. - In
assets/styles/<style-slug>/style-reference/place two confirmed style final products. - Create
references/style-<style-slug>.md, recording the color scheme, composition, fonts, character position, and prohibited items. - In
references/style-registry.jsonregister the display name, aliases, asset paths, ratio composition, shared identity,default_gesture、allowed_gesturesand core prompt. - Use
scripts/build_prompt.py --style <style-slug>to test the dual-ratio prompt. - Generate one real sample and pass the quality check for ratio, identity, text, hands, and visual consistency.
Do not copy an entire set of shared characters into every style directory. Only override identity。
for that style when the style genuinely requires another character.
First generate or capture gesture candidates and submit them to the user for confirmation. After confirmation, assets/shared/gestures/<slug>/ establish an independent asset pack, containing at least reference.png and manifest.json; when there is an obvious ratio difference, add reference-3x4.png and reference-4x3.png. Then register in assets/shared/gestures/registry.json, and then have the specific style reference it through allowed_gestures . Unconfirmed gestures must not be marked as approved, nor registered as a default gesture.
Delivery quality check
Check at least:
- The two images are respectively in exact 3:4 and 4:3 ratios, and are laid out independently.
- The selected style is consistent with the registry, style contract, and reference images.
- The identity of the person in the black T-shirt is consistent, and the position, proportions, and hand structure are reasonable.
- All text is correct word for word, with no old titles, pseudo-text, or random characters.
- 3:4 is recommended at 1440×1920, and 4:3 at 1920×1440; the short side must not be less than 1000 pixels.
- No watermarks, platform UI, logos, or additional copy not authorized by the user.
- In reference cover mode, it must be confirmed that the original person, glasses, clothing, and old title from Image 1 have not remained.
For general prompt rules, see references/prompt-template.md。