Unified Codex + Claude tutorial · edit

How to change clothes and outfits in an image with Medux MCP

Learn to change clothes and outfits in an image with the Medux API through Codex or Claude MCP. Check inputs, tool calls, task status, and output.

POST/api/app/v1/process/image/outfit_swap

Transfer the outfit from the reference image onto the target subject.

Open the Image Outfit Swap API reference →
Choose your AI client

Follow the Codex or Claude workflow

The Medux operation and request fields are shared. Switch tabs for the client-specific prompt, approval pattern, screenshots, and walkthrough.

Codex-specific workflow

Run AI Clothes Swap as a Codex MCP task

Use the active workspace as the source of truth. Ask Codex to identify the target person image and outfit reference image, with each role clearly assigned, select medux_image_outfit_swap, and keep the Medux task ID and returned output with the rest of the project. Naming the input roles and the expected result prevents an agent from guessing which file should be used where.

Codex prompt pattern

In this workspace, use medux_image_outfit_swap through Medux MCP to swap clothes and outfits in an image.
First inspect and identify the target person image and outfit reference image, with each role clearly assigned.
Show me the exact tool arguments before execution.
After the task completes, return the outfit-swapped image and verify that the requested clothing is transferred while the target identity and body position remain consistent.

Approval gate

Before approving the call, compare the selected tool, file or asset IDs, ordering, timing, and output settings with the request. If a local filename was mapped to an uploaded Medux file ID, keep that mapping visible so it can be audited later.

Result verification

Let Codex monitor an asynchronous task until it reaches a terminal state, then save or report the outfit-swapped image. The final check is explicit: confirm that the requested clothing is transferred while the target identity and body position remain consistent.

What this tutorial does

Medux operation

Transfer the outfit from the reference image onto the target subject.

Agent workflow

Codex selects medux_image_outfit_swap, presents the arguments for review, calls Medux, and reports the response.

Before you start

Authentication

  • Authentication is required via Authorization header.

Preconditions

  • Upload the source file and create a file reference before calling this endpoint.
  • Successful requests return a Medux task record immediately. Use the task query or sync endpoints to track completion.
  • All file inputs must be uploaded and persisted as file references before submission.

Prompt Codex

Start with a clear instruction that names the Medux operation and the intended inputs.

Transfer the outfit from the reference image onto the target subject.

Request fields to review

Confirm these values before approving the MCP tool call. The linked API page remains the source of truth for current limits and response semantics.

FieldTypeRequirementPurpose
source_image_file_idstringRequiredSource image file id.
target_outfit_image_file_idstringRequiredTarget outfit image file id.
model_idstringOptionalOutfit swap model id. Default: image-outfit-swap-default.
titlestringOptionalOptional task title.

Step-by-step workflow

01

Connect Medux MCP to Codex

Add the Medux remote MCP endpoint to Codex, provide an authorized credential, and confirm that the medux_image_outfit_swap tool is available.

02

Prepare the required inputs

Prepare the source files, asset IDs, text, or settings required by the operation. Upload local media first when the tool requests file IDs.

03

Ask Codex to run Image Outfit Swap

Use one direct instruction with the intended values. Codex should select the Medux tool and show the proposed arguments before execution.

04

Review and approve the tool call

Check that the tool is medux_image_outfit_swap and that each file ID, task ID, option, and output setting matches your request before approving it.

05

Check the Medux response

If Medux returns an asynchronous task, let the agent monitor it until completion; otherwise review the immediate response and save any result identifiers or output URLs.

Workflow recap

User goal
  ↓
Codex selects medux_image_outfit_swap
  ↓
Review inputs and approve the tool call
  ↓
Medux runs Image Outfit Swap
  ↓
Codex reports the response and output

Frequently asked questions

Can Codex use the Medux Image Outfit Swap API through MCP?

Codex can call the medux_image_outfit_swap Medux MCP tool to transfer the outfit from the reference image onto the target subject. This guide covers the required inputs, approval flow, result handling, and the matching API reference.

Which MCP tool does this tutorial use?

This workflow uses medux_image_outfit_swap. Review its arguments before approval and consult the API reference for the current contract.

Claude-specific workflow

Run AI Clothes Swap as a Claude MCP workflow

Keep the goal, source assets, and constraints together in the conversation. Ask Claude to restate the target person image and outfit reference image, with each role clearly assigned before proposing the Medux outfit-swap tool. That context checkpoint makes the file roles and desired outcome easy to correct before any Medux call is approved.

Claude prompt pattern

Using the assets and requirements in this conversation, help me swap clothes and outfits in an image with Medux MCP.
Restate which input fulfills each role: the target person image and outfit reference image, with each role clearly assigned.
Propose the the Medux outfit-swap tool call and summarize its arguments before asking for approval.
When it finishes, return the outfit-swapped image with a checklist confirming that the requested clothing is transferred while the target identity and body position remain consistent.

Context checkpoint

Have Claude summarize the intended transformation, identify every source asset by role, and list the important constraints. Review that summary together with the proposed tool arguments; correct the conversation first if a file, order, time range, or setting is ambiguous.

Result verification

Keep the Medux task ID in the conversation while Claude checks progress. When processing ends, ask for the outfit-swapped image plus a concise validation checklist confirming that the requested clothing is transferred while the target identity and body position remain consistent.

Workflow at a glance

The video demonstrates a compact five-stage flow. Claude reads the request, locates the local files, obtains upload URLs, sends the assets to Medux, starts the outfit-swap task, monitors processing, and saves the returned image.

Prepare images
Describe the change
Upload through MCP
Run outfit swap
Download result

Step-by-step tutorial

01

Prepare the source and clothing-reference images

Place the image of the person and the reference image of the desired outfit in the same project folder. In the example, the source file is girl.JPEG and the clothing reference is clothes.PNG.

Source imageThe person whose outfit will be changed.
Clothing referenceThe outfit Medux should transfer to the person.
02

Give Claude one clear instruction

Describe the target result, identify both files, and tell Claude to use Medux through MCP. The tutorial also asks Claude to upload the files with a curl command.

Example prompt
Using Medux, change the girl's outfit in girl.JPEG to match the clothing shown in clothes.PNG. Upload the files using a curl command.
Keep the request specific. Name the source image, the clothing-reference image, and the exact edit you want. Claude can then select the correct Medux tool without a separate dashboard workflow.
Claude receives the outfit-change instruction
Claude interprets the request and begins planning the Medux workflow.
03

Let Claude prepare and upload both assets

Claude checks that the files exist, requests upload locations, and uploads the two images. In the recorded workflow, it creates a small helper when direct sandbox uploads are restricted, then completes the uploads through the browser or terminal.

# Generic upload pattern used by the workflow
curl -X PUT "<MEDUX_PRESIGNED_UPLOAD_URL>" \
  -H "Content-Type: image/jpeg" \
  --data-binary "@./girl.JPEG"

curl -X PUT "<MEDUX_PRESIGNED_UPLOAD_URL>" \
  -H "Content-Type: image/png" \
  --data-binary "@./clothes.PNG"
Claude uploads source and clothing reference files
Claude prepares upload URLs and sends both images before starting the edit.
Terminal showing successful image uploads
The terminal confirms that both source files were uploaded successfully.
04

Run the Medux outfit-swap tool

After both uploads succeed, Claude calls the Medux outfit-change tool through MCP. It passes the uploaded source image and clothing reference, starts the task, and waits for Medux to finish the AI rendering.

You do not need to write the API integration manually. Claude handles the tool selection, parameters, task submission, and status checks through the MCP connection.
Claude starts the Medux outfit swap task
The task moves from asset upload to Medux processing.
05

Download and review the generated image

When processing is complete, Claude receives the output URL, downloads the generated image into the project folder, and reports the saved file path. Open the result and verify that the clothing changed while the person, pose, and overall scene remain consistent.

Claude reports successful outfit swap completion
Claude confirms completion and saves the final image locally.

Example result

Source, reference, and generated result

Below is a complete visual example for this tutorial: src is the original source image, tgt is the outfit reference image, and rst is the final Medux output.

src
Source Image for the Medux outfit change example
Source Image
Original person image used as the source.
tgt
Target Reference for the Medux outfit change example
Target Reference
Reference outfit image used to guide the clothing change.
rst
Generated Result for the Medux outfit change example
Generated Result
Final outfit-change result generated by Medux.

Result

The final output keeps the original subject and composition while replacing the outfit with the clothing shown in the reference image. The full workflow stays inside Claude: one instruction, one MCP connection, and a downloadable Medux result.

✓ Source identity retained
✓ Reference outfit transferred
✓ Output saved locally

Recommended prompt template

Reuse this structure for other outfit-change tasks.

Using Medux through MCP, change the outfit of the person in <SOURCE_IMAGE> to match the clothing in <REFERENCE_IMAGE>.

Preserve the person's identity, pose, body proportions, lighting, and background. Upload both files, run the outfit-swap task, monitor the result, and save the final image locally.

Quick answer

How do I change clothes and outfits in an image with Medux MCP?

Connect either Codex or Claude to Medux MCP, prepare the required inputs, review the proposed medux_image_outfit_swap call, and verify the returned result. The tabs above keep client-specific prompting on one canonical page.

Can I use the same Medux tool in Codex and Claude?

Yes. The client interaction differs, but both use the same Medux MCP tool and API request contract shown in this tutorial.

Related developer intent

Use AI agents to change clothes and outfits in an image

This tutorial addresses developer workflows for AI outfit changer API and change clothes in a photo with AI by making the task repeatable through the Medux API. Codex or Claude can prepare inputs, show the MCP tool arguments for approval, monitor processing, and return an output that can be checked against the original request.

This capability can feed an image-to-video AI pipeline by preparing the source image, preserving the intended subject, and passing an approved asset into a photo-to-video or AI image-animation workflow.

Can Codex or Claude change clothes and outfits in an image through Medux MCP?

Yes. Use the client-specific tab above to prepare the inputs, review the Medux tool call, run the operation, and verify the returned result. The linked API reference remains the source of truth for supported fields and limits.

Production, trust, and developer intent

Add consent and review controls when you change clothes and outfits in an image

Treat this as a consent-based, auditable workflow for change clothes and outfits in an image. Use only a voice, face, avatar, or reference asset that you own or have explicit permission to process; keep the source authorization, approved prompt, Medux task ID, and accepted output together for later review.

For production use, pair the Medux API with your own consent records, identity checks, access controls, retention rules, and human approval. These tutorials promote responsible AI media use but do not claim automatic consent verification.

What makes an AI avatar or voice workflow consent-based?

Document who authorized the source material, restrict who can submit tasks, keep the approved inputs and output together, and require review before publishing or reusing a likeness or voice.