Person Swap Photo · skill publik Open Skill
Person Swap Photo
Person Swap Photo adalah Open Skill publik di Digen. Buka untuk melihat apa yang dibuat alur ini.
TryOn
2 0 0
https://d7qlwi7tl2u27.cloudfront.net/skill-covers/prod/4284865/2026-10-22/7p9bk8xf.jpg
# Person Swap Photo
Replace any person in a photo with the person from another photo, and return a finished image. The whole pipeline is image-to-image: one photo supplies the identity (a solo portrait), one photo supplies the scene, pose, framing and the other people, and free text tells us which person in the scene must be replaced and how the swap should behave.
There is no structured project state. Keep the two image roles and the user's settings in the conversation, and reference canvas assets by the asset ids / URLs already present in the conversation.
## When to use
- The user uploads a solo portrait (or character sheet) plus a second photo containing one or more people, and asks to swap / replace / insert that person into it.
- The user asks for expression mimicry ("make her smile like the girl in the photo"), clothing consistency ("keep her own outfit"), or body consistency in a swapped result.
- The user wants the same character placed into several photos in one turn (repeat the swap per target photo).
- Not for: pure text-to-image without any reference person, background removal, or full video production. If only a text prompt is given and no reference person, ask for the reference portrait or fall back to a plain text-to-image request.
## Inputs and outputs
| Input | Role | How it is used |
|---|---|---|
| Reference portrait (`input_urls[0]`) | Identity source | Supplies face geometry, features, skin tone, hair. Never the scene. |
| Target photo (`input_urls[1]`) | Scene + pose + other people | Supplies framing, camera angle, background, pose and everyone else who must stay untouched. |
| Text instruction | Placement + settings | Says which person in the target photo to replace (by look, position or clothing) and switches expression copy / clothing consistency. |
Output: one new image per target photo, on canvas, with a short readable `name`.
## Steps
1. **Separate the two image roles.** Identify which upload is the solo identity portrait and which is the target scene. If a single upload contains both (e.g. a collage or a grid of people), call `recognize_image` to split it into regions and tell the user which region you are using as the identity source.
2. **Read the reference files before composing anything.** Call `read_skill_file` for `references/style-and-prompt.md` (visual style, subject rules, layout, must-keep/must-avoid, prompt fragments) and `references/step-details.md` (sub-steps, branches, checks, retry rules). Read `references/prompt-templates.md` when you need the copy-ready prompt skeletons.
3. **Locate the person to replace.** If the target photo has more than one person, resolve which one is meant from the user's text ("the girl on the left", "the one in the blue dress", "the redhead"). If the text is ambiguous, either call `recognize_image` on the target photo to describe positions/outfits, or ask exactly one clarifying question. Never guess silently when there are 3+ people.
4. **Confirm the two behaviour switches** (only if the user did not state them):
- *Expression copy* — default ON (the swapped person copies the target person's expression). If the user wants to keep the source person's original expression, switch it OFF.
- *Clothing / body consistency* — default ON: the source character keeps her own outfit and body type inside the new scene. Switch OFF when the user wants the target photo's clothing and pose to win.
Do not block on confirmation when the defaults are obviously fine; state the assumption in one sentence and continue.
5. **Optionally plan the turn.** If the user asked for several target photos, call `write_todos` with one item per target photo and keep exactly one item `in_progress`.
6. **Compose the English prompt.** Using `references/style-and-prompt.md` and `references/prompt-templates.md`, fill every slot: identity anchor (from the portrait), target position and pose (from the scene photo), outfit decision, expression decision, scene/lighting descript