Community图像github.com

huangbin97/make-couple-photo-diptych

根据两张照片生成“为你拍照”上下拼贴:图2仅裁切和等比缩放为横图,只将图1人物生成在图2场景中为对方拍照的第三视角。用于为你拍照、拍摄者与被拍摄者、情侣摄影上下拼图等请求。

make-couple-photo-diptych 是什么?

make-couple-photo-diptych is a Claude Code agent skill that 根据两张照片生成“为你拍照”上下拼贴:图2仅裁切和等比缩放为横图,只将图1人物生成在图2场景中为对方拍照的第三视角。用于为你拍照、拍摄者与被拍摄者、情侣摄影上下拼图等请求。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/huangbin97/for-you-photo-skill/tree/HEAD

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Take a Photo of You

Core Deliverable

Deliver two equal-width, equal-height landscape photos stacked directly vertically, defaulting to 3:2 each and an overall portrait 3:4 aspect ratio. The top image is a newly generated reverse-angle shot of the photographer; the bottom image uses the original second photo appropriately cropped. The bottom image retains the original people and scene content, allowing cropping, proportional scaling, and slight global color correction after compositing; no regeneration, face swapping, or beautification is permitted. Do not regenerate both images together as a diptych.

Capabilities and Cross-Tool Execution

This skill is not tied to a specific model, service provider, or tool name. Full execution requires viewing reference images, using two images for guided generation/editing, and running Python 3.10+ with Pillow for compositing. Use the host's authorized tools; no API keys need to be provided in the chat. With text-only capability, provide reference prompts and clarify that external generation and compositing are required; do not claim completion.

The generation tool is only responsible for the top image. First run python3 -m pip install -r requirements.txt (skip if dependencies are already present); use scripts/compose.py for compositing. First inspect the original image to select a crop box, with coordinates based on the EXIF-orientation-normalized image. Example command: python3 scripts/compose.py --upper inputs/upper.png --lower inputs/person-b.jpg --lower-crop 0,300,1440,1260 --width 1200 --panel-height 800 --output outputs/diptych.png. The example crop box does not apply to arbitrary photos; it must be adjusted according to the actual subject.

If tone calibration of the top image is needed, provide an observed --upper-curves curves.json file with monotonic [input, output] node lists for r/g/b channels, with endpoints at 0 and 255. The script does not analyze semantics, automatically detect hands/eyes/skin quality, or find optimal filters; each time inspect the top image and final output. Global parameters default to 1.0; do not force color changes for the sake of post-processing. The composited image before global adjustment and the processing parameters are saved to a companion file with the same name.

1. Confirm Image Roles

  • Define the first image as Person A (the photographer) for identity reference, and the second image as Person B(the original photo and scene reference). If not labeled, map by upload order, explain in one sentence, and proceed; user specification takes priority.
  • If an image is missing, only request the missing one; do not select historical personal photos from chat history, and do not substitute with strangers.
  • First inspect both images. If multiple people are present and ambiguous, ask about the person. Examples are for composition reference only, not as identity sources.

2. Only Generate the Top Image

First read references/prompt-template.md. Pass both images to the image tool, explicitly specifying that the first image is solely for Person A's identity reference and the second for environment and photography style reference, requesting one top image.

  • By default, the top image includes only Person A, a chest-to-waist framing, holding a retro portable camera to photograph Person B off-screen. Observe Person A from an external reverse angle near Person B; not a viewfinder first-person perspective. The camera-holding motion and head angle should naturally coordinate, and the fingers and camera structure should be reasonable.
  • Natural camera holding and occlusion take priority: Based on the camera type, shooting direction, head rotation, and body posture, naturally select the dominant eye, holding height, and occlusion area. Do not fix occlusion to the left or right face or mandate showing a specific eye; allow half-face, most-of-face, or full-face occlusion. Do not awkwardly tilt the camera to the side to show facial features, or have the eye look through the camera body at the lens.
  • When using a viewfinder, align the used eye with the real viewfinder position reasonably; if the camera has a screen and screen-based composition is used, naturally lower the camera slightly and have the gaze fall on the screen. Fingers naturally grip the body, index finger near the shutter, the other hand providing reasonable support; the shoulder, elbow, wrist, and camera orientation must be coherent, not mechanically posed.
  • Eyes and pupils consistent with real viewfinder use: The visible iris, pupil, sclera, and eyelid relationship must be natural; the pupil within the iris, with size, shape, and position consistent with the eye's direction and current lighting; when both eyes are visible, their gaze should be coordinated, allowing normal perspective differences, not requiring mirror symmetry. Avoid duplicate/double pupils, black dots off the iris, malformed irises, abnormal size, unfounded strabismus, and inconsistent highlights. Do not mistake flash reflections as extra pupils, nor copy imaging artifacts from the reference image.
  • The used eye aligns with the real viewfinder of the camera; the gaze is for composition, not required to look at the external viewer. The other eye can be naturally open or slightly closed; parts occluded by the body, hand, or head angle remain occluded; do not depict an eye that would be hidden behind the camera via perspective, and do not fix occlusion to the full face to avoid anomalies.
  • Facial occlusion is determined by the real shooting action; do not force a recognizable frontal face. Retain identity features of all exposed parts; when the full face is occluded, maintain character continuity through hairstyle, head silhouette, skin tone, and body posture; do not fabricate visible facial features.
  • Relaxed shoulders and neck when holding the camera: Shoulders naturally lowered, neck maintaining its original length and space; head only slightly turned or tilted forward; do not retract the neck, hunch the shoulders, or press the chin into the collar. Achieve the framing by raising the forearm and adjusting the camera height, not by lifting the shoulder to bring the camera closer; elbows naturally hanging or moderately extended outward, wrists not tense. Do not exaggerate neck length or pose in a rigid military stance.
  • Only when the user explicitly requires both people in the same frame does the top image change to a medium-distance third-person perspective from slightly behind, with Person A photographing Person B, both in frame.
  • First determine the shooting geometry: Based on the second image's eye level, tilt, visible face of the person, head/torso orientation, gaze, and perspective, infer the camera position and distance. Distinguish between "person turned sideways but looking back at the camera" and "truly side-profile shooting"; do not directly equate body direction with camera direction. The top image's observation point is near Person B; Person A's camera faces the off-screen location of Person B; Person A's framing gaze, lens axis, body, arms, and body direction should be coherent; shooting distance and camera height should be able to produce the second image's framing and tilt. For unknown focal length or position, make reasonable estimates; do not claim precise reconstruction based on a single photo.
  • Do not default all top images to frontal, level view: when the second image is clearly high-angle or low-angle, adjust Person A's camera height and tilt proportionally; when Person B looks off-screen, Person A does not need to force Person B to make eye contact with the viewing lens. If the observation point of the two images is close to the lens axis, the top image's lens can be close to facing the viewer; if there is a lateral offset, corresponding perspective should be produced; the camera cannot be aimed to the side while claiming to photograph Person B. Combined with the reverse angle, check terrain, background, light source, and shadows; the background does not need to be identical, and the sun should not appear simultaneously in opposite directions without basis.
  • From the second image, deduce location, time, weather, light, tone, grain, and focal length feel; do not default to adding sea, boats, or sunset. The reverse-angle background should conform to spatial relationships; unknown off-screen areas should be restrainedly completed.
  • Use the second image as the sole filter and imaging benchmark: Before generation, analyze the second image's white balance/warmth and color cast, exposure, light/dark relationship, black level, contrast, saturation, highlight transition, shadow detail, skin tone handling, grain, and flash characteristics; embed these in the generation prompt. The first image is only for identity reference; do not inherit its indoor lighting, filter, or exposure.
  • The top and bottom must look like two photos taken at the same location, at the same moment, with the same camera and the same filter. Match sky gradient, vegetation/ground hue, shadow density, and fabric color; do not automatically brighten, warm, or add a cinematic filter to the top image. If the second image is a dark backlit scene, the top image should also retain reasonable dark areas; do not separately fill light to see the face; only match the flash effect when the second image shows such an effect.
  • Derive light source direction based on the relative positions of the two people; allow reasonable light/dark and background changes due to the reverse angle; do not fake consistency by copying the same background or forcing both faces to be equally bright. Aim for the same photographic language, not mechanically identical histograms.
  • Judge sharpness at real viewing scale: The top image should have normal focus and natural detail falloff typical of casual photography with an ordinary camera; compare the size of similar faces in the final composite to the bottom image, not aiming for "every detail sharp when magnified." Retain the lens's inherent soft transition and limited resolving power; do not enhance sharpness, texture, local contrast, or sharpening; do not emphasize pores, hair strands, fabric fibers, or camera engravings. Prohibit ultra-clear commercial quality, HDR, edge halos, and excessively clean-cut outlines.
  • Skin retains real, un-beautified texture: Exposed face and hands should have subtle color variations, minor imperfections, natural texture, and uneven reflections consistent with the original photo and current lighting; retain identity details like existing moles. Do not smooth skin, remove blemishes, whiten, add waxy smoothness, make skin porcelain-like, or apply heavy noise reduction; similarly, do not artificially create large pores, wrinkles, or exaggerated spots for "realism." Natural texture should only be faintly present at normal viewing distance; do not rely on sharpening to reveal it.
  • Inspect sharpness and skin smoothing separately: soft lens rendering does not equal smooth skin; retain skin tone and texture variation while avoiding hard, sharp details. Do not use full-image blur, soft focus, motion blur, added noise, or darkening to reduce the generated feel, nor copy the second image's blur to match defocus.
  • When matching direct flash, preserve natural light/dark variation and reflections on the lit areas; avoid raising the entire face and hands to an evenly bright, smooth color block; do not copy skin detail loss from overexposure in the second image. No extra sharpness processing by default; the skin alone allows the following subtle, localized touch-ups on the top image only. Tone unification still follows the established workflow; do not use smoothing or sharpening to assist color calibration.
  • Hair remains natural and restrained in wind: Based on the first image's original hairstyle, length, volume, and flow; do not change the main silhouette to show wind. Short hair defaults to mostly conforming to the head shape, with only a few forehead or temple strands slightly moving; no floating hair needed in scenes without obvious wind. Long hair can bend with the wind, but should have gravity, natural clustering, and variations in density.
  • Determine reasonable wind direction and strength from the second image's environment; convert direction based on the relative positions of the people; do not mechanically copy left/right direction on screen, nor apply the wind amplitude of long hair from the second image to short hair. Avoid radial frizz, uniform spikes, isolated wire-like long strands, floating hair clumps, or uniformly aligned strands. Hair roots should naturally connect; ends only slightly loosened; do not sharpen or depict every strand.
  • Prioritize a real, candid look for the top image: Reduce retouching, perfect symmetry, and deliberate posing. Maintain natural weight distribution, slight asymmetrical shoulder lines, and relaxed arms; do not add "film look" decorations, exaggerated blur, or dramatic light effects. Do not mask generation defects with blur, noise, or overall darkening.
  • Light and shadows follow the same physical relationship: From the second image, infer the main light, ambient reflection, and occlusion; change reasonably based on the reverse-angle positions. The face, hands, camera, and clothing should share consistent light direction, color temperature, and ratio; the camera and hands' projections onto the face, the shadows of fingers on the body, and contact shadows should be natural and reasonably intense. Avoid baseless fill light, uniformly shiny skin, rim light halos, dirty gray shadows, or incompatible multiple shadows; do not automatically fill light for backlit scenes, and do not render direct flash as studio soft light.
  • Hands and camera must have believable contact: The size, skin tone, and lighting of both hands should match the person; joint bends consistent with gripping; fingers have natural overlap and slight pressure. The gripping hand's index finger naturally near the shutter, thumb in a reasonable position on the camera back; the other hand supporting the bottom of the body or lens; avoid palm hovering, fingertip penetration, fused fingers, duplicate fingers, rubbery hands, stiff evenly spaced fingers, and both hands stacked directly in front of the lens. When reasonably occluded, not all ten fingers need to be visible; do not create odd poses just to show fingers.
  • Subtle lines may be locally retouched: If the top image shows slight forehead or nasolabial folds, they may be moderately softened or have thin lines and heavy shadow in those areas removed, especially to avoid generation processes that unduly deepen lines; aim for natural, flattering results that still look like the person. First distinguish fine lines from expression wrinkles, normal nose-wing/mouth-area structures, and cast shadows; retain natural expression, age appearance, and facial volume; do not smooth out the nasolabial area or change the shape of the nose/mouth. Do not aim for complete absence of lines from all angles; after retouching, still retain subtle skin tone variation, natural texture, identity moles, and normal reflections. This local retouching is a limited exception to the "no smoothing" rule; it does not extend to full-face smoothing, whitening, removal of all imperfections, or age alteration; it applies only to the top image.
  • Facial contours may be very slightly refined: While retaining Person A's recognizability, original face shape, jaw width, cheekbones, facial proportions, and age appearance, only slightly smooth out unnatural transitions and generated bumps from the cheeks to the jaw, creating a naturally continuous contour. Prioritize using reasonable head angles and lighting to achieve a smooth look; do not obviously slim the face, shave the jaw, sharpen the chin, enlarge the eyes, change the nose/mouth, or force symmetry; do not give everyone the same face shape. Do not replace minor refinement with smoothing, removal of identity moles, blurred contours, or flattening of facial volume; skin and hands still retain real texture. Applies only to the top image; do not beautify the second image.
  • Retain Person A's face shape, features, hairstyle, skin tone, and age appearance. Remove items that do not match the shooting action, such as phones.
  • When matching outfits is needed, only adjust Person A's clothing to echo the color, material, or details of Person B in the second image; never modify Person B's clothing for matching.
  • Do not change Person B's expression, pose, clothes, hair, or background content within the retained area; only allow cropping for landscape format. Do not request regeneration of a "more attractive" Person B.

3. Original Image Compositing

After generating the top image, use a deterministic image tool (e.g., Pillow) only for layout compositing; this task explicitly allows compositing with code, not using code to regenerate people.

  • First normalize the EXIF display orientation of the second image, then select a perceptually landscape crop box. Default to 3:2 per panel; user-specified aspect ratios take priority. Retain the complete head, face, key posture, and necessary environmental context; prioritize cropping excessive sky or irrelevant foreground; do not mechanically center the crop.
  • The crop must not cut off the top of the head, chin, or key photographic action. If the default aspect ratio cannot reasonably contain the subject, appropriately adjust the common landscape aspect ratio of both panels; do not extend the second image by generative outpainting. Only ask for trade-offs when the user explicitly requires a fixed ratio and the subject cannot be reasonably contained.
  • Crop and proportionally scale both panels to the same width W × H (W > H); no stretching. Seamlessly stack vertically to W × 2H; e.g., two 1536 × 1024 panels composite to 1536 × 2048. Do not use the second image's portrait ratio to stack two portrait images.
  • Before compositing, the second image's processing is limited to EXIF orientation normalization, cropping, and necessary proportional scaling; reprocessing, beautification, and lossy re-encoding are prohibited; after compositing, the following minor global tonal adjustments are allowed. Save the final result as lossless PNG, with no text, borders, or watermarks.
  • Record the second image's crop box and target dimensions; keep the processed second image as a verification reference. When cropping/scaling is allowed, do not claim pixel-perfect identity with the full original image.

Substantively Calibrate the Top Image's Tone Before Compositing (Must Be Done)

  • Using the actual cropped area of the second image as the sole target, first identify the specific deviations of the top image, then adjust. Compare at least two comparable materials/environments: sky (avoiding sun and highlights), sea/ground, same-color clothing, or neutral objects. Observe brightness, warmth/coolness and green/magenta color cast, saturation, black level, and highlight transitions separately. Do not just judge "both are blue/warm."
  • It is permissible to record RGB or Lab medians, brightness quantiles of representative inspected areas to assist judgment; samples should avoid people, spray, sun, reflections, occlusion, and overexposure. If there are no comparable areas between different perspectives, skip numerical matching and rely on visual judgment; do not force-match different materials, differently lit areas, or whole-image averages.
  • Calibrate only the top image for the identified deviations: first correct white balance/green-magenta color cast, then match midtone exposure, black level/contrast and highlights, and finally adjust the hue/saturation of specific colors. Use evidence-based channel gains, curves, or selective color transforms; retain skin tone and physical lighting. Do not mechanically apply a fixed .94/.97 saturation/brightness parameter every time, or simply reduce saturation and claim unification. Must record actual deviations and the processing parameters used.
  • Non-generative color calibration is preferred, retaining identity, hands, and composition. Only when wrong light sources or local lighting cannot be reasonably fixed through calibration, use image editing tools to directionally correct the top image, with the second image as reference. Do not rely on reprocessing the second image, applying a strong common filter over both, or matching full-image histograms to eliminate differences.
  • Generate a temporary composite; view both panels and their seam at the same display scale. Focus on checking for obvious differences like "top gray bottom blue, top purple bottom cyan, top orange-brown bottom gray-yellow, top bright bottom dark." If it still looks like two different filters, return to calibrate the top image and re-inspect; do not proceed to delivery until passed. Allow local brightness differences due to real reverse angles; do not force the sky/horizon position to match.

4. Post-Composite Global Adjustments

  • After compositing is complete and obvious color cast of the top image is corrected, apply one slight, non-generative global tonal adjustment to the entire composite. Using the second image's original style as a baseline, fine-tune to unify white balance, color cast, exposure, contrast, saturation, and highlight/shadow transitions; can use deterministic tools like Pillow, not generative reprocessing of the whole composite.
  • Use the same restrained set of tonal parameters for both panels; retain the original scene's light feel, skin tone, and reasonable reverse-angle brightness differences. Prohibit strong filters, HDR, localized beautification, sharpening, or blurring; do not force the addition of grain. If already harmonious, keep parameters close to neutral; do not significantly change the image just to show "something was done."
  • This step allows slight color changes to the second image, but must not alter the person's facial features, expression, pose, clothing, or scene content. Keep the pre-tonal composite and parameters for internal verification; the final delivered image is the color-graded composite; no longer claim that the second image's final pixels or colors are completely unchanged from the original.
  • After completion, review the overall warmth/coolness, black level, highlights, and filter feel of the top and bottom for coherence; check for color cast, overexposure, or unnatural skin tones; reduce the global adjustment if necessary. Save the final result as lossless PNG.

5. Inspection and Delivery

  • Inspect the newly generated top image and final composite: Person A is correct, the photo-taking action is reasonable, the scene corresponds to the second image, and the top-bottom order is correct.
  • Before global tonal adjustment, programmatically compare the bottom half of the composite with the second image as cropped and scaled according to the record: sizes and pixels must be identical. If this fails, correct the compositing; never regenerate an image to replace the second image.
  • Inspect the top image at both the final display scale and a moderate zoom: identity, photo-taking action, and camera structure must be discernible; no requirement for every hair and skin detail to be sharp. If excessive sharpening, detail overstuffing, plastic skin, smooth color blocks, or heavy noise reduction appear, use image editing tools to correct only the top image's rendering and skin texture, retaining identity, minor imperfections, action, light/shadow, and matched tone; then re-composite; do not mask with blur or noise. Only correct focus when obvious blur makes action or structure hard to discern; do not repeatedly increase sharpness due to natural detail falloff. Do not sharpen, smooth, or reprocess the second image.
  • Eye verification: At both the final display scale and a moderate zoom, inspect all visible eyes for natural iris/pupil count, boundaries, position, size, eyelid occlusion, gaze of both eyes, and reflections. If reasonably occluded or closed, no need to fill in the eyeball; natural reflections, perspective differences, and slight asymmetry are not considered anomalies. If duplicate pupils, obvious misalignment/distortion, or contradictory gaze are found, use image editing tools to correct only the top image's eyes, using the first image as identity reference; retain face shape, natural eye shape, camera occlusion, posture, skin texture, and matched tone; re-inspect before compositing. Do not fix by sharpening, blurring, enlarging eyes, forcing the eye to be visible, or reprocessing the second image.
  • Check fine line retouching: if the top image's forehead/nasolabial folds appear unduly deepened, they may be locally softened; after retouching, check that forehead/eyebrow expressions and nose-wing-to-mouth structure and lighting still look natural, with no waxy feel, smudged color blocks, or texture mutations. If retouching erases normal structures or significantly changes age, reduce the treatment; the second image does not undergo portrait retouching.
  • Check contour and identity: at normal viewing, contours should be slightly smoother while still looking like Person A, preserving natural left-right differences and facial volume; if the face is obviously changed, excessively thinned, or shows a smooth waxy finish, reduce the treatment and restore original features.
  • Shooting angle verification: Check the top and bottom images as a photographic pair; verify that Person A's lens actually points toward Person B, that camera height/tilt can reasonably produce the second image's viewpoint, that distance and framing are compatible, that Person B's face/body orientation is explainable, and check the reverse-angle background and light direction. Do not require Person B to look at the lens. If obvious contradictions are found, correct only the top image's camera position, camera angle, stance, or background; keep the second image's content, Person A's identity, natural neck/shoulders, and matched tone; then re-inspect.
  • Check the top image's neck and shoulders: neck relaxed, shoulder line relaxed, natural space between chin and collar; if the neck is retracted or shoulders hunched, directionally correct posture while maintaining hands, identity, and environment; do not mask with cropping.
  • Inspect at zoom the hands, camera, and face contact areas: joints/finger count, grip force, occlusion relationships, shadows, and skin texture must be reasonable; simultaneously view at a small scale to see if it looks like a natural candid shot. If obvious fake hands, baseless light, or contradictory shadows are found, use image editing tools to correct only the problematic region, retaining identity, correct posture, and tone; then re-composite and re-inspect; do not just deliver with global adjustments.
  • Check that hair maintains the original style and plausible gravity: if exaggerated frizz, spikes, floating strands, or disconnected roots appear, correct only the top image's hair, retaining identity, camera-holding posture, and lighting.
  • Examine the final composite as a whole: warmth/coolness, sky and environment colors, exposure and black level, contrast, saturation, and grain should be coherent between top and bottom; there should not be an obvious two-filter look. Check for reasonable lighting differences; do not mistake natural reverse-angle differences for errors.
  • If the top image is too bright, too warm/cool, or has significantly inconsistent saturation or texture, must return to calibrate the top image; prefer non-generative correction for simple color cast, use image editing tools for wrong light sources. Retain identity, action, and composition; then re-composite and re-check. Do not replace tone checking with "the scene is the same." First resolve the top image's obvious color cast, then apply a slight global unification; do not use strong filters to mask differences.
  • Save and present the final composite; may briefly state "only the top shooting perspective was generated; the bottom image retains original content; slight unified tonal adjustment after compositing." Do not deliver only a prompt, and do not claim that a fictional scene actually occurred.
  • If generation or compositing capabilities are missing, explicitly state the limitation; do not fabricate completed composite or content preservation results. Do not save user images into the skill directory.

相关技能