Identity Swap on Expression Grid (4x4)

A complex JSON prompt for image-to-image generation, specifically designed to perform an identity swap. It uses a reference identity to replace the person in an existing 4x4 expression grid image, strictly preserving the original grid layout, poses, expressions, and background, while ensuring realistic anatomy and high-quality rendering.

Identity Swap on Expression Grid (4x4)

Prompt

{ "generation_request": { "meta_data": { "task_type": "identity_swap_into_existing_expression_grid", "language": "en", "priority": "highest", "version": "v1.0_KEEP_GRID_SWAP_IDENTITY_4X4" }, "input": { "mode": "image_to_image", "reference_image_usage": "very_high", "preserve_identity": true, "preserve_facial_features": true, "preserve_hairstyle": true, "notes": "PRIMARY STRUCTURE ANCHOR: use the uploaded 4x4 expression grid image. Keep the exact grid layout, crop, panel framing, pose variety, hand positions, and background. PRIMARY IDENTITY ANCHOR: use the uploaded reference portrait of the target person. Replace the person in every panel with the reference identity while keeping each panel's expression and gesture. Maintain natural skin texture, realistic anatomy, correct hands." }, "output": { "aspect_ratio": "2:3", "resolution": "ultra_high", "num_images": 1, "sharpness": "crisp", "grain": "subtle_analog" }, "style": { "keep_original": true, "background": "keep exactly the same as the grid image", "lighting": "match the grid image lighting", "color": "keep original (or convert to pure black and white if requested)", "finish": "clean, realistic, no plastic skin" }, "quality_control": { "identity_lock": "strict", "hands_priority": "very_high", "avoid": [ "extra fingers", "missing fingers", "deformed hands", "warped face", "uneven eyes", "melted mouth", "text", "watermark", "logo" ] }, "negative_prompt": [ "low resolution", "blur", "distorted anatomy", "face mismatch", "plastic skin", "over-smoothing" ] } }

Runs on 18 models

  • Flux
  • Flux 2
  • Flux Kontext
  • GPT-4o Image
  • GPT Image
  • GPT Image 2
  • GPT Image 2.5
  • Grok Imagine
  • Ideogram V3
  • Imagen 4
  • Midjourney
  • Nano Banana
  • +6 more

What this prompt produces

Realistic Group Selfie with Smartphone Flash Effect Not specified nano-banana-pro
Four Seasons Portrait Collage Not specified nano-banana-pro
Minimalist Dog Sketch Clipart Not specified nano-banana-pro
Mecha Girl figure concept generated by Nano Banana Pro Not specified nano-banana-pro
Candid Flash Photography: Chaotic Holiday Party (Duplicate) Not specified nano-banana-pro
Ethereal Floral Studio Portrait Not specified nano-banana-pro

Run this prompt with the API

The request below sends this prompt, with its default values filled in, to the first model it runs on. Swap the model name for any other model listed above.

Prompt API docs
/api/v1/nano_banana/text_to_image
curl -X POST https://runapi.ai/api/v1/nano_banana/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "nano-banana-pro",
  "prompt": "{\n  \"generation_request\": {\n    \"meta_data\": {\n      \"task_type\": \"identity_swap_into_existing_expression_grid\",\n      \"language\": \"en\",\n      \"priority\": \"highest\",\n      \"version\": \"v1.0_KEEP_GRID_SWAP_IDENTITY_4X4\"\n    },\n    \"input\": {\n      \"mode\": \"image_to_image\",\n      \"reference_image_usage\": \"very_high\",\n      \"preserve_identity\": true,\n      \"preserve_facial_features\": true,\n      \"preserve_hairstyle\": true,\n      \"notes\": \"PRIMARY STRUCTURE ANCHOR: use the uploaded 4x4 expression grid image. Keep the exact grid layout, crop, panel framing, pose variety, hand positions, and background. PRIMARY IDENTITY ANCHOR: use the uploaded reference portrait of the target person. Replace the person in every panel with the reference identity while keeping each panel's expression and gesture. Maintain natural skin texture, realistic anatomy, correct hands.\"\n    },\n    \"output\": {\n      \"aspect_ratio\": \"2:3\",\n      \"resolution\": \"ultra_high\",\n      \"num_images\": 1,\n      \"sharpness\": \"crisp\",\n      \"grain\": \"subtle_analog\"\n    },\n    \"style\": {\n      \"keep_original\": true,\n      \"background\": \"keep exactly the same as the grid image\",\n      \"lighting\": \"match the grid image lighting\",\n      \"color\": \"keep original (or convert to pure black and white if requested)\",\n      \"finish\": \"clean, realistic, no plastic skin\"\n    },\n    \"quality_control\": {\n      \"identity_lock\": \"strict\",\n      \"hands_priority\": \"very_high\",\n      \"avoid\": [\n        \"extra fingers\",\n        \"missing fingers\",\n        \"deformed hands\",\n        \"warped face\",\n        \"uneven eyes\",\n        \"melted mouth\",\n        \"text\",\n        \"watermark\",\n        \"logo\"\n      ]\n    },\n    \"negative_prompt\": [\n      \"low resolution\",\n      \"blur\",\n      \"distorted anatomy\",\n      \"face mismatch\",\n      \"plastic skin\",\n      \"over-smoothing\"\n    ]\n  }\n}"
}
JSON

Try a prompt

Estimated: $0.04 / image

Sign in to generate with RunAPI.

Sign in to generate

Sign in to start generating with your available language models.