Generate consistent photo sets using a model card for face-locking. Two modes — Grid Mode (4-photo grid) and Chain Mode (sequential, unlimited). Use when the user asks for photo sets, beauty shots, outfit photos, or套图.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Generate consistent photo sets using a model card for face-locking. Two modes — Grid Mode (4-photo grid) and Chain Mode (sequential, unlimited). Use when the user asks for photo sets, beauty shots, outfit photos, or套图.
version
0.8.0
license
MIT
compatibility
Requires GEMINI_API_KEY, internet access, Python packages google-genai and Pillow.
platforms
["macos","linux","windows"]
required_environment_variables
[{"name":"GEMINI_API_KEY","prompt":"Gemini API key for image generation","help":"https://aistudio.google.com/app/apikey","required_for":"all image generation and upscaling operations"}]
Generate a set of 4 consistent photos from a single model card (face reference),
with customizable outfits, environments, and accessories.
CRITICAL RULES
[!IMPORTANT]
ALL steps MUST be executed through generate_suite.py script. Do NOT write your own code to call Gemini API, crop images, or upscale. The script handles directory structure, logging, and file management.
Script location: Find it at the skill scripts directory (find via skill_view) or ~/.hermes/skills/consistent-portrait-set/scripts/generate_suite.py
Send images via MEDIA: prefix only. Never use browser_navigate or any other method to show images.
Three approval gates: creative brief (Step 1), prompt (Step 4), and grid image (Step 6). Do NOT skip any.
All intermediate and output files are managed by the script. Do not save files to /tmp or any other location manually.
Don't patch skill files yourself. If you find a bug or missing feature in this skill, tell the user and suggest running hermes skills update consistent-portrait-set. The skill is maintained upstream — local edits will be overwritten on the next update.
When to Use
the user asks for 套图, photo sets, beauty shots, outfit photos, selfie sets
Any request involving multiple consistent images of the same person
Workflow
Step 1: Creative Brief
Before anything else, understand what the user wants and produce a creative brief.
Two modes — choose based on the user's input:
Mode A: the user gives a vague request (e.g. "给我出一套图", "来点新的")
→ You take the initiative. Use web_search to check current trending topics, seasonal themes, fashion trends. Draft a complete creative brief and present it for approval.
Mode B: the user gives a specific direction (e.g. "我想要一套职业装的", "穿红裙子在海边")
→ You ask clarifying questions to fill in the gaps, then confirm the brief.
STOP and WAIT for the user to approve, modify, or reject the brief.
Step 2: Gather Inputs
Required:
Model card image (face reference) — ask the user which image to use as the model card. Check the assets directory for available references, or ask the user to send one.
Text description from the user (outfit, scene, mood, etc.) — may already be covered in the approved brief
Optional (ask the user if he wants to provide):
Environment/scene reference photo
Outfit/clothing reference photo
Shoes/accessories reference photo
Step 3: Compose Prompt
Build a detailed English prompt for Gemini image generation. The prompt MUST include:
Grid format: "A strictly equal 2x2 grid, 4 cells of exactly the same size, no overlapping, no irregular layout"
Person description: Based on model card — describe the face, hair, body type consistently
Outfit: From the user's description or reference photo
Environment/scene: From the user's description or reference photo
Pose variety: Each quadrant should have a different pose/angle
Lighting and mood: Specify lighting style (natural, studio, golden hour, etc.)
Quality markers: "high resolution, professional photography, detailed textures"
Prompt template:
A strictly equal 2x2 grid of 4 portrait photos of [person description]. The grid must have exactly 4 cells of equal size, arranged in 2 rows and 2 columns, with no overlapping or irregular layout. Each cell contains one full portrait photo.
Top-left: [pose/angle 1], [outfit detail], [scene detail]
Top-right: [pose/angle 2], [outfit detail], [scene detail]
Bottom-left: [pose/angle 3], [outfit detail], [scene detail]
Bottom-right: [pose/angle 4], [outfit detail], [scene detail]
Style: [lighting], [mood], professional photography, high resolution, sharp details.
Step 4: Submit Prompt for Approval
[!IMPORTANT]
You MUST show the complete prompt to the user BEFORE generating. Do NOT call the API without the user's approval.
Send the composed prompt to the user in a clear format:
我准备用以下 prompt 生成四宫格,你看看:
[你组装的完整英文 prompt]
参考图:
- 模特卡:[路径]
- 环境:[路径 or 无]
- 服装:[路径 or 无]
- 饰物:[路径 or 无]
分辨率:4K / AR:9:16
可以吗?
STOP and WAIT for the user to approve, modify, or reject.
Step 5: Generate Grid
MUST use the script. Do NOT call Gemini API directly.
Default resolution is 4K. The script will output the grid to tmp/<session-id>/grid.png.
from hermes_tools import terminal
SCRIPT = "the skill scripts directory (find via skill_view)"
result = terminal(
f'python {SCRIPT} ''--step generate ''--model-card /path/to/model-card.jpg ''--prompt "your composed prompt here" ''--session-id 20260426_120000'# Optional reference images — include only if the user provided them:# ' --env-ref /path/to/env-ref.jpg'# ' --outfit-ref /path/to/outfit-ref.jpg'# ' --accessory-ref /path/to/acc-ref.jpg'# Optional resolution override (default 4K):# ' --resolution 2K'
)
print(result["output"])
Step 6: Send Grid for Approval
[!IMPORTANT]
This step is MANDATORY. You MUST send the grid to the user IMMEDIATELY after generation. Do NOT skip this step. Do NOT proceed to crop or any other step without the user's explicit approval.
Send the grid image to the user using MEDIA: prefix (this is Hermes's native way to send files in Telegram — just include the path with MEDIA: prefix in your response text):
MEDIA:<path from script output>/grid.png
Ask: "这组四宫格你满意吗?满意我就裁切出图了。"
STOP and WAIT for the user to approve before proceeding.
If the user says no:
Ask what to change
Adjust prompt and regenerate (go back to Step 4, use same session-id)
An alternative to Grid Mode. Generates images one at a time, each with its own approval. No limit on number of images. Best for higher consistency and fine control.
How to choose
Grid Mode: the user wants a quick set of 4, consistency is acceptable
Chain Mode: the user wants maximum control, each image reviewed, or more/fewer than 4 images
Let the user choose, or suggest based on context.
Chain Mode Workflow
Step 1–2: Same as Grid Mode (Creative Brief + Gather Inputs)
Step 3: Generate Image 1
from hermes_tools import terminal
SCRIPT = "the skill scripts directory (find via skill_view)"
result = terminal(
f'python {SCRIPT} ''--step chain ''--model-card /path/to/model-card.jpg ''--prompt "your prompt for image 1" ''--session-id spring_casual_001'# Optional: --resolution 4K (default 2K for chain mode)
)
print(result["output"])
Send to the user: MEDIA:<session-dir>/chain-1.png
Ask: "第 1 张你满意吗?继续下一张?"
STOP and WAIT for approval.
Step 4+: Generate subsequent images
the agent decides which reference images to pass based on content:
Want to lock face? → pick a chain image with clear face
Want to lock outfit? → pick a full-body chain image
Want to lock scene? → pick one with the right background
result = terminal(
f'python {SCRIPT} ''--step chain ''--model-card /path/to/model-card.jpg ''--ref-images "<session-dir>/chain-1.png,<session-dir>/chain-3.png" ''--prompt "your prompt for next image" ''--session-id spring_casual_001'
)
print(result["output"])
Choose references based on what you want to preserve:
Goal
Which image to pick as reference
Lock face
One with clear, front-facing portrait
Lock outfit
One with full-body shot showing complete outfit
Lock scene
One with the desired background/environment
Lock pose style
One with similar body language
Maximum diversity
Only pass model card, no chain images
[!IMPORTANT]
Do NOT mechanically pass "the previous image". Choose references intentionally based on what needs to stay consistent. If a chain image is a close-up, it has no outfit info — don't use it to lock outfit.
Directory Structure
All files are managed by the script under the workspace directory (auto-created by script):
Face consistency is approximate. Gemini's face-locking is not pixel-perfect. Minor variations across images are expected — set user expectations accordingly.
Grid layout can be uneven. Gemini occasionally produces unequal cells despite explicit prompting. Regenerate if too uneven — results vary between calls.
Hand/finger artifacts. Inspect hands at the grid approval step. Regenerate if finger count or pose is wrong.
Large reference payloads may fail. Too many high-res reference images can hit Gemini API limits. Reduce references or lower resolution if the API errors.
Session ID collisions. Ensure each session-id is unique when generating multiple sets in a day.
Gemini safety filter silent blocks. If you get TypeError: 'NoneType' object is not iterable on response.candidates[0].content.parts, the prompt was silently blocked by Gemini's content moderation. See the rewriting table below.
Prompt Rewriting for Safety Filters
When the user asks for revealing or sexy outfits (大尺度, 性感, lingerie), Gemini's safety filters will block explicit descriptions. Rewrite using euphemistic/artistic vocabulary:
Blocked (too direct)
Allowed (euphemistic)
lingerie / bodysuit
figure-hugging mini dress, satin slip dress
deep plunging neckline
flattering low neckline
sheer / transparent / see-through
translucent
cleavage
low neckline, revealing neckline
barely covering
short hemline, mini length
skimpy
form-fitting, body-hugging
naked / topless
bare shoulders, off-shoulder
lace lingerie set
black satin robe loosely draped
straps falling off
robe hanging loosely off one shoulder
Principles:
Describe fabric and silhouette rather than what skin is exposed — "figure-hugging black satin dress" works, "black lace lingerie" does not
Use atmosphere/draping to imply rather than state — "a black robe draped loosely over one shoulder" instead of "naked shoulder showing"
Focus on lighting and mood — "warm sensual lighting, seductive atmosphere" doesn't trigger filters
Keep the prompt narrative and artistic — frame it as fashion editorial photography
Test first: Before investing in a complex prompt, run a quick test with a short version to confirm it passes the filter
Verification
After grid generation: Confirm tmp/<session-id>/grid.png exists before sending to user.
After cropping: Verify 4 crop files exist with reasonable dimensions (~half grid width × half height).
After finalize/chain-finalize: Confirm final images exist in outputs/YYYY-MM-DD/<session-id>/.
After upscale: Check upscaled dimensions match expected resolution.
Important Notes
All images are 9:16 portrait aspect ratio by default
Grid Mode: default 4K, cropped images ~2K
Chain Mode: default 2K, single images, no crop needed
Upscale is OPTIONAL — only when the user explicitly requests higher quality
Never bypass the script — it manages all file paths, logging, and directory structure
Never use browser to display images — always use MEDIA: prefix
Parallelizing upscale calls is your decision based on the situation