Before you start
The demo uses two local JPG files. One image provides the replacement head, and the other image provides the base body or scene.
swap_head_src.jpgThe replacement head image. In the video, Codex treats this as the head donor.swap_head_target.jpgThe base image. Medux keeps this image as the body and scene recipient.Step-by-step workflow
Ask Codex to run the Medux head-swap tool
Use a direct prompt. Codex should know which image is the head donor and which image is the target body.
Swap the head in "swap_head_src.jpg" with the head in "swap_head_target.jpg". Use medux. head swap!

Let Codex locate files and select the correct Medux endpoint
Codex lists the local files, finds the Medux head-swap tool, and avoids using a generic face-swap endpoint. This matters because the task is specifically a head replacement, not just a facial blend.

Submit the head-swap task
After both images are uploaded, Codex submits the Medux task. In this demo, swap_head_src.jpg is passed as the replacement head and swap_head_target.jpg is passed as the base image.

Poll until Medux returns the output
Codex keeps checking the task status as it moves from QUEUED to PROCESSING. Once the render is complete, it returns an output file such as head_swap_output.png plus the task ID for traceability.

Source, reference, and generated result
Compare the three images below to see how the source image, target reference, and final Medux output relate to one another.



Publish-ready summary
Medux turns image editing into an agent-friendly workflow. Instead of manually uploading assets, choosing endpoints, and polling job status, Codex can call Medux through MCP and operate the full head-swap pipeline from one prompt.
Use one image as the replacement head and one as the base image.
Codex selects the Medux tool, uploads files, and starts the job.
The final PNG is returned with a task ID for easy checking.
Explore related workflows
Continue with a nearby Medux workflow or compare how the same task works across Claude MCP and Codex MCP.