{"templateId":"api_docs","sharedDataIds":{"apiDocsStore":"api-docs-reference/ai_body_reshape.yaml","sidebar":"sidebar-reference/sidebars.yaml"},"props":{"definitionId":"reference/ai_body_reshape.yaml","settings":{"baseUrlPath":"/reference/ai_body_reshape"},"disableAutoScroll":true,"seo":{"title":"AI Body Reshape","description":"YouCam API documentation by Perfect Corp. Learn how to use Skin analysis API, Virtual try-on API, Image editing API, and Video generative AI APIs.","siteUrl":"https://docs.perfectcorp.com","keywords":"AI Skin Analysis, AI Clothes, AI Hairstyle, AI Outfits","image":"/assets/favicon.cd6fa4d833b2a573b3c6dae68386b293da205b203402cb0c97b80bd2acc07ea2.8351e24f.png"},"dynamicMarkdocComponents":[],"metadata":{"type":"openapi","title":"AI Body Reshape","version":"","description":"# Overview\nAI Body Reshape API for Body Reshape & Slimming\nFeel confident in photos with an AI body editor! Slim, reshape, and enhance your body for natural, stunning proportions. Effortlessly reshape any area — waist, arms, thighs, chest, and more. Get natural, stunning results in just a tap!\n\n\n## Integration Guide\nThis guide walks you through:\n\nWorkflow for AI Body Reshape API:\n\n**Endpoint:** `/s2s/v2.0/task/body-reshape`\n\n**Authentication Required:** `Authorization: Bearer YOUR_API_KEY`\n\n**Workflow Steps:**\n\n1. **Image Upload Preparation:**\n    - Prepare a selfie image for upload.\n    - Call the File API `/s2s/v2.0/file` to obtain the upload URL and associated `file_id`.\n    - Upload the selfie image using the provided upload URL.\n\n2. **Optional Preprocessing For Group Photos:**\n    - Preprocess the selfie image if there are more than one person in the image.\n\n3. **Body Reshape Effect Setup:**\n    - Begin by selecting suitable body reshape parameters.\n\n4. **Initiate AI Task and Obtain Task ID:**\n    - Send the `file_id` along with the chosen effect configuration via an HTTP POST request to `/s2s/v2.0/task/body-reshape`.\n    - Await a unique task ID in the response, which identifies this interaction.\n\n5. **Poll Task Status (Continuous Check):**\n    - Use the obtained `task_id` to periodically poll the task status using an HTTP GET request (e.g., `GET /s2s/v2.0/task/body-reshape/${task_id}`).\n    - Continuously monitor for:\n    - `Task_status = \"success\"` (process completed).\n    - `Task_status = \"error\"` (resolve or retry if applicable).\n    - Update the workflow accordingly once the status transitions to success.\n\nThis structured workflow ensures efficient integration with user inputs, automated monitoring of tasks, and seamless retrieval of results.\n\n---\n\n* API Playground\n\nInteractively explore and test the API using our official playground:\n\n**API Playground:**\n[http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/](http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/)\n\n---\n\n* Authentication\n- Include your API key in the request header using **Bearer Token**:\n```\nAuthorization: Bearer YOUR_API_KEY\n```\nYou can find your API Key at https://yce.makeupar.com/api-console/en/api-keys/.\n\n\n* 1. Upload an Image\n\nYou may upload a file directly to the server or provide a valid image URL in the AI task payload.\n\n* Upload Endpoint\n\n```\nPOST /s2s/v2.0/file\n```\n\nAlternatively, skip this step if you already have a public image URL.\n\n---\n\n* 2. Prepare an effect template\n\n* Preprocessing\nOutput detected bounding boxes in pixel coordinate. Use the index of result to create a Body Reshape AI task later.\n```\n{\n\"timed\": number,\n\"result\": [\n{\n \"left\": number,\n \"top\": number,\n \"width\": number,\n \"height\": number\n}\n]\n}\n```\n\n* Effect Template JSON Schemas\n```\n{\n\"version\": \"1.0\",\n\"index\": 0,\n\"features\": {\n\"arm\": 0, // -100~100\n\"breast_left\": 0, // -100~100\n\"breast_right\": 0, // -100~100\n\"hip\": 0, // -100~100\n\"hip_lift\": 0, // -100~100\n\"leg\": 0, // -100~100\n\"neck_left\": 0, // 0~100\n\"neck_right\": 0, // 0~100\n\"shoulder_left\": 0, // -100~100\n\"shoulder_right\": 0, // -100~100\n\"squared_shoulder_left\": 0, // -100~100\n\"squared_shoulder_right\": 0, // -100~100\n\"slim\": 0, // -100~100\n\"taller\": 0, // 0~100\n\"waist\": 0, // -100~100\n\"belly\": 0 // -100~100\n}\n}\n```\nindex: index of detected body from preprocessing. optional, default 0.\nfeatures: required at least 1, non-zero body reshape parameter, cannot be all zero.\n\n\n* Example Payload (ready to send)\n```\n{\n \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/body_reshape_02_7777218379.jpg\",\n \"version\": \"1.0\",\n \"index\": 0,\n \"features\": {\n\"arm\": 0,\n\"waist\": -20,\n\"taller\": 80,\n\"squared_shoulder_left\": 10,\n\"squared_shoulder_right\": 10,\n\"neck_left\": 0,\n\"neck_right\": 0,\n\"hip\": 10,\n\"breast_left\": 30,\n\"breast_right\": 30,\n\"slim\": -70,\n\"shoulder_left\": 30,\n\"shoulder_right\": 30,\n\"leg\": -30,\n\"hip_lift\": 0,\n\"belly\": -50\n }\n}\n```\n\n\n* 3. Create a Body Reshape AI Task and Poll for Results\n\nOnce you have an image and a complete effect payload, create a task. The API processes the request asynchronously. You must poll the task status until it reaches `success` or `error`.\n\n* Create Task Endpoint\n\n```\nPOST /s2s/v2.0/task/body-reshape\n```\n\n* Polling Endpoint\n\n```\nGET /s2s/v2.0/task/body-reshape/{task_id}\n```\n\n---\n\n## File Specs & Errors\n\n* AI Body Reshape Specification\n\n**Supported Selfie View**\nFull body shot with clear facial expression and body posture visible.\n\n![](https://plugins-media.makeupar.com/strapi/assets/thumbnail_body_reshape_02_7777218379.jpg)\n\n**Visibility & Pose Requirements**\n\n| **Region** | **What must be true in the source image** |\n|------------|---------------------------------------------------|\n| **Neck** | The neck must be visible in the source image. |\n| **Arm** | Both arms – upper arm, forearm and hand – have to be fully shown. |\n| **Leg** | The whole leg must appear in the picture. |\n| **Hip** | Hips need to be in view. |\n| **Hip‑Lift** | Hips need to be in view. |\n| **Shoulder** | • Shoulders are required to be seen.<br>• Raising a hand is not allowed.<br>• A 90° side pose is not allowed. |\n| **Belly** | The belly is required to be visible. |\n| **Waist** | Waist must be visible. |\n| **Breast** | • Breast area must appear in the picture.<br>• The shot should include the hips (i.e., not a “half‑body without hips”).<br>• The middle of the breast must be shown. |\n| **Slim** | Shoulders need to be in the frame. |\n| **Taller** | • Hips must appear.<br>• A half‑body view should include the legs (i.e., legs are visible). |\n\n\n\n**Body Reshape Customization Parameters Guide**\n\n| Category | Parameter | Function | Min Value (-100 / 0) | Max Value (100) |\n| -------- | --------- | -------- | -------------------- | --------------- |\n| Arms| Intensity | Adjusts the thickness of the arms | Thin | Thick |\n| Belly| Intensity | Adjusts abdominal projection | Flat | Protruding |\n| Chest| Intensity (Left / Right) | Adjusts chest volume on each side | Flat | Full |\n| Hip Lift | Intensity | Adjusts the curvature and lift of the hips (adds a butt‑lifting effect) | Sculpted (lifted and tightened) | Rounded (lifted with fuller volume) |\n| Hip Size | Intensity | Adjusts the overall width of the hips | Narrow | Wide |\n| Legs| Intensity | Adjusts the thickness of the legs | Thin | Thick|\n| Neck| Intensity (Left / Right) | Adjusts neck contour and slimming per side| Original (0)| Tucked in |\n| Shoulder Width | Intensity (Left / Right) | Adjusts the span of each shoulder | Narrow | Broad |\n| Shoulder Shape | Intensity (Left / Right) | Adjusts the angle and slope of each shoulder | Sloped | Squared |\n| Slim| Intensity | Adjusts overall body curvature | Slim | Curvy |\n| Tall| Intensity | Adjusts the overall character height | Original (0) | Taller |\n| Waist| Intensity | Adjusts the width of the waistline | Narrow | Wide |\n\n**Note:** *“Left” and “Right” refer to the character's perspective, not the viewer's side of the screen.*\n\n\n---\n\n* Supported Formats & Dimensions\n\n|AI Feature|Supported Dimensions|Supported File Size|Supported Formats|\n| ---- | ---- | ---- | ---- |\n|AI Body Reshape|long side <= 2048, short side >= 320|< 10MB|jpg/jpeg/png|\n\n* Error Codes\n\n| Error Code | Description |\n| ---- | ---- |\n| RUNTIME_ERROR | An unexpected error occurred dubody reshape runtime |\n| PHOTO_DETECTION_FAIL | The user photo could not be processed correctly, for example no hand detected |\n| PHOTO_CHECK_INVALID | The pose or size of the user photo is invalid |\n| INPUT_ERROR | The input file format is incorrect |\n| INPUT_MAIN_IMAGE_EMPTY | A user image is required |\n\n\n* Environment & Dependency\n\n| Sample Code Language / Tool | Recommended Runtime Versions |\n|---|---|\n| cURL | - bash >= 3.2</br>- curl >= 7.58 (modern TLS/HTTP support)</br>- jq >= 1.6 (robust JSON parsing) |\n| Node.js (JavaScript) | Node >= 18 (for global fetch) |\n| JavaScript | - Chrome / Edge >= 80</br>- Firefox >= 74</br>- Safari >= 13.1 |\n| PHP | PHP >= 7.4 (for modern TLS/compat), ext-curl (recommended) or allow_url_fopen=On + ext-openssl, ext-json |\n| Python | Python >= 3.10 (for f-strings), requests >= 2.20.0 |\n| Java | Java 11+ (for HttpClient), Jackson Databind >= 2.12.0 |\n\n---\n\n## Unit Consumption\n\n| AI Feature | Unit Consumed |\n|---|---|\n| AI Body Reshape V1.0 | 1 |\n\n---\n"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"docs.perfectcorp.com","port":4000,"ipAddress":"216.73.216.26"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/reference/ai_body_reshape","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}